Unverified Commit cb8eca73 authored by Vitalii's avatar Vitalii Committed by GitHub
Browse files

Merge pull request #3 from BublykVitalii/med_online

Med online
parents 98b2d2b3 08450012
{
"cSpell.words": [
"Anyy",
"ARGB",
"autovalidate",
"Aкушер",
"Cirbi",
"horiz",
"LTRB",
"Medcentre",
"Pranksy",
"Pransky",
"resulat",
"Ruru",
"Rypto",
"searchfield",
"slava",
"speciality",
"sublist",
"toggleable",
"unfocus",
"Vika"
"Vika",
"vsync",
"Waifu",
"womens",
"woomens",
"Аллергия",
"Беременность",
"боли",
"Вайфу",
"Врач",
"врача",
"врачи",
"гинеколог",
"Дата",
"Депрессия",
"докторе",
"Женские",
"Записаться",
"записи",
"Зубные",
"Искать",
"Карта",
"клинику",
"лекарства",
"Любая",
"Любой",
"Медцентр",
"медцентры",
"Найти",
"Отзывы",
"поиск",
"приема",
"проблемы",
"Простуда",
"Сбросить",
"Сердечные",
"Симптомы",
"Сохранить",
"Специализаци",
"Специализации",
"специалист",
"Список",
"Стаж",
"Сыпь",
"Твоя",
"Услуги",
"Усталось",
"Фильтр"
]
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:flutter_animation/infrastructure/theme/dark_theme.dart';
import 'package:flutter_animation/infrastructure/theme/light_theme.dart';
import 'package:flutter_animation/screens/maine_screen/maine_screen.dart';
import 'package:provider/provider.dart';
// ---Texts---
const _kTitle = 'my experience';
......@@ -15,15 +17,31 @@ class MyApp extends StatefulWidget {
}
class MyAppState extends State<MyApp> {
ThemeMode _themeMode = ThemeMode.system;
void setThemeMode(ThemeMode themeMode) {
setState(() {
_themeMode = themeMode;
});
}
@override
Widget build(BuildContext context) {
Widget child = MaterialApp(
title: _kTitle.toUpperCase(),
themeMode: ThemeMode.dark,
themeMode: _themeMode,
theme: getLightTheme(context),
darkTheme: getDarkTheme(context),
onGenerateRoute: onGenerateRoute,
);
return child;
return MultiProvider(
providers: [
Provider.value(value: this),
Provider.value(value: _themeMode),
],
child: child,
);
}
Route onGenerateRoute(RouteSettings? settings) {
......
......@@ -8,4 +8,5 @@ class AppColors {
static const accentColor = Color.fromRGBO(107, 253, 204, 1);
static const text = Color.fromRGBO(196, 196, 196, 1);
static const buttonColorGrey = Color.fromRGBO(59, 59, 59, 1);
static const accentColorMedical = Color.fromRGBO(33, 147, 157, 1);
}
......@@ -14,4 +14,19 @@ class AppImages {
static const artSeven = 'assets/images/art_seven.png';
static const artEight = 'assets/images/art_eight.png';
static const ethLogo = 'assets/images/eth_logo.png';
static const med = 'assets/images/med.png';
static const medCentre = 'assets/images/medCentre.png';
static const doctors = 'assets/images/doctors.png';
static const allergies = 'assets/images/allergies.png';
static const cold = 'assets/images/cold.png';
static const computerTired = 'assets/images/computer_tired.png';
static const depression = 'assets/images/depression.png';
static const heartProblems = 'assets/images/heart_problems.png';
static const pregnancy = 'assets/images/pregnancy.png';
static const rash = 'assets/images/rash.png';
static const toothache = 'assets/images/toothache.png';
static const woomensPain = 'assets/images/womens_pain.png';
static const doctor = 'assets/images/doctor.png';
static const doctorsList = 'assets/images/doctorsList.png';
}
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_animation/infrastructure/theme/app_colors.dart';
const _colorTheme = ColorScheme(
brightness: Brightness.light,
primary: AppColors.accentColorMedical,
onPrimary: Colors.white,
secondary: Colors.black,
onSecondary: Colors.black,
error: Colors.red,
onError: Colors.red,
background: Colors.white,
onBackground: Colors.black,
surface: Colors.white,
onSurface: Colors.black,
);
Color _getCheckboxCheckedColor(Set<MaterialState> states) {
if (!states.contains(MaterialState.disabled)) {
return Colors.white;
}
return Colors.grey;
}
Color _getCheckboxFillColor(Set<MaterialState> states) {
if (!states.contains(MaterialState.disabled)) {
return AppColors.accentColorMedical;
}
return AppColors.accentColorMedical;
}
Color _getSwitchTrackColor(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return AppColors.accentColorMedical;
} else if (states.contains(MaterialState.selected)) {
return AppColors.accentColorMedical;
}
return Colors.grey.shade400;
}
Color _getSwitchThumbColor(Set<MaterialState> states) {
if (states.contains(MaterialState.disabled)) {
return Colors.grey.shade400;
} else if (states.contains(MaterialState.selected)) {
return Colors.white;
}
return Colors.white;
}
Color _getRadioFillColor(Set<MaterialState> states) {
if (!states.contains(MaterialState.disabled)) {
return Colors.black;
}
return Colors.grey;
}
BorderSide _getOutlinedColor(Set<MaterialState> states) {
if (!states.contains(MaterialState.disabled)) {
return const BorderSide(color: Colors.white);
}
return const BorderSide(color: Colors.white);
}
ThemeData getLightTheme(BuildContext context) {
final textTheme =
Typography.material2018(platform: defaultTargetPlatform).black;
final buttonScaledPadding = ButtonStyleButton.scaledPadding(
const EdgeInsets.symmetric(horizontal: 20, vertical: 18),
const EdgeInsets.symmetric(horizontal: 14, vertical: 18),
const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
MediaQuery.maybeOf(context)?.textScaleFactor ?? 1,
);
final textButtonScaledPadding = ButtonStyleButton.scaledPadding(
const EdgeInsets.symmetric(horizontal: 16, vertical: 14),
const EdgeInsets.symmetric(horizontal: 8, vertical: 10),
const EdgeInsets.symmetric(horizontal: 4, vertical: 8),
MediaQuery.maybeOf(context)?.textScaleFactor ?? 1,
);
return ThemeData.from(
colorScheme: _colorTheme,
textTheme: textTheme.apply(
bodyColor: Colors.black,
displayColor: Colors.black,
decorationColor: Colors.black,
),
).copyWith(
tabBarTheme: const TabBarTheme(
labelColor: Colors.black,
unselectedLabelColor: Colors.grey,
),
appBarTheme: const AppBarTheme(
foregroundColor: AppColors.accentColorMedical,
backgroundColor: Colors.white,
centerTitle: true,
),
iconTheme: const IconThemeData(color: Colors.black),
textButtonTheme: TextButtonThemeData(
style: TextButton.styleFrom(
backgroundColor: AppColors.accentColorMedical,
primary: Colors.white,
padding: textButtonScaledPadding,
).copyWith(
side: MaterialStateProperty.resolveWith(_getOutlinedColor),
),
),
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
primary: Colors.black,
onPrimary: Colors.white,
padding: buttonScaledPadding,
),
),
outlinedButtonTheme: OutlinedButtonThemeData(
style: OutlinedButton.styleFrom(
primary: Colors.black,
padding: buttonScaledPadding,
).copyWith(
side: MaterialStateProperty.resolveWith(_getOutlinedColor),
),
),
brightness: Brightness.light,
scaffoldBackgroundColor: Colors.white,
checkboxTheme: CheckboxThemeData(
fillColor: MaterialStateProperty.resolveWith((_getCheckboxFillColor)),
checkColor: MaterialStateProperty.resolveWith(_getCheckboxCheckedColor),
),
switchTheme: SwitchThemeData(
trackColor: MaterialStateProperty.resolveWith(_getSwitchTrackColor),
thumbColor: MaterialStateProperty.resolveWith(_getSwitchThumbColor),
),
radioTheme: RadioThemeData(
fillColor: MaterialStateProperty.resolveWith(_getRadioFillColor),
),
inputDecorationTheme: InputDecorationTheme(
labelStyle: const TextStyle(
color: Colors.black,
),
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey.shade200),
borderRadius: BorderRadius.circular(10.0),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.grey.shade200),
borderRadius: BorderRadius.circular(10.0),
),
errorBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.black),
borderRadius: BorderRadius.circular(10.0),
),
focusedErrorBorder: OutlineInputBorder(
borderSide: const BorderSide(color: Colors.red),
borderRadius: BorderRadius.circular(10.0),
),
),
toggleButtonsTheme: ToggleButtonsThemeData(
fillColor: AppColors.accentColorMedical,
splashColor: AppColors.accentColorMedical,
borderColor: Colors.grey.shade200,
),
);
}
......@@ -47,7 +47,6 @@ class _FormFieldScreenState extends State<FormFieldScreen> {
return Scaffold(
appBar: AppBar(
title: Text(_kTitle.toUpperCase()),
centerTitle: true,
),
body: Form(
key: _formKey,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment