diff --git a/assets/icons/Devices.svg b/assets/icons/Devices.svg index 00904ad..51d527c 100644 --- a/assets/icons/Devices.svg +++ b/assets/icons/Devices.svg @@ -1,13 +1,21 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/icons/Hot 1.jpg b/assets/icons/Hot 1.jpg new file mode 100644 index 0000000..5281185 Binary files /dev/null and b/assets/icons/Hot 1.jpg differ diff --git a/assets/icons/Layout.svg b/assets/icons/Layout.svg index 568b6d7..4756e3b 100644 --- a/assets/icons/Layout.svg +++ b/assets/icons/Layout.svg @@ -1,13 +1,21 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/assets/icons/Winter 1.jpg b/assets/icons/Winter 1.jpg new file mode 100644 index 0000000..12e8b56 Binary files /dev/null and b/assets/icons/Winter 1.jpg differ diff --git a/assets/icons/Winter_mode.svg b/assets/icons/Winter_mode.svg new file mode 100644 index 0000000..6293ee6 --- /dev/null +++ b/assets/icons/Winter_mode.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/icons/home-2.svg b/assets/icons/home-2.svg index d700dde..9ab0dca 100644 --- a/assets/icons/home-2.svg +++ b/assets/icons/home-2.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/assets/icons/home.jpg b/assets/icons/home.jpg new file mode 100644 index 0000000..8b20626 Binary files /dev/null and b/assets/icons/home.jpg differ diff --git a/assets/icons/home.svg b/assets/icons/home.svg index a0c2e64..189c2fd 100644 --- a/assets/icons/home.svg +++ b/assets/icons/home.svg @@ -1,9 +1,11 @@ - - - - - - - - + + + + + + + + diff --git a/assets/icons/summer_mode.svg b/assets/icons/summer_mode.svg new file mode 100644 index 0000000..d5de0a4 --- /dev/null +++ b/assets/icons/summer_mode.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/lib/features/navigation/bloc/nav_cubit.dart b/lib/features/app_layout/bloc/nav_cubit.dart similarity index 100% rename from lib/features/navigation/bloc/nav_cubit.dart rename to lib/features/app_layout/bloc/nav_cubit.dart diff --git a/lib/features/navigation/bloc/nav_state.dart b/lib/features/app_layout/bloc/nav_state.dart similarity index 100% rename from lib/features/navigation/bloc/nav_state.dart rename to lib/features/app_layout/bloc/nav_state.dart diff --git a/lib/features/navigation/view/navigation_view.dart b/lib/features/app_layout/view/app_layout.dart similarity index 74% rename from lib/features/navigation/view/navigation_view.dart rename to lib/features/app_layout/view/app_layout.dart index 661b44f..39605f8 100644 --- a/lib/features/navigation/view/navigation_view.dart +++ b/lib/features/app_layout/view/app_layout.dart @@ -1,14 +1,14 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart'; -import 'package:syncrow_app/features/navigation/view/widgets/app_body.dart'; -import 'package:syncrow_app/features/navigation/view/widgets/default_app_bar.dart'; -import 'package:syncrow_app/features/navigation/view/widgets/default_nav_bar.dart'; +import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart'; +import 'package:syncrow_app/features/app_layout/view/widgets/app_body.dart'; +import 'package:syncrow_app/features/app_layout/view/widgets/default_app_bar.dart'; +import 'package:syncrow_app/features/app_layout/view/widgets/default_nav_bar.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; -class NavigationView extends StatelessWidget { - const NavigationView({super.key}); +class AppLayout extends StatelessWidget { + const AppLayout({super.key}); @override Widget build(BuildContext context) { diff --git a/lib/features/navigation/view/widgets/app_bar_home_dropdown.dart b/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart similarity index 78% rename from lib/features/navigation/view/widgets/app_bar_home_dropdown.dart rename to lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart index e5c622c..5f60533 100644 --- a/lib/features/navigation/view/widgets/app_bar_home_dropdown.dart +++ b/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:gap/gap.dart'; import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; import '../../../shared_widgets/text_widgets/body_large.dart'; @@ -22,8 +23,12 @@ class AppBarHomeDropdown extends StatelessWidget { children: [ SvgPicture.asset( IconsManager.home, - width: 30, - height: 30, + width: 25, + height: 25, + colorFilter: const ColorFilter.mode( + ColorsManager.textPrimaryColor, + BlendMode.srcIn, + ), ), const Gap(5), const BodyLarge(text: 'Home'), diff --git a/lib/features/navigation/view/widgets/app_body.dart b/lib/features/app_layout/view/widgets/app_body.dart similarity index 75% rename from lib/features/navigation/view/widgets/app_body.dart rename to lib/features/app_layout/view/widgets/app_body.dart index a700fe2..60e1652 100644 --- a/lib/features/navigation/view/widgets/app_body.dart +++ b/lib/features/app_layout/view/widgets/app_body.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart'; +import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart'; import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; class AppBody extends StatelessWidget { @@ -24,7 +24,11 @@ class AppBody extends StatelessWidget { opacity: 0.4, ), ), - child: NavCubit.of(context).currentPage, + child: Padding( + padding: const EdgeInsets.only( + top: 60, right: 15, left: 15, bottom: 100), + child: NavCubit.of(context).currentPage, + ), ); }, ); diff --git a/lib/features/navigation/view/widgets/default_app_bar.dart b/lib/features/app_layout/view/widgets/default_app_bar.dart similarity index 88% rename from lib/features/navigation/view/widgets/default_app_bar.dart rename to lib/features/app_layout/view/widgets/default_app_bar.dart index f4a3d2b..0118385 100644 --- a/lib/features/navigation/view/widgets/default_app_bar.dart +++ b/lib/features/app_layout/view/widgets/default_app_bar.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart'; -import 'package:syncrow_app/features/navigation/view/widgets/app_bar_home_dropdown.dart'; +import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart'; +import 'package:syncrow_app/features/app_layout/view/widgets/app_bar_home_dropdown.dart'; class DefaultAppBar extends StatelessWidget implements PreferredSizeWidget { const DefaultAppBar({super.key}); diff --git a/lib/features/navigation/view/widgets/default_nav_bar.dart b/lib/features/app_layout/view/widgets/default_nav_bar.dart similarity index 95% rename from lib/features/navigation/view/widgets/default_nav_bar.dart rename to lib/features/app_layout/view/widgets/default_nav_bar.dart index 57fef54..150227a 100644 --- a/lib/features/navigation/view/widgets/default_nav_bar.dart +++ b/lib/features/app_layout/view/widgets/default_nav_bar.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart'; +import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; class DefaultNavBar extends StatelessWidget { diff --git a/lib/features/dashboard/view/dashboard_view.dart b/lib/features/dashboard/view/dashboard_view.dart index 8d76c60..eb9340f 100644 --- a/lib/features/dashboard/view/dashboard_view.dart +++ b/lib/features/dashboard/view/dashboard_view.dart @@ -1,49 +1,46 @@ import 'package:flutter/material.dart'; import 'package:gap/gap.dart'; -import 'package:syncrow_app/features/dashboard/view/carbon_emission.dart'; -import 'package:syncrow_app/features/dashboard/view/consumption.dart'; -import 'package:syncrow_app/features/dashboard/view/live_monitor_tab.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/carbon_emission.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/consumption.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_tab.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; -import 'energy_usage.dart'; +import 'widgets/energy_usage.dart'; class DashboardView extends StatelessWidget { const DashboardView({super.key}); @override Widget build(BuildContext context) { - return const Padding( - padding: EdgeInsets.only(top: 60, right: 15, left: 15, bottom: 100), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - TitleMedium( - text: StringsManager.dashboard, - style: TextStyle( - fontSize: 32, - fontWeight: FontWeight.bold, + return const Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + TitleMedium( + text: StringsManager.dashboard, + style: TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + ), + ), + LiveMonitorTab(), + Gap(10), + EnergyUsage(), + Expanded( + child: Padding( + padding: EdgeInsets.only(top: 20), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Consumption(), + Gap(20), + CarbonEmission(), + ], ), ), - LiveMonitorTab(), - Gap(10), - EnergyUsage(), - Expanded( - child: Padding( - padding: EdgeInsets.only(top: 20), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Consumption(), - Gap(20), - CarbonEmission(), - ], - ), - ), - ), - ], - ), + ), + ], ); } } diff --git a/lib/features/dashboard/view/carbon_emission.dart b/lib/features/dashboard/view/widgets/carbon_emission.dart similarity index 97% rename from lib/features/dashboard/view/carbon_emission.dart rename to lib/features/dashboard/view/widgets/carbon_emission.dart index 8691729..82db69a 100644 --- a/lib/features/dashboard/view/carbon_emission.dart +++ b/lib/features/dashboard/view/widgets/carbon_emission.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:gap/gap.dart'; -import 'package:syncrow_app/features/dashboard/view/card_title.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; import 'package:syncrow_app/features/shared_widgets/united_text.dart'; import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; diff --git a/lib/features/dashboard/view/card_title.dart b/lib/features/dashboard/view/widgets/card_title.dart similarity index 100% rename from lib/features/dashboard/view/card_title.dart rename to lib/features/dashboard/view/widgets/card_title.dart diff --git a/lib/features/dashboard/view/consumption.dart b/lib/features/dashboard/view/widgets/consumption.dart similarity index 96% rename from lib/features/dashboard/view/consumption.dart rename to lib/features/dashboard/view/widgets/consumption.dart index fafba8a..ceaa330 100644 --- a/lib/features/dashboard/view/consumption.dart +++ b/lib/features/dashboard/view/widgets/consumption.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:gap/gap.dart'; -import 'package:syncrow_app/features/dashboard/view/card_title.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart'; import 'package:syncrow_app/features/shared_widgets/united_text.dart'; import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; diff --git a/lib/features/dashboard/view/energy_usage.dart b/lib/features/dashboard/view/widgets/energy_usage.dart similarity index 91% rename from lib/features/dashboard/view/energy_usage.dart rename to lib/features/dashboard/view/widgets/energy_usage.dart index d05edf8..c05cadb 100644 --- a/lib/features/dashboard/view/energy_usage.dart +++ b/lib/features/dashboard/view/widgets/energy_usage.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:syncrow_app/features/dashboard/view/energy_usage_header.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/energy_usage_header.dart'; import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; class EnergyUsage extends StatelessWidget { diff --git a/lib/features/dashboard/view/energy_usage_header.dart b/lib/features/dashboard/view/widgets/energy_usage_header.dart similarity index 96% rename from lib/features/dashboard/view/energy_usage_header.dart rename to lib/features/dashboard/view/widgets/energy_usage_header.dart index 05585da..ddd9a09 100644 --- a/lib/features/dashboard/view/energy_usage_header.dart +++ b/lib/features/dashboard/view/widgets/energy_usage_header.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:syncrow_app/features/dashboard/view/card_title.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/card_title.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; import 'package:syncrow_app/features/shared_widgets/united_text.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; diff --git a/lib/features/dashboard/view/live_monitor_tab.dart b/lib/features/dashboard/view/widgets/live_monitor_tab.dart similarity index 91% rename from lib/features/dashboard/view/live_monitor_tab.dart rename to lib/features/dashboard/view/widgets/live_monitor_tab.dart index 71b8ede..8b343aa 100644 --- a/lib/features/dashboard/view/live_monitor_tab.dart +++ b/lib/features/dashboard/view/widgets/live_monitor_tab.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:syncrow_app/features/dashboard/view/live_monitor_widget.dart'; +import 'package:syncrow_app/features/dashboard/view/widgets/live_monitor_widget.dart'; import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; diff --git a/lib/features/dashboard/view/live_monitor_widget.dart b/lib/features/dashboard/view/widgets/live_monitor_widget.dart similarity index 100% rename from lib/features/dashboard/view/live_monitor_widget.dart rename to lib/features/dashboard/view/widgets/live_monitor_widget.dart diff --git a/lib/features/scene/bloc/scene_cubit.dart b/lib/features/scene/bloc/scene_cubit.dart index 0e4903b..74bc3bb 100644 --- a/lib/features/scene/bloc/scene_cubit.dart +++ b/lib/features/scene/bloc/scene_cubit.dart @@ -18,5 +18,5 @@ class SceneCubit extends Cubit { }); } - var scenes = []; + List scenes = []; } diff --git a/lib/features/scene/view/scene_view.dart b/lib/features/scene/view/scene_view.dart index faa8284..b6c0f00 100644 --- a/lib/features/scene/view/scene_view.dart +++ b/lib/features/scene/view/scene_view.dart @@ -1,7 +1,13 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:gap/gap.dart'; import 'package:syncrow_app/features/scene/bloc/scene_cubit.dart'; -import 'package:syncrow_app/features/scene/view/widgets/scene_view_no_scenes.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_small.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; +import 'package:syncrow_app/utils/resource_manager/assets_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; class SceneView extends StatelessWidget { const SceneView({super.key}); @@ -12,9 +18,99 @@ class SceneView extends StatelessWidget { create: (BuildContext context) => SceneCubit(), child: BlocBuilder( builder: (context, state) { - return state is SceneLoading - ? const Center(child: CircularProgressIndicator()) - : const SceneViewNoScenes(); + return Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const TitleMedium( + text: StringsManager.routine, + style: TextStyle( + fontSize: 32, + fontWeight: FontWeight.bold, + ), + ), + const Gap(20), + const BodySmall( + text: StringsManager.tapToRunRoutine, + ), + Row( + children: [ + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 10, + ), + child: DefaultContainer( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + height: 50, + width: 50, + IconsManager.summerMode, + fit: BoxFit.contain, + ), + const Icon( + Icons.play_circle, + size: 40, + color: Colors.grey, + ) + ], + ), + const BodyMedium( + text: StringsManager.summerMode, + fontWeight: FontWeight.bold, + fontSize: 16, + ) + ], + ), + ), + ), + ), + const Gap(10), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric( + vertical: 10, + ), + child: DefaultContainer( + child: Column( + children: [ + Row( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + height: 50, + width: 50, + IconsManager.winterMode, + fit: BoxFit.contain, + ), + const Icon( + Icons.play_circle, + size: 40, + color: Colors.grey, + ) + ], + ), + const BodyMedium( + text: StringsManager.winterMode, + fontWeight: FontWeight.bold, + fontSize: 16, + ) + ], + ), + ), + ), + ), + ], + ) + ], + ); }, ), ); diff --git a/lib/features/shared_widgets/text_widgets/body_medium.dart b/lib/features/shared_widgets/text_widgets/body_medium.dart index ae7fdc7..9301849 100644 --- a/lib/features/shared_widgets/text_widgets/body_medium.dart +++ b/lib/features/shared_widgets/text_widgets/body_medium.dart @@ -10,6 +10,9 @@ class BodyMedium extends StatelessWidget { this.maxLines, this.overflow, this.textAlign, + this.fontSize, + this.fontColor, + this.fontWeight, }); final String text; @@ -18,11 +21,17 @@ class BodyMedium extends StatelessWidget { final TextOverflow? overflow; final TextAlign? textAlign; + final double? fontSize; + + final Color? fontColor; + final FontWeight? fontWeight; @override Widget build(BuildContext context) => CustomText( text, - style: style ?? context.bodyMedium, + style: style ?? + context.bodyMedium.copyWith( + fontSize: fontSize, color: fontColor, fontWeight: fontWeight), // softWrap: true, maxLines: maxLines, // overflow: overflow, diff --git a/lib/my_app.dart b/lib/my_app.dart index e83955e..838deff 100644 --- a/lib/my_app.dart +++ b/lib/my_app.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; -import 'package:syncrow_app/features/navigation/bloc/nav_cubit.dart'; +import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; import 'package:syncrow_app/utils/resource_manager/theme_manager.dart'; @@ -31,7 +31,7 @@ class MyApp extends StatelessWidget { onGenerateRoute: router.Router.generateRoute, initialRoute: Routes.splash, themeMode: ThemeMode.system, - theme: myTheme, + theme: ThemeManager.selectTheme(), supportedLocales: const [ Locale('en', ''), // English, no country code Locale('ar', ''), // Arabic, no country code diff --git a/lib/navigation/router.dart b/lib/navigation/router.dart index 0836b18..3f4ad07 100644 --- a/lib/navigation/router.dart +++ b/lib/navigation/router.dart @@ -3,7 +3,7 @@ import 'package:syncrow_app/features/auth/view/auth_view.dart'; import 'package:syncrow_app/features/dashboard/view/dashboard_view.dart'; import 'package:syncrow_app/features/devices/view/devices_view.dart'; import 'package:syncrow_app/features/layout/view/layout_view.dart'; -import 'package:syncrow_app/features/navigation/view/navigation_view.dart'; +import 'package:syncrow_app/features/app_layout/view/app_layout.dart'; import 'package:syncrow_app/features/profile/view/profile_view.dart'; import 'package:syncrow_app/features/scene/view/scene_view.dart'; import 'package:syncrow_app/features/splash/view/splash_view.dart'; @@ -43,7 +43,7 @@ class Router { case Routes.homeRoute: return MaterialPageRoute( - builder: (_) => const NavigationView(), settings: settings); + builder: (_) => const AppLayout(), settings: settings); default: return MaterialPageRoute( diff --git a/lib/utils/resource_manager/assets_manager.dart b/lib/utils/resource_manager/assets_manager.dart index 217d4ed..e49d235 100644 --- a/lib/utils/resource_manager/assets_manager.dart +++ b/lib/utils/resource_manager/assets_manager.dart @@ -41,9 +41,7 @@ abstract class IconsManager { static const String doorLock = '$base/Door Lock.svg'; static const String gateway = '$base/Gateway.svg'; static const String light = '$base/Light.svg'; + static const String summerMode = '$base/Hot 1.jpg'; + static const String winterMode = '$base/Winter 1.jpg'; static const String screen = '$base/Screen.svg'; } - -abstract class VideosManager { - // static const String registrationVideo = 'assets/videos/video.mp4'; -} diff --git a/lib/utils/resource_manager/color_manager.dart b/lib/utils/resource_manager/color_manager.dart index f4d2977..3f66b50 100644 --- a/lib/utils/resource_manager/color_manager.dart +++ b/lib/utils/resource_manager/color_manager.dart @@ -2,8 +2,10 @@ import 'package:flutter/material.dart'; abstract class ColorsManager { static const Color textPrimaryColor = Color(0xFF5D5D5D); - static const Color primaryColor = Color(0xFF023dfe); - static const Color secondaryColor = Colors.white; + static const Color primaryColor = Color(0xFF0030CB); + static const Color onPrimaryColor = Colors.white; + static const Color secondaryColor = Color(0xFF023DFE); + static const Color onSecondaryColor = Color(0xFF023DFE); static const Color primaryTextColor = Colors.black; static const Color greyColor = Color(0xFFd9d9d9); diff --git a/lib/utils/resource_manager/strings_manager.dart b/lib/utils/resource_manager/strings_manager.dart index 539a924..40512bb 100644 --- a/lib/utils/resource_manager/strings_manager.dart +++ b/lib/utils/resource_manager/strings_manager.dart @@ -6,6 +6,8 @@ class StringsManager { static const dashboard = 'Dashboard'; static const devices = 'Devices'; + static const routine = 'Routines'; + static const tapToRunRoutine = 'Tap to run routine'; static const wizard = 'Wizard'; static const active = 'Active'; static const current = 'Current'; @@ -17,5 +19,7 @@ class StringsManager { static const emissions = 'Emissions'; static const reductions = 'Reductions'; static const winter = 'Winter'; + static const winterMode = 'Winter Mode'; static const summer = 'Summer'; + static const summerMode = 'Summer Mode'; } diff --git a/lib/utils/resource_manager/theme_manager.dart b/lib/utils/resource_manager/theme_manager.dart index 0a84eee..c028314 100644 --- a/lib/utils/resource_manager/theme_manager.dart +++ b/lib/utils/resource_manager/theme_manager.dart @@ -3,154 +3,336 @@ import 'package:flutter/material.dart'; import 'color_manager.dart'; import 'font_manager.dart'; -ThemeData myTheme = ThemeData( - ///main colors - primaryColor: ColorsManager.primaryColor, - // colorScheme: ColorsManager.lightColorScheme, - scaffoldBackgroundColor: Colors.white, +abstract class ThemeManager { + static bool isDarkTheme = false; - ///text theme - textTheme: const TextTheme( - ///display - displayLarge: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s35, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, + static ThemeData selectTheme() => isDarkTheme ? darkTheme : lightTheme; + static ThemeData lightTheme = ThemeData( + ///main colors + primaryColor: ColorsManager.primaryColor, + colorScheme: const ColorScheme( + background: ColorsManager.backgroundColor, + brightness: Brightness.light, + primary: ColorsManager.primaryColor, + onPrimary: ColorsManager.onPrimaryColor, + secondary: ColorsManager.secondaryColor, + onSecondary: ColorsManager.onSecondaryColor, + error: Colors.red, + onError: Colors.white, + onBackground: ColorsManager.textPrimaryColor, + surface: Colors.white, + onSurface: ColorsManager.textPrimaryColor, ), - displayMedium: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s20, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, - ), - displaySmall: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s16, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, + scaffoldBackgroundColor: Colors.white, + + ///text theme + textTheme: const TextTheme( + ///display + displayLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s35, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + displayMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s20, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + displaySmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + + ///title + titleLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s48, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + titleMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s30, + fontWeight: FontsManager.bold, + color: ColorsManager.textPrimaryColor, + ), + titleSmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s25, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + + ///body + bodyLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s18, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + bodyMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s14, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + bodySmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s12, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + + labelLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s18, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + labelMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + labelSmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s14, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), ), - ///title - titleLarge: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s48, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, - ), - titleMedium: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s30, - fontWeight: FontsManager.bold, - color: ColorsManager.textPrimaryColor, - ), - titleSmall: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s25, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, + ///button theme + // buttonTheme: ButtonThemeData( + // buttonColor: ColorsManager.primaryLightColor, + // padding: const EdgeInsets.symmetric(horizontal: AppPadding.p8), + // textTheme: ButtonTextTheme.primary, + // hoverColor: ColorsManager.primaryDarkColor, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(AppRadius.r4), + // ),), + // + // textButtonTheme: TextButtonThemeData( + // style: ButtonStyle( + // backgroundColor: + // MaterialStateProperty.all(ColorsManager.primaryLightColor), + // padding: MaterialStateProperty.all( + // const EdgeInsets.all(AppPadding.p8),), + // textStyle: MaterialStateProperty.all( + // const TextStyle( + // fontFamily: FontsManager.fontFamily, + // fontSize: FontSize.s16, + // fontWeight: FontsManager.regular, + // color: ColorsManager.onPrimaryLightColor, + // ), + // ), + // // shape: MaterialStateProperty.all( + // // RoundedRectangleBorder( + // // borderRadius: BorderRadius.circular(AppRadius.r4), + // // side: const BorderSide(color: Colors.grey), + // // ), + // // ), + // ), + // ), + + ///input decoration theme + inputDecorationTheme: const InputDecorationTheme( + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: ColorsManager.primaryColor), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + labelStyle: TextStyle( + fontFamily: FontsManager.fontFamily, + color: Colors.grey, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + ), ), - ///body - bodyLarge: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s18, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, + ///card theme + //TODO edit card theme + cardTheme: const CardTheme( + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20)), + ), ), - bodyMedium: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s14, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, + ); + + //TODO implement dark theme + static ThemeData darkTheme = ThemeData( + ///main colors + primaryColor: ColorsManager.primaryColor, + colorScheme: const ColorScheme( + background: ColorsManager.backgroundColor, + brightness: Brightness.light, + primary: ColorsManager.primaryColor, + onPrimary: ColorsManager.onPrimaryColor, + secondary: ColorsManager.secondaryColor, + onSecondary: ColorsManager.onSecondaryColor, + error: Colors.red, + onError: Colors.white, + onBackground: ColorsManager.textPrimaryColor, + surface: Colors.white, + onSurface: ColorsManager.textPrimaryColor, ), - bodySmall: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s12, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, + scaffoldBackgroundColor: Colors.white, + + ///text theme + textTheme: const TextTheme( + ///display + displayLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s35, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + displayMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s20, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + displaySmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + + ///title + titleLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s48, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + titleMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s30, + fontWeight: FontsManager.bold, + color: ColorsManager.textPrimaryColor, + ), + titleSmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s25, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + + ///body + bodyLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s18, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + bodyMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s14, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + bodySmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s12, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + + labelLarge: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s18, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + labelMedium: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + labelSmall: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s14, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), ), - labelLarge: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s18, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, - ), - labelMedium: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s16, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, - ), - labelSmall: TextStyle( - fontFamily: FontsManager.fontFamily, - fontSize: FontSize.s14, - fontWeight: FontsManager.regular, - color: ColorsManager.textPrimaryColor, - ), - ), + ///button theme + // buttonTheme: ButtonThemeData( + // buttonColor: ColorsManager.primaryLightColor, + // padding: const EdgeInsets.symmetric(horizontal: AppPadding.p8), + // textTheme: ButtonTextTheme.primary, + // hoverColor: ColorsManager.primaryDarkColor, + // shape: RoundedRectangleBorder( + // borderRadius: BorderRadius.circular(AppRadius.r4), + // ),), + // + // textButtonTheme: TextButtonThemeData( + // style: ButtonStyle( + // backgroundColor: + // MaterialStateProperty.all(ColorsManager.primaryLightColor), + // padding: MaterialStateProperty.all( + // const EdgeInsets.all(AppPadding.p8),), + // textStyle: MaterialStateProperty.all( + // const TextStyle( + // fontFamily: FontsManager.fontFamily, + // fontSize: FontSize.s16, + // fontWeight: FontsManager.regular, + // color: ColorsManager.onPrimaryLightColor, + // ), + // ), + // // shape: MaterialStateProperty.all( + // // RoundedRectangleBorder( + // // borderRadius: BorderRadius.circular(AppRadius.r4), + // // side: const BorderSide(color: Colors.grey), + // // ), + // // ), + // ), + // ), - ///button theme - // buttonTheme: ButtonThemeData( - // buttonColor: ColorsManager.primaryLightColor, - // padding: const EdgeInsets.symmetric(horizontal: AppPadding.p8), - // textTheme: ButtonTextTheme.primary, - // hoverColor: ColorsManager.primaryDarkColor, - // shape: RoundedRectangleBorder( - // borderRadius: BorderRadius.circular(AppRadius.r4), - // ),), - // - // textButtonTheme: TextButtonThemeData( - // style: ButtonStyle( - // backgroundColor: - // MaterialStateProperty.all(ColorsManager.primaryLightColor), - // padding: MaterialStateProperty.all( - // const EdgeInsets.all(AppPadding.p8),), - // textStyle: MaterialStateProperty.all( - // const TextStyle( - // fontFamily: FontsManager.fontFamily, - // fontSize: FontSize.s16, - // fontWeight: FontsManager.regular, - // color: ColorsManager.onPrimaryLightColor, - // ), - // ), - // // shape: MaterialStateProperty.all( - // // RoundedRectangleBorder( - // // borderRadius: BorderRadius.circular(AppRadius.r4), - // // side: const BorderSide(color: Colors.grey), - // // ), - // // ), - // ), - // ), + ///input decoration theme + inputDecorationTheme: const InputDecorationTheme( + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: ColorsManager.primaryColor), + borderRadius: BorderRadius.all(Radius.circular(8)), + ), + labelStyle: TextStyle( + fontFamily: FontsManager.fontFamily, + color: Colors.grey, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + ), + ), - ///input decoration theme - inputDecorationTheme: const InputDecorationTheme( - border: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(8)), + ///card theme + //TODO edit card theme + cardTheme: const CardTheme( + elevation: 0, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20)), + ), ), - enabledBorder: OutlineInputBorder( - borderSide: BorderSide(color: Colors.grey), - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - focusedBorder: OutlineInputBorder( - borderSide: BorderSide(color: ColorsManager.primaryColor), - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - labelStyle: TextStyle( - fontFamily: FontsManager.fontFamily, - color: Colors.grey, - fontSize: FontSize.s16, - fontWeight: FontsManager.regular, - ), - ), - - ///card theme - //TODO edit card theme - cardTheme: const CardTheme( - elevation: 0, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.all(Radius.circular(8)), - ), - ), -); + ); +}