diff --git a/assets/icons/color_wheel.svg b/assets/icons/color_wheel.svg new file mode 100644 index 0000000..793ac1b --- /dev/null +++ b/assets/icons/color_wheel.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/icons/kalvin.svg b/assets/icons/kalvin.svg new file mode 100644 index 0000000..67332f4 --- /dev/null +++ b/assets/icons/kalvin.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/lib/features/app_layout/view/app_layout.dart b/lib/features/app_layout/view/app_layout.dart index 1d2e3a4..39605f8 100644 --- a/lib/features/app_layout/view/app_layout.dart +++ b/lib/features/app_layout/view/app_layout.dart @@ -23,7 +23,7 @@ class AppLayout extends StatelessWidget { child: Scaffold( backgroundColor: ColorsManager.backgroundColor, extendBodyBehindAppBar: true, - // extendBody: true, + extendBody: true, appBar: DefaultAppBar(), body: AppBody(), bottomNavigationBar: DefaultNavBar(), diff --git a/lib/features/app_layout/view/widgets/app_body.dart b/lib/features/app_layout/view/widgets/app_body.dart index 4db97a2..0e13d7d 100644 --- a/lib/features/app_layout/view/widgets/app_body.dart +++ b/lib/features/app_layout/view/widgets/app_body.dart @@ -26,7 +26,8 @@ class AppBody extends StatelessWidget { ), ), child: Padding( - padding: const EdgeInsets.only(top: 60, right: 15, left: 15), + padding: + const EdgeInsets.only(top: 60, right: 15, left: 15, bottom: 80), child: NavCubit.of(context).currentPage, ), ); diff --git a/lib/features/app_layout/view/widgets/default_nav_bar.dart b/lib/features/app_layout/view/widgets/default_nav_bar.dart index 7d517d3..d42d38b 100644 --- a/lib/features/app_layout/view/widgets/default_nav_bar.dart +++ b/lib/features/app_layout/view/widgets/default_nav_bar.dart @@ -21,7 +21,7 @@ class DefaultNavBar extends StatelessWidget { onTap: (int index) { cubit.updatePageIndex(index, context); if (DevicesCubit.get(context).chosenCategoryView != null) { - Navigator.pop(context); + DevicesCubit().clearCategoriesSelection(context); } }, currentIndex: cubit.getPageIndex, diff --git a/lib/features/devices/bloc/ac/ac_cubit.dart b/lib/features/devices/bloc/ac/ac_cubit.dart index 6d2472c..699e12f 100644 --- a/lib/features/devices/bloc/ac/ac_cubit.dart +++ b/lib/features/devices/bloc/ac/ac_cubit.dart @@ -11,11 +11,6 @@ class AcCubit extends Cubit { static AcCubit get(context) => BlocProvider.of(context); - void selectAC(ACModel model) { - model.isSelected = !model.isSelected; - emit(ACSelected()); - } - ACModel? getSelectedAC() { for (var ac in DevicesCubit.categories[0].devices) { if (ac is ACModel && ac.isSelected) { @@ -36,7 +31,9 @@ class AcCubit extends Cubit { } void setACTemp(ACModel model, double temp) { - model.temperature = temp; + if (model.bounds.min <= temp && temp <= model.bounds.max) { + model.temperature = temp; + } emit(ACsTempChanged(temp)); } diff --git a/lib/features/devices/bloc/devices_cubit.dart b/lib/features/devices/bloc/devices_cubit.dart index 3106329..9ee4b30 100644 --- a/lib/features/devices/bloc/devices_cubit.dart +++ b/lib/features/devices/bloc/devices_cubit.dart @@ -35,6 +35,10 @@ class DevicesCubit extends Cubit { location: '', image: '', timer: null, + bounds: Bounds( + min: 20, + max: 30, + ), ), ACModel( name: "Master Bedroom AC", @@ -48,6 +52,10 @@ class DevicesCubit extends Cubit { location: '', image: '', timer: null, + bounds: Bounds( + min: 20, + max: 30, + ), ), ACModel( name: "Kitchen AC", @@ -61,6 +69,10 @@ class DevicesCubit extends Cubit { location: '', image: '', timer: null, + bounds: Bounds( + min: 20, + max: 30, + ), ), ACModel( name: "Bathroom AC", @@ -74,6 +86,10 @@ class DevicesCubit extends Cubit { location: '', image: '', timer: null, + bounds: Bounds( + min: 20, + max: 30, + ), ), ], icon: Assets.iconsAC, @@ -94,6 +110,12 @@ class DevicesCubit extends Cubit { type: '', location: '', image: '', + recentColors: [ + 0xFF83D9FF, + 0xFFFC3E81, + 0xFFC0FF66, + 0xFFFDC242, + ], ), LightModel( name: "Master Bedroom Light", @@ -106,6 +128,12 @@ class DevicesCubit extends Cubit { type: '', location: '', image: '', + recentColors: [ + 0xFF83D9FF, + 0xFFFC3E81, + 0xFFC0FF66, + 0xFFFDC242, + ], ), LightModel( name: "Kitchen Light", @@ -118,6 +146,12 @@ class DevicesCubit extends Cubit { type: '', location: '', image: '', + recentColors: [ + 0xFF83D9FF, + 0xFFFC3E81, + 0xFFC0FF66, + 0xFFFDC242, + ], ), LightModel( name: "Bathroom Light", @@ -130,6 +164,12 @@ class DevicesCubit extends Cubit { type: '', location: '', image: '', + recentColors: [ + 0xFF83D9FF, + 0xFFFC3E81, + 0xFFC0FF66, + 0xFFFDC242, + ], ), LightModel( name: "Balcony Light", @@ -142,6 +182,12 @@ class DevicesCubit extends Cubit { type: '', location: '', image: '', + recentColors: [ + 0xFF83D9FF, + 0xFFFC3E81, + 0xFFC0FF66, + 0xFFFDC242, + ], ), ], icon: Assets.iconsLight, @@ -179,6 +225,24 @@ class DevicesCubit extends Cubit { ), ]; + selectCategory(int index) { + for (var i = 0; i < categories.length; i++) { + if (i == index) { + categories[i].isSelected = true; + } else { + categories[i].isSelected = false; + } + } + emit(DevicesCategoryChanged()); + } + + unselectAllCategories() { + for (var category in categories) { + category.isSelected = false; + } + emit(DevicesCategoryChanged()); + } + Widget? get chosenCategoryView { for (var category in categories) { if (category.isSelected) { @@ -188,7 +252,32 @@ class DevicesCubit extends Cubit { return null; } - void changeCategorySwitchValue(DevicesCategoryModel category) { + selectDevice(DeviceModel device) { + for (var category in categories) { + for (var device in category.devices) { + if (device.isSelected) { + category.isSelected = false; + emit(DeviceSelected()); + return; + } + } + } + device.isSelected = !device.isSelected; + emit(DeviceSelected()); + } + + DeviceModel? getSelectedDevice() { + for (var category in categories) { + for (var device in category.devices) { + if (device.isSelected) { + return device; + } + } + } + return null; + } + + changeCategorySwitchValue(DevicesCategoryModel category) { if (category.devicesStatus != null) { category.devicesStatus = !category.devicesStatus!; for (var device in category.devices) { @@ -200,11 +289,12 @@ class DevicesCubit extends Cubit { device.status = true; } } + updateDevicesStatus(category); emit(CategorySwitchChanged()); } - void turnOnOffDevice(DeviceModel device) { + turnOnOffDevice(DeviceModel device) { device.status = !device.status!; DevicesCategoryModel category = categories.firstWhere((category) => category.devices.contains(device)); @@ -212,7 +302,7 @@ class DevicesCubit extends Cubit { emit(DeviceSwitchChanged()); } - void updateDevicesStatus(DevicesCategoryModel category) { + updateDevicesStatus(DevicesCategoryModel category) { bool? tempStatus = category.devices[0].status; for (var ac in category.devices) { //check if there any ac have a different status than the initial ==> turn off the universal switch @@ -226,23 +316,25 @@ class DevicesCubit extends Cubit { } } - void turnAllDevicesOff(DevicesCategoryModel category) { + turnAllDevicesOff(DevicesCategoryModel category) { for (var device in category.devices) { device.status = false; } + changeCategorySwitchValue(category); updateDevicesStatus(category); emit(CategorySwitchChanged()); } - void turnAllDevicesOn(DevicesCategoryModel category) { + turnAllDevicesOn(DevicesCategoryModel category) { for (var device in category.devices) { device.status = true; } + changeCategorySwitchValue(category); updateDevicesStatus(category); emit(CategorySwitchChanged()); } - void areAllDevicesOff(DevicesCategoryModel category) { + areAllDevicesOff(DevicesCategoryModel category) { for (var device in category.devices) { if (device.status ?? false) { category.devicesStatus = false; @@ -252,23 +344,15 @@ class DevicesCubit extends Cubit { } } - void selectCategory(int index) { - for (var i = 0; i < categories.length; i++) { - if (i == index) { - categories[i].isSelected = true; - } else { - categories[i].isSelected = false; - } - } - emit(DevicesCategoryChanged()); - } - - static void clearCategoriesSelection() { + clearCategoriesSelection(BuildContext context) { for (var category in categories) { category.isSelected = false; for (var device in category.devices) { device.isSelected = false; } } + Navigator.popUntil(context, (route) => route.isFirst); + + emit(DevicesCategoryChanged()); } } diff --git a/lib/features/devices/bloc/devices_state.dart b/lib/features/devices/bloc/devices_state.dart index a25c3f6..4a6ba5d 100644 --- a/lib/features/devices/bloc/devices_state.dart +++ b/lib/features/devices/bloc/devices_state.dart @@ -18,3 +18,5 @@ class DevicesCategoryChanged extends DevicesState {} class CategorySwitchChanged extends DevicesState {} class DeviceSwitchChanged extends DevicesState {} + +class DeviceSelected extends DevicesState {} diff --git a/lib/features/devices/bloc/lights/lights_cubit.dart b/lib/features/devices/bloc/lights/lights_cubit.dart index 700b846..0ff1f73 100644 --- a/lib/features/devices/bloc/lights/lights_cubit.dart +++ b/lib/features/devices/bloc/lights/lights_cubit.dart @@ -8,6 +8,29 @@ class LightsCubit extends Cubit { static LightsCubit get(context) => BlocProvider.of(context); + Map lightModes = { + 0: LightMode.Doze, + 1: LightMode.Relax, + 2: LightMode.Reading, + 3: LightMode.Energizing, + }; + + setLightingMode(LightModel light, LightMode mode) { + light.lightingMode = + lightModes.entries.firstWhere((element) => element.value == mode).key; + emit(LightModeChanged(mode)); + } + + toggleLight(LightModel light) { + light.status != null ? light.status = !light.status! : light.status = true; + emit(LightToggled(light)); + } + + setColor(LightModel light, int color) { + light.color = color; + emit(LightColorChanged(color)); + } + int getBrightness(LightModel light) { return light.brightness.toInt(); } @@ -30,3 +53,10 @@ class LightsCubit extends Cubit { setBrightness(light, newBrightness); } } + +enum LightMode { + Doze, + Relax, + Reading, + Energizing, +} diff --git a/lib/features/devices/bloc/lights/lights_state.dart b/lib/features/devices/bloc/lights/lights_state.dart index f4a9ebe..0623b0c 100644 --- a/lib/features/devices/bloc/lights/lights_state.dart +++ b/lib/features/devices/bloc/lights/lights_state.dart @@ -19,3 +19,21 @@ class LightBrightnessChanged extends LightsState { LightBrightnessChanged(this.brightness); } + +class LightToggled extends LightsState { + final LightModel light; + + LightToggled(this.light); +} + +class LightColorChanged extends LightsState { + final int color; + + LightColorChanged(this.color); +} + +class LightModeChanged extends LightsState { + final LightMode mode; + + LightModeChanged(this.mode); +} diff --git a/lib/features/devices/model/ac_model.dart b/lib/features/devices/model/ac_model.dart index e81b234..8da6acd 100644 --- a/lib/features/devices/model/ac_model.dart +++ b/lib/features/devices/model/ac_model.dart @@ -9,11 +9,14 @@ class ACModel extends DeviceModel { late double coolTo; + late Bounds bounds; + ACModel({ required this.temperature, required this.fanSpeed, required this.tempMode, required this.coolTo, + required this.bounds, required super.id, required super.name, required super.type, @@ -51,6 +54,31 @@ class ACModel extends DeviceModel { image: json['image'], timer: json['timer'], coolTo: json['coolTo'], + bounds: Bounds.fromJson(json['bounds']), + ); + } +} + +class Bounds { + late double min; + late double max; + + Bounds({ + required this.min, + required this.max, + }); + + Map toJson() { + return { + 'min': min, + 'max': max, + }; + } + + factory Bounds.fromJson(Map json) { + return Bounds( + min: json['min'], + max: json['max'], ); } } diff --git a/lib/features/devices/model/light_model.dart b/lib/features/devices/model/light_model.dart index ef7f59f..d267deb 100644 --- a/lib/features/devices/model/light_model.dart +++ b/lib/features/devices/model/light_model.dart @@ -6,10 +6,13 @@ class LightModel extends DeviceModel { late int lightingMode; + late List recentColors; + LightModel({ required this.brightness, required this.color, required this.lightingMode, + required this.recentColors, required super.id, required super.name, required super.type, @@ -25,6 +28,7 @@ class LightModel extends DeviceModel { 'color': color, 'lightingMode': lightingMode, 'timer': timer, + 'recentColors': recentColors, 'id': id, 'name': name, 'status': status, @@ -46,6 +50,7 @@ class LightModel extends DeviceModel { type: json['type'], location: json['location'], image: json['image'], + recentColors: json['recentColors'], ); } } diff --git a/lib/features/devices/view/devices_view.dart b/lib/features/devices/view/devices_view.dart index 00f315d..e07b786 100644 --- a/lib/features/devices/view/devices_view.dart +++ b/lib/features/devices/view/devices_view.dart @@ -11,7 +11,11 @@ class CategoriesView extends StatelessWidget { return BlocProvider( create: (context) => DevicesCubit(), child: BlocBuilder( - builder: (context, state) => const DevicesViewBody(), + builder: (context, state) => Container( + padding: const EdgeInsets.all(8), + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height, + child: const DevicesViewBody()), ), ); } diff --git a/lib/features/devices/view/widgets/ACs/acs_list.dart b/lib/features/devices/view/widgets/ACs/acs_list.dart index 9ec0024..438ceb5 100644 --- a/lib/features/devices/view/widgets/ACs/acs_list.dart +++ b/lib/features/devices/view/widgets/ACs/acs_list.dart @@ -1,5 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:syncrow_app/features/devices/bloc/AC/ac_cubit.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; import 'package:syncrow_app/features/devices/model/device_category_model.dart'; import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_mode_control_unit.dart'; @@ -19,78 +19,79 @@ class ACsList extends StatelessWidget { @override Widget build(BuildContext context) { DevicesCategoryModel category = DevicesCubit.categories[0]; - return SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - // universal AC controller - const SizedBox(height: 10), - const BodySmall(text: "All ACs"), - const SizedBox(height: 5), - UniversalSwitch( - category: category, - ), - const SizedBox(height: 10), - const UniversalACTemp(), - const SizedBox(height: 10), + return BlocBuilder( + builder: (context, state) { + return SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + // universal AC controller + const SizedBox(height: 10), + const BodySmall(text: "All ACs"), + const SizedBox(height: 5), + UniversalSwitch( + category: category, + ), + const SizedBox(height: 10), + const UniversalACTemp(), + const SizedBox(height: 10), - // other ACs controls - ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics(), - padding: const EdgeInsets.all(0), - itemCount: category.devices.length, - itemBuilder: (context, index) { - ACModel ac = category.devices[index] as ACModel; - return Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, + // other ACs controls + ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + padding: const EdgeInsets.all(0), + itemCount: category.devices.length, + itemBuilder: (context, index) { + ACModel ac = category.devices[index] as ACModel; + return Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ - BodySmall(text: category.devices[index].name ?? ""), - IconButton( - onPressed: () { - var device = category.devices[index]; - if (device is ACModel) { - AcCubit.get(context).selectAC(device); - } - }, - icon: const Icon( - Icons.arrow_forward_ios, - ), - style: ButtonStyle( - padding: MaterialStateProperty.all( - const EdgeInsets.all(0), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + BodySmall(text: category.devices[index].name ?? ""), + IconButton( + onPressed: () { + DevicesCubit.get(context).selectDevice(ac); + }, + icon: const Icon( + Icons.arrow_forward_ios, + ), + style: ButtonStyle( + padding: MaterialStateProperty.all( + const EdgeInsets.all(0), + ), + iconSize: MaterialStateProperty.all(15), + alignment: Alignment.bottomRight, + ), ), - iconSize: MaterialStateProperty.all(15), - alignment: Alignment.bottomRight, - ), + ], ), + const SizedBox(height: 5), + if (category.devices[index] is ACModel) + DevicesDefaultSwitch( + model: ac, + ), + const SizedBox(height: 10), + ACTempWidget( + ac, + ), + const SizedBox(height: 10), + if (category.devices[index] is ACModel) + ACModeControlUnit( + model: ac, + ), + const SizedBox(height: 10), ], - ), - const SizedBox(height: 5), - if (category.devices[index] is ACModel) - DevicesDefaultSwitch( - model: ac, - ), - const SizedBox(height: 10), - ACTempWidget( - ac, - ), - const SizedBox(height: 10), - if (category.devices[index] is ACModel) - ACModeControlUnit( - model: ac, - ), - const SizedBox(height: 10), - ], - ); - }, + ); + }, + ), + ], ), - ], - ), + ); + }, ); } } diff --git a/lib/features/devices/view/widgets/ACs/acs_view.dart b/lib/features/devices/view/widgets/ACs/acs_view.dart index a4ff23c..05ad689 100644 --- a/lib/features/devices/view/widgets/ACs/acs_view.dart +++ b/lib/features/devices/view/widgets/ACs/acs_view.dart @@ -4,6 +4,7 @@ import 'package:flutter_bloc/flutter_bloc.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/features/devices/bloc/AC/ac_cubit.dart'; +import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; import 'package:syncrow_app/features/devices/model/ac_model.dart'; import 'package:syncrow_app/features/devices/view/widgets/ACs/ac_interface.dart'; import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_list.dart'; @@ -18,45 +19,53 @@ class ACsView extends StatelessWidget { Widget build(BuildContext context) { return BlocProvider( create: (context) => AcCubit(), - child: BlocBuilder( + child: BlocBuilder( builder: (context, state) { - ACModel? selectedAC = AcCubit.get(context).getSelectedAC(); - return AnnotatedRegion( - value: SystemUiOverlayStyle( - statusBarColor: ColorsManager.primaryColor.withOpacity(0.5), - statusBarIconBrightness: Brightness.light, - ), - child: SafeArea( - child: Scaffold( - backgroundColor: ColorsManager.backgroundColor, - extendBodyBehindAppBar: true, - extendBody: true, - appBar: const DefaultAppBar(), - body: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - Assets.imagesBackground, + return BlocBuilder( + builder: (context, state) { + ACModel? selectedAC; + if (DevicesCubit.get(context).getSelectedDevice() is ACModel) { + selectedAC = + DevicesCubit.get(context).getSelectedDevice() as ACModel; + } + return AnnotatedRegion( + value: SystemUiOverlayStyle( + statusBarColor: ColorsManager.primaryColor.withOpacity(0.5), + statusBarIconBrightness: Brightness.light, + ), + child: SafeArea( + child: Scaffold( + backgroundColor: ColorsManager.backgroundColor, + extendBodyBehindAppBar: true, + extendBody: true, + appBar: const DefaultAppBar(), + body: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height, + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + Assets.imagesBackground, + ), + fit: BoxFit.cover, + opacity: 0.4, + ), + ), + child: Padding( + padding: const EdgeInsets.only( + top: 60, right: 15, left: 15, bottom: 80), + child: SizedBox.expand( + child: selectedAC != null + ? AcInterface(acModel: selectedAC) + : const ACsList(), + ), ), - fit: BoxFit.cover, - opacity: 0.4, - ), - ), - child: Padding( - padding: const EdgeInsets.only( - top: 60, right: 15, left: 15, bottom: 80), - child: SizedBox.expand( - child: selectedAC != null - ? AcInterface(acModel: selectedAC) - : const ACsList(), ), + bottomNavigationBar: const DefaultNavBar(), ), ), - bottomNavigationBar: const DefaultNavBar(), - ), - ), + ); + }, ); }, ), diff --git a/lib/features/devices/view/widgets/devices_categories_view.dart b/lib/features/devices/view/widgets/devices_categories_view.dart index 83965e2..580f78c 100644 --- a/lib/features/devices/view/widgets/devices_categories_view.dart +++ b/lib/features/devices/view/widgets/devices_categories_view.dart @@ -1,4 +1,6 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:syncrow_app/features/devices/view/widgets/devices_mode_tab.dart'; import 'package:syncrow_app/features/devices/view/widgets/switches.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; @@ -11,10 +13,11 @@ class DevicesCategoriesView extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( + return const Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Expanded( + flex: 3, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -30,7 +33,7 @@ class DevicesCategoriesView extends StatelessWidget { ), ), Expanded( - flex: 3, + flex: 11, child: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/features/devices/view/widgets/devices_view_body.dart b/lib/features/devices/view/widgets/devices_view_body.dart index cbc56fd..8c95b93 100644 --- a/lib/features/devices/view/widgets/devices_view_body.dart +++ b/lib/features/devices/view/widgets/devices_view_body.dart @@ -19,14 +19,14 @@ class DevicesViewBody extends StatelessWidget { create: (context) => DevicesCubit(), child: BlocBuilder( builder: (context, state) { + //TODO : move to NavigationCubit PageController pageController = PageController(); return state is DevicesLoading ? const Center(child: CircularProgressIndicator()) : Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - SizedBox( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height - 252, + Expanded( child: PageView( controller: pageController, children: const [ @@ -111,7 +111,17 @@ class DevicesViewBody extends StatelessWidget { SmoothPageIndicator( controller: pageController, count: 3, - effect: const WormEffect()), + effect: const WormEffect( + dotHeight: 8, + dotWidth: 8, + ), + onDotClicked: (index) { + pageController.animateToPage( + index, + duration: const Duration(milliseconds: 300), + curve: Curves.ease, + ); + }), ], ); }, diff --git a/lib/features/devices/view/widgets/lights/light_brightness.dart b/lib/features/devices/view/widgets/lights/light_brightness.dart index 7be2a50..ae64455 100644 --- a/lib/features/devices/view/widgets/lights/light_brightness.dart +++ b/lib/features/devices/view/widgets/lights/light_brightness.dart @@ -33,7 +33,7 @@ class LightBrightness extends StatelessWidget { ), AnimatedPositioned( left: 0, - duration: const Duration(milliseconds: 50), + duration: const Duration(milliseconds: 0), child: Container( height: 60, width: (MediaQuery.of(context).size.width - 30) * diff --git a/lib/features/devices/view/widgets/lights/light_interface.dart b/lib/features/devices/view/widgets/lights/light_interface.dart new file mode 100644 index 0000000..65e7101 --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:syncrow_app/features/devices/bloc/lights/lights_cubit.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface_contols.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface_switch.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface_timer.dart'; + +class LightInterface extends StatelessWidget { + const LightInterface({super.key, required this.light}); + + final LightModel light; + + @override + Widget build(BuildContext context) { + return BlocBuilder( + builder: (context, state) { + return Padding( + padding: const EdgeInsets.only(top: 70, right: 20, left: 20), + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + LightInterfaceSwitch(light: light), + LightInterfaceContols(light: light), + const LightInterfaceTimer(), + ], + ), + ), + ); + }, + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/light_interface_contols.dart b/lib/features/devices/view/widgets/lights/light_interface_contols.dart new file mode 100644 index 0000000..5495da1 --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface_contols.dart @@ -0,0 +1,32 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface_modes.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface_recent_color.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/light_interface_slider.dart'; +import 'package:syncrow_app/features/shared_widgets/default_container.dart'; + +class LightInterfaceContols extends StatelessWidget { + const LightInterfaceContols({ + super.key, + required this.light, + }); + + final LightModel light; + + @override + Widget build(BuildContext context) { + return DefaultContainer( + boxConstraints: const BoxConstraints(maxHeight: 320), + padding: const EdgeInsets.all(25), + margin: const EdgeInsets.symmetric(vertical: 10), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + LightInterfaceSlider(light: light), + LightInterfaceRecentColor(light: light), + LightInterfaceModes(light: light) + ], + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/light_interface_modes.dart b/lib/features/devices/view/widgets/lights/light_interface_modes.dart new file mode 100644 index 0000000..93df1b9 --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface_modes.dart @@ -0,0 +1,72 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/bloc/lights/lights_cubit.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; + +class LightInterfaceModes extends StatelessWidget { + const LightInterfaceModes({ + super.key, + required this.light, + }); + + final LightModel light; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BodyMedium( + text: StringsManager.lightingModes, + style: context.bodyMedium.copyWith(color: Colors.grey), + ), + const SizedBox(height: 10), + Wrap( + spacing: 25, + children: List.generate( + LightsCubit.get(context).lightModes.length, + (index) => InkWell( + onTap: () => LightsCubit.get(context).setLightingMode( + light, LightsCubit.get(context).lightModes[index]!), + child: Column( + children: [ + Container( + width: 40, + height: 40, + decoration: ShapeDecoration( + shape: const CircleBorder(), + color: switch (index) { + 0 => ColorsManager.dozeColor, + 1 => ColorsManager.relaxColor, + 2 => ColorsManager.readingColor, + 3 => ColorsManager.energizingColor, + _ => ColorsManager.primaryColor, + }, + ), + ), + BodyMedium( + text: switch (index) { + 0 => StringsManager.doze, + 1 => StringsManager.relax, + 2 => StringsManager.reading, + 3 => StringsManager.energizing, + _ => "", + }, + style: context.bodyMedium.copyWith( + color: Colors.grey, + fontSize: 10, + ), + ) + ], + ), + ), + ), + ), + const SizedBox(height: 10) + ], + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart b/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart new file mode 100644 index 0000000..a27eeda --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface_recent_color.dart @@ -0,0 +1,77 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/devices/bloc/lights/lights_cubit.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; + +import '../../../../../generated/assets.dart'; +import '../../../../../utils/resource_manager/strings_manager.dart'; +import '../../../../shared_widgets/text_widgets/body_medium.dart'; + +class LightInterfaceRecentColor extends StatelessWidget { + const LightInterfaceRecentColor({ + super.key, + required this.light, + }); + + final LightModel light; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BodyMedium( + text: StringsManager.recentlyUsed, + style: context.bodyMedium.copyWith(color: Colors.grey), + ), + const SizedBox(height: 10), + FittedBox( + child: Row( + children: [ + ...List.generate( + light.recentColors.length > 4 ? 4 : light.recentColors.length, + (index) => InkWell( + onTap: () { + LightsCubit.get(context) + .setColor(light, light.recentColors[index]); + }, + child: Container( + margin: const EdgeInsets.only(right: 10), + width: 40, + height: 40, + decoration: ShapeDecoration( + shape: const CircleBorder(), + color: Color(light.recentColors[index]), + ), + ), + ), + ), + Container( + margin: const EdgeInsets.only(right: 10), + width: 1, + height: 30, + color: ColorsManager.greyColor, + ), + SvgPicture.asset( + Assets.iconsKalvin, + height: 40, + width: 40, + ), + const SizedBox( + width: 10, + ), + SvgPicture.asset( + Assets.iconsColorWheel, + height: 40, + width: 40, + ), + ], + ), + ), + const SizedBox(height: 10), + ], + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/light_interface_slider.dart b/lib/features/devices/view/widgets/lights/light_interface_slider.dart new file mode 100644 index 0000000..afb75b6 --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface_slider.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/bloc/lights/lights_cubit.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_medium.dart'; +import 'package:syncrow_app/features/shared_widgets/united_text.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; + +class LightInterfaceSlider extends StatelessWidget { + const LightInterfaceSlider({ + super.key, + required this.light, + }); + + final LightModel light; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + BodyMedium( + text: StringsManager.dimmerAndColor, + style: context.bodyMedium.copyWith(color: Colors.grey), + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + child: UnitedText( + value: light.brightness.toString(), + unit: "%", + valueStyle: context.bodyMedium.copyWith( + color: Colors.grey, + fontSize: 26, + ), + unitStyle: context.bodyMedium.copyWith( + color: Colors.grey, + fontSize: 16, + ), + ), + ), + Expanded( + flex: 2, + child: SliderTheme( + data: SliderTheme.of(context).copyWith( + thumbColor: ColorsManager.primaryColor, + rangeThumbShape: const RoundRangeSliderThumbShape( + enabledThumbRadius: 9, + ), + thumbShape: const RoundSliderThumbShape( + enabledThumbRadius: 9, + ), + activeTrackColor: ColorsManager.greyColor, + inactiveTrackColor: ColorsManager.greyColor, + trackHeight: 5, + ), + child: Slider( + value: light.brightness, + onChanged: (value) => + LightsCubit.get(context).setBrightness(light, value), + min: 0, + max: 100, + ), + ), + ), + ], + ), + const SizedBox(height: 10), + ], + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/light_interface_switch.dart b/lib/features/devices/view/widgets/lights/light_interface_switch.dart new file mode 100644 index 0000000..54458ce --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface_switch.dart @@ -0,0 +1,69 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/bloc/lights/lights_cubit.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; +import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; + +import '../../../../shared_widgets/default_container.dart'; + +class LightInterfaceSwitch extends StatelessWidget { + const LightInterfaceSwitch({ + super.key, + required this.light, + }); + + final LightModel light; + + @override + Widget build(BuildContext context) { + return DefaultContainer( + boxConstraints: const BoxConstraints( + maxHeight: 65, + ), + margin: const EdgeInsets.symmetric(vertical: 10), + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + BodyLarge( + text: light.status ?? false + ? StringsManager.on + : StringsManager.off, + style: + context.bodyLarge.copyWith(color: Colors.grey, fontSize: 24), + ), + Container( + width: 35, + decoration: ShapeDecoration( + color: light.status ?? false + ? ColorsManager.primaryWithOpacity + : Colors.grey, + shape: const CircleBorder(), + ), + child: Center( + child: IconButton( + style: ButtonStyle( + padding: MaterialStateProperty.all( + const EdgeInsets.all(0), + ), + iconSize: MaterialStateProperty.all(25), + ), + onPressed: () { + LightsCubit.get(context).toggleLight(light); + }, + icon: const Icon( + Icons.power_settings_new, + color: Colors.white, + ), + ), + ), + ), + ], + ), + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/light_interface_timer.dart b/lib/features/devices/view/widgets/lights/light_interface_timer.dart new file mode 100644 index 0000000..5b949b2 --- /dev/null +++ b/lib/features/devices/view/widgets/lights/light_interface_timer.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/shared_widgets/text_widgets/body_large.dart'; +import 'package:syncrow_app/utils/context_extension.dart'; +import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; + +import '../../../../shared_widgets/default_container.dart'; + +class LightInterfaceTimer extends StatelessWidget { + const LightInterfaceTimer({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return DefaultContainer( + boxConstraints: const BoxConstraints(maxHeight: 65, minHeight: 65), + margin: const EdgeInsets.symmetric(vertical: 10), + padding: const EdgeInsets.symmetric(horizontal: 35, vertical: 10), + child: Row( + children: [ + BodyLarge( + text: StringsManager.timer, + style: context.bodyLarge.copyWith(color: Colors.grey), + ), + ], + ), + ); + } +} diff --git a/lib/features/devices/view/widgets/lights/lights_list.dart b/lib/features/devices/view/widgets/lights/lights_list.dart index c2f1eee..84b6119 100644 --- a/lib/features/devices/view/widgets/lights/lights_list.dart +++ b/lib/features/devices/view/widgets/lights/lights_list.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; import 'package:syncrow_app/features/devices/view/widgets/lights/light_brightness.dart'; import '../../../../shared_widgets/devices_default_switch.dart'; @@ -31,7 +32,7 @@ class LightsList extends StatelessWidget { BodySmall(text: lights[index].name ?? ""), IconButton( onPressed: () { - // LightsCubit.get(context).selectAC(device); + DevicesCubit.get(context).selectDevice(lights[index]); }, icon: const Icon( Icons.arrow_forward_ios, diff --git a/lib/features/devices/view/widgets/lights/lights_view.dart b/lib/features/devices/view/widgets/lights/lights_view.dart index 43566b3..e30df38 100644 --- a/lib/features/devices/view/widgets/lights/lights_view.dart +++ b/lib/features/devices/view/widgets/lights/lights_view.dart @@ -1,17 +1,16 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/devices/view/widgets/lights/lights_list.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/lights_view_list.dart'; import '../../../../../generated/assets.dart'; import '../../../../../utils/resource_manager/color_manager.dart'; import '../../../../app_layout/view/widgets/default_app_bar.dart'; import '../../../../app_layout/view/widgets/default_nav_bar.dart'; -import '../../../../shared_widgets/text_widgets/body_small.dart'; import '../../../bloc/devices_cubit.dart'; import '../../../bloc/lights/lights_cubit.dart'; import '../../../model/light_model.dart'; -import '../universal_switch.dart'; +import 'light_interface.dart'; class LightsView extends StatelessWidget { const LightsView({super.key}); @@ -20,59 +19,53 @@ class LightsView extends StatelessWidget { Widget build(BuildContext context) { return BlocProvider( create: (context) => LightsCubit(), - child: BlocBuilder( + child: BlocBuilder( builder: (context, state) { - List lights = []; - for (var device in DevicesCubit.categories[1].devices) { - if (device is LightModel) { - lights.add(device); - } - } - return AnnotatedRegion( - value: SystemUiOverlayStyle( - statusBarColor: ColorsManager.primaryColor.withOpacity(0.5), - statusBarIconBrightness: Brightness.light, - ), - child: SafeArea( - child: Scaffold( - backgroundColor: ColorsManager.backgroundColor, - extendBodyBehindAppBar: true, - extendBody: true, - appBar: const DefaultAppBar(), - body: Container( - width: MediaQuery.sizeOf(context).width, - height: MediaQuery.sizeOf(context).height, - decoration: const BoxDecoration( - image: DecorationImage( - image: AssetImage( - Assets.imagesBackground, - ), - fit: BoxFit.cover, - opacity: 0.4, - ), - ), - child: Padding( - padding: const EdgeInsets.only( - top: 70, right: 15, left: 15, bottom: 80), - child: SizedBox.expand( - child: SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const BodySmall(text: "All Lights"), - UniversalSwitch( - category: DevicesCubit.categories[1], - ), - LightsList(lights: lights), - ], + return BlocBuilder( + builder: (context, state) { + LightModel? selectedLight; + if (DevicesCubit.get(context).getSelectedDevice() is LightModel) { + selectedLight = + DevicesCubit.get(context).getSelectedDevice() as LightModel; + } + List lights = []; + for (var device in DevicesCubit.categories[1].devices) { + if (device is LightModel) { + lights.add(device); + } + } + return AnnotatedRegion( + value: SystemUiOverlayStyle( + statusBarColor: ColorsManager.primaryColor.withOpacity(0.5), + statusBarIconBrightness: Brightness.light, + ), + child: SafeArea( + child: Scaffold( + backgroundColor: ColorsManager.backgroundColor, + extendBodyBehindAppBar: true, + extendBody: true, + appBar: const DefaultAppBar(), + body: Container( + width: MediaQuery.sizeOf(context).width, + height: MediaQuery.sizeOf(context).height, + decoration: const BoxDecoration( + image: DecorationImage( + image: AssetImage( + Assets.imagesBackground, + ), + fit: BoxFit.cover, + opacity: 0.4, ), ), + child: selectedLight != null + ? LightInterface(light: selectedLight) + : LightsViewList(lights: lights), ), + bottomNavigationBar: const DefaultNavBar(), ), ), - bottomNavigationBar: const DefaultNavBar(), - ), - ), + ); + }, ); }, ), diff --git a/lib/features/devices/view/widgets/lights/lights_view_list.dart b/lib/features/devices/view/widgets/lights/lights_view_list.dart new file mode 100644 index 0000000..47e8daa --- /dev/null +++ b/lib/features/devices/view/widgets/lights/lights_view_list.dart @@ -0,0 +1,37 @@ +import 'package:flutter/material.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/lights_list.dart'; + +import '../../../../shared_widgets/text_widgets/body_small.dart'; +import '../../../bloc/devices_cubit.dart'; +import '../../../model/light_model.dart'; +import '../universal_switch.dart'; + +class LightsViewList extends StatelessWidget { + const LightsViewList({ + super.key, + required this.lights, + }); + + final List lights; + + @override + Widget build(BuildContext context) { + return Padding( + padding: const EdgeInsets.only(top: 70, right: 15, left: 15, bottom: 80), + child: SizedBox.expand( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const BodySmall(text: "All Lights"), + UniversalSwitch( + category: DevicesCubit.categories[1], + ), + LightsList(lights: lights), + ], + ), + ), + ), + ); + } +} diff --git a/lib/features/scene/bloc/scene_cubit.dart b/lib/features/scene/bloc/scene_cubit.dart index fe443d1..350173a 100644 --- a/lib/features/scene/bloc/scene_cubit.dart +++ b/lib/features/scene/bloc/scene_cubit.dart @@ -13,7 +13,7 @@ class SceneCubit extends Cubit { void getScenes() { emit(SceneLoading()); //TODO: remove this it's causing the Bad State because its being after the cubit is closed - Future.delayed(const Duration(seconds: 5), () { + Future.delayed(const Duration(milliseconds: 50), () { emit(SceneSuccess()); }); } diff --git a/lib/features/shared_widgets/default_container.dart b/lib/features/shared_widgets/default_container.dart index 48f5eeb..8b2123b 100644 --- a/lib/features/shared_widgets/default_container.dart +++ b/lib/features/shared_widgets/default_container.dart @@ -7,12 +7,17 @@ class DefaultContainer extends StatelessWidget { this.height, this.width, this.color, + this.boxConstraints, + this.margin, + this.padding, }); final double? height; final double? width; final Widget child; - + final BoxConstraints? boxConstraints; + final EdgeInsets? margin; + final EdgeInsets? padding; final Color? color; @override @@ -20,11 +25,13 @@ class DefaultContainer extends StatelessWidget { return Container( height: height, width: width, + margin: margin, + constraints: boxConstraints, decoration: BoxDecoration( color: color ?? Colors.white, borderRadius: BorderRadius.circular(20), ), - padding: const EdgeInsets.all(10), + padding: padding ?? const EdgeInsets.all(10), child: child, ); } diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index fa1a4b2..ef13fa5 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -8,6 +8,7 @@ class Assets { static const String iconsAutomatedClock = 'assets/icons/automated_clock.svg'; static const String iconsCO2 = 'assets/icons/CO2.svg'; static const String iconsColdMode = 'assets/icons/coldMode.svg'; + static const String iconsColorWheel = 'assets/icons/color_wheel.svg'; static const String iconsCurtain = 'assets/icons/Curtain.svg'; static const String iconsDashboard = 'assets/icons/dashboard.svg'; static const String iconsDashboardFill = 'assets/icons/dashboard-fill.svg'; @@ -22,6 +23,7 @@ class Assets { static const String iconsGateway = 'assets/icons/Gateway.svg'; static const String iconsHome = 'assets/icons/home.svg'; static const String iconsHot1 = 'assets/icons/hot1.jpg'; + static const String iconsKalvin = 'assets/icons/kalvin.svg'; static const String iconsLayout = 'assets/icons/Layout.svg'; static const String iconsLayoutFill = 'assets/icons/Layout-fill.svg'; static const String iconsLight = 'assets/icons/Light.svg'; diff --git a/lib/utils/bloc_observer.dart b/lib/utils/bloc_observer.dart index f179654..5becffe 100644 --- a/lib/utils/bloc_observer.dart +++ b/lib/utils/bloc_observer.dart @@ -1,7 +1,6 @@ // ignore_for_file: avoid_print import 'package:flutter_bloc/flutter_bloc.dart'; -import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart'; class MyBlocObserver extends BlocObserver { @override @@ -25,9 +24,6 @@ class MyBlocObserver extends BlocObserver { @override void onClose(BlocBase bloc) { super.onClose(bloc); - if (bloc is DevicesCubit) { - DevicesCubit.clearCategoriesSelection(); - } print('onClose -- ${bloc.runtimeType}'); } } diff --git a/lib/utils/resource_manager/color_manager.dart b/lib/utils/resource_manager/color_manager.dart index 72321fa..68e9f00 100644 --- a/lib/utils/resource_manager/color_manager.dart +++ b/lib/utils/resource_manager/color_manager.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; abstract class ColorsManager { static const Color textPrimaryColor = Color(0xFF5D5D5D); static const Color primaryColor = Color(0xFF0030CB); + static Color primaryWithOpacity = const Color(0xFF023DFE).withOpacity(0.6); static const Color onPrimaryColor = Colors.white; static const Color secondaryColor = Color(0xFF023DFE); static const Color onSecondaryColor = Color(0xFF023DFE); @@ -10,4 +11,8 @@ abstract class ColorsManager { static const Color greyColor = Color(0xFFd5d5d5); static const Color backgroundColor = Color(0xFFececec); + static const Color dozeColor = Color(0xFFFEC258); + static const Color relaxColor = Color(0xFFFBD288); + static const Color readingColor = Color(0xFFF7D69C); + static const Color energizingColor = Color(0xFFEDEDED); } diff --git a/lib/utils/resource_manager/strings_manager.dart b/lib/utils/resource_manager/strings_manager.dart index 04ca8cf..af6af69 100644 --- a/lib/utils/resource_manager/strings_manager.dart +++ b/lib/utils/resource_manager/strings_manager.dart @@ -24,4 +24,12 @@ class StringsManager { static const summerMode = 'Summer Mode'; static const on = 'ON'; static const off = 'OFF'; + static const timer = 'Timer'; + static const dimmerAndColor = "Dimmer & color"; + static const recentlyUsed = "Recently used colors"; + static const lightingModes = "Lighting modes"; + static const doze = "Doze"; + static const relax = "Relax"; + static const reading = "Reading"; + static const energizing = "Energizing"; }