diff --git a/assets/images/blind.png b/assets/images/blind.png new file mode 100644 index 0000000..35cad04 Binary files /dev/null and b/assets/images/blind.png differ diff --git a/assets/images/curtain.png b/assets/images/curtain.png new file mode 100644 index 0000000..c8b55c9 Binary files /dev/null and b/assets/images/curtain.png differ diff --git a/lib/features/app_layout/bloc/spaces_cubit.dart b/lib/features/app_layout/bloc/spaces_cubit.dart new file mode 100644 index 0000000..b9c447f --- /dev/null +++ b/lib/features/app_layout/bloc/spaces_cubit.dart @@ -0,0 +1,133 @@ +import 'package:flutter_bloc/flutter_bloc.dart'; +import 'package:syncrow_app/features/app_layout/model/space_model.dart'; +import 'package:syncrow_app/features/devices/model/ac_model.dart'; +import 'package:syncrow_app/features/devices/model/curtain_model.dart'; +import 'package:syncrow_app/features/devices/model/device_category_model.dart'; +import 'package:syncrow_app/features/devices/model/light_model.dart'; +import 'package:syncrow_app/features/devices/model/room_model.dart'; +import 'package:syncrow_app/features/devices/view/widgets/ACs/acs_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/gateway/gateway_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/lights/lights_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/smart_door/door_view.dart'; +import 'package:syncrow_app/generated/assets.dart'; + +part 'spaces_state.dart'; + +class SpacesCubit extends Cubit { + SpacesCubit() : super(SpacesInitial()); + + static SpacesCubit get(context) => BlocProvider.of(context); + + static List spaces = [ + SpaceModel( + id: '0', + name: 'Home', + rooms: [], + ), + SpaceModel( + id: '1', + name: 'Office', + rooms: [], + ), + SpaceModel( + id: '2', + name: 'Parent\'s House', + rooms: [], + ), + ]; + List rooms = [ + RoomModel(id: '0', name: 'Living Room', categories: [ + DevicesCategoryModel( + devices: [ + ACModel( + name: "Living Room AC", + id: '0', + status: false, + temperature: 20, + fanSpeed: 0, + tempMode: 0, + coolTo: 20, + type: '', + image: '', + timer: null, + bounds: Bounds( + min: 20, + max: 30, + ), + ), + ], + icon: Assets.iconsAC, + name: 'ACs', + type: DeviceType.AC, + page: const ACsView(), + ), + DevicesCategoryModel( + devices: [ + LightModel( + name: "Living Room Light", + id: '0', + status: false, + color: 0, + brightness: 20, + lightingMode: 1, + timer: null, + type: '', + image: '', + recentColors: [ + 0xFF83D9FF, + 0xFFFC3E81, + 0xFFC0FF66, + 0xFFFDC242, + ], + ), + ], + icon: Assets.iconsLight, + name: 'Lights', + type: DeviceType.Lights, + page: const LightsView(), + ), + DevicesCategoryModel( + devices: [], + icon: Assets.iconsDoorLock, + name: 'Doors', + type: DeviceType.Door, + page: const DoorView(), + ), + DevicesCategoryModel( + devices: [ + CurtainModel( + openPercentage: 10, + id: "1", + name: "Living Room Curtain", + status: false, + type: '', + image: '', + timer: null, + ), + ], + icon: Assets.iconsCurtain, + name: 'Curtains', + type: DeviceType.Curtain, + page: const CurtainView(), + ), + DevicesCategoryModel( + devices: [], + icon: Assets.iconsScreen, + name: 'Gateway', + type: DeviceType.Gateway, + page: const GateWayView(), + ), + ]), + RoomModel(id: '1', name: 'Bedroom', categories: []), + ]; + + SpaceModel selectedSpace = spaces.first; + + selectSpace(SpaceModel space) { + selectedSpace = space; + emit(SpacesSelected(space)); + } + +//TODO implement the methods to fetch the spaces from the API +} diff --git a/lib/features/app_layout/bloc/spaces_state.dart b/lib/features/app_layout/bloc/spaces_state.dart new file mode 100644 index 0000000..4491586 --- /dev/null +++ b/lib/features/app_layout/bloc/spaces_state.dart @@ -0,0 +1,19 @@ +part of 'spaces_cubit.dart'; + +abstract class SpacesState {} + +class SpacesInitial extends SpacesState {} + +class SpacesLoading extends SpacesState {} + +class SpacesLoaded extends SpacesState { + final List spaces; + + SpacesLoaded(this.spaces); +} + +class SpacesSelected extends SpacesState { + final SpaceModel space; + + SpacesSelected(this.space); +} diff --git a/lib/features/app_layout/model/space_model.dart b/lib/features/app_layout/model/space_model.dart new file mode 100644 index 0000000..4fb0c26 --- /dev/null +++ b/lib/features/app_layout/model/space_model.dart @@ -0,0 +1,29 @@ +import 'package:syncrow_app/features/devices/model/room_model.dart'; + +class SpaceModel { + final String id; + final String name; + final List rooms; + + SpaceModel({ + required this.id, + required this.name, + required this.rooms, + }); + + Map toJson() { + return { + 'id': id, + 'name': name, + 'rooms': rooms, + }; + } + + factory SpaceModel.fromJson(Map json) { + return SpaceModel( + id: json['id'], + name: json['name'], + rooms: json['rooms'], + ); + } +} diff --git a/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart b/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart index a0586a0..4603823 100644 --- a/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart +++ b/lib/features/app_layout/view/widgets/app_bar_home_dropdown.dart @@ -1,9 +1,12 @@ import 'package:flutter/material.dart'; +import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; +import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.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 '../../../../generated/assets.dart'; -import '../../../shared_widgets/text_widgets/body_large.dart'; class AppBarHomeDropdown extends StatelessWidget { const AppBarHomeDropdown({ @@ -12,33 +15,57 @@ class AppBarHomeDropdown extends StatelessWidget { @override Widget build(BuildContext context) { - return TextButton( - onPressed: () {}, - child: SizedBox( - width: 150, - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.start, - children: [ - SvgPicture.asset( - Assets.iconsHome, - width: 25, - height: 25, - colorFilter: const ColorFilter.mode( - ColorsManager.textPrimaryColor, - BlendMode.srcIn, + return BlocBuilder( + builder: (context, state) { + return DropdownButton( + icon: const Icon( + Icons.expand_more, + color: Colors.black, + size: 25, + ), + underline: const SizedBox.shrink(), + padding: const EdgeInsets.all(0), + borderRadius: BorderRadius.circular(20), + value: SpacesCubit.get(context).selectedSpace, + items: SpacesCubit.spaces.map((space) { + return DropdownMenuItem( + value: space, + child: SizedBox( + width: 100, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset( + Assets.iconsHome, + width: 25, + height: 25, + colorFilter: const ColorFilter.mode( + ColorsManager.textPrimaryColor, + BlendMode.srcIn, + ), + ), + const SizedBox(width: 5), + Expanded( + child: BodyMedium( + text: space.name, + style: context.bodyMedium.copyWith( + fontSize: 15, + color: ColorsManager.textPrimaryColor, + overflow: TextOverflow.ellipsis, + ), + ), + ), + ], + ), ), - ), - const SizedBox(width: 5), - const BodyLarge(text: 'Home'), - const SizedBox(width: 5), - const Icon( - Icons.expand_more, - color: Colors.black, - ) - ], - ), - ), + ); + }).toList(), + onChanged: (value) { + SpacesCubit.get(context).selectSpace(value!); + }, + ); + }, ); } } diff --git a/lib/features/devices/bloc/ac/ac_cubit.dart b/lib/features/devices/bloc/ac/ac_cubit.dart index 6e36957..876af46 100644 --- a/lib/features/devices/bloc/ac/ac_cubit.dart +++ b/lib/features/devices/bloc/ac/ac_cubit.dart @@ -12,7 +12,7 @@ class AcCubit extends Cubit { static AcCubit get(context) => BlocProvider.of(context); - static DevicesCategoryModel category = DevicesCubit.categories[0]; + static DevicesCategoryModel category = DevicesCubit.allCategories[0]; ACModel? getSelectedAC() { for (var ac in category.devices) { diff --git a/lib/features/devices/bloc/curtains/curtains_cubit.dart b/lib/features/devices/bloc/curtains/curtains_cubit.dart index 5b0900d..99de110 100644 --- a/lib/features/devices/bloc/curtains/curtains_cubit.dart +++ b/lib/features/devices/bloc/curtains/curtains_cubit.dart @@ -9,5 +9,5 @@ class CurtainsCubit extends Cubit { static CurtainsCubit get(context) => BlocProvider.of(context); - static DevicesCategoryModel category = DevicesCubit.categories[4]; + static DevicesCategoryModel category = DevicesCubit.allCategories[3]; } diff --git a/lib/features/devices/bloc/devices_cubit.dart b/lib/features/devices/bloc/devices_cubit.dart index 7963077..1c48e39 100644 --- a/lib/features/devices/bloc/devices_cubit.dart +++ b/lib/features/devices/bloc/devices_cubit.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/devices/model/ac_model.dart'; +import 'package:syncrow_app/features/devices/model/curtain_model.dart'; import 'package:syncrow_app/features/devices/model/device_model.dart'; import 'package:syncrow_app/features/devices/model/light_model.dart'; import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart'; @@ -20,7 +21,7 @@ class DevicesCubit extends Cubit { static DevicesCubit get(context) => BlocProvider.of(context); - static List categories = [ + static List allCategories = [ DevicesCategoryModel( devices: [ ACModel( @@ -32,7 +33,6 @@ class DevicesCubit extends Cubit { tempMode: 0, coolTo: 20, type: '', - location: '', image: '', timer: null, bounds: Bounds( @@ -49,7 +49,6 @@ class DevicesCubit extends Cubit { tempMode: 0, coolTo: 20, type: '', - location: '', image: '', timer: null, bounds: Bounds( @@ -66,7 +65,6 @@ class DevicesCubit extends Cubit { tempMode: 0, coolTo: 20, type: '', - location: '', image: '', timer: null, bounds: Bounds( @@ -83,7 +81,6 @@ class DevicesCubit extends Cubit { tempMode: 0, coolTo: 20, type: '', - location: '', image: '', timer: null, bounds: Bounds( @@ -108,7 +105,6 @@ class DevicesCubit extends Cubit { lightingMode: 1, timer: null, type: '', - location: '', image: '', recentColors: [ 0xFF83D9FF, @@ -126,7 +122,6 @@ class DevicesCubit extends Cubit { lightingMode: 1, timer: null, type: '', - location: '', image: '', recentColors: [ 0xFF83D9FF, @@ -144,7 +139,6 @@ class DevicesCubit extends Cubit { lightingMode: 1, timer: null, type: '', - location: '', image: '', recentColors: [ 0xFF83D9FF, @@ -162,7 +156,6 @@ class DevicesCubit extends Cubit { lightingMode: 1, timer: null, type: '', - location: '', image: '', recentColors: [ 0xFF83D9FF, @@ -180,7 +173,6 @@ class DevicesCubit extends Cubit { lightingMode: 1, timer: null, type: '', - location: '', image: '', recentColors: [ 0xFF83D9FF, @@ -203,7 +195,26 @@ class DevicesCubit extends Cubit { page: const DoorView(), ), DevicesCategoryModel( - devices: [], + devices: [ + CurtainModel( + openPercentage: 10, + id: "1", + name: "Living Room Curtain", + status: false, + type: '', + image: '', + timer: null, + ), + CurtainModel( + openPercentage: 20, + id: "2", + name: "Master Bedroom Curtain", + status: false, + type: '', + image: '', + timer: null, + ), + ], icon: Assets.iconsCurtain, name: 'Curtains', type: DeviceType.Curtain, @@ -226,25 +237,25 @@ class DevicesCubit extends Cubit { ]; selectCategory(int index) { - for (var i = 0; i < categories.length; i++) { + for (var i = 0; i < allCategories.length; i++) { if (i == index) { - categories[i].isSelected = true; + allCategories[i].isSelected = true; } else { - categories[i].isSelected = false; + allCategories[i].isSelected = false; } } emit(DevicesCategoryChanged()); } unselectAllCategories() { - for (var category in categories) { + for (var category in allCategories) { category.isSelected = false; } emit(DevicesCategoryChanged()); } Widget? get chosenCategoryView { - for (var category in categories) { + for (var category in allCategories) { if (category.isSelected) { return category.page; } @@ -253,7 +264,7 @@ class DevicesCubit extends Cubit { } selectDevice(DeviceModel device) { - for (var category in categories) { + for (var category in allCategories) { for (var device in category.devices) { if (device.isSelected) { category.isSelected = false; @@ -267,7 +278,7 @@ class DevicesCubit extends Cubit { } DeviceModel? getSelectedDevice() { - for (var category in categories) { + for (var category in allCategories) { for (var device in category.devices) { if (device.isSelected) { return device; @@ -296,8 +307,8 @@ class DevicesCubit extends Cubit { turnOnOffDevice(DeviceModel device) { device.status = !device.status!; - DevicesCategoryModel category = - categories.firstWhere((category) => category.devices.contains(device)); + DevicesCategoryModel category = allCategories + .firstWhere((category) => category.devices.contains(device)); updateDevicesStatus(category); emit(DeviceSwitchChanged()); } @@ -354,7 +365,7 @@ class DevicesCubit extends Cubit { } clearCategoriesSelection(BuildContext context) { - for (var category in categories) { + for (var category in allCategories) { category.isSelected = false; for (var device in category.devices) { device.isSelected = false; diff --git a/lib/features/devices/model/ac_model.dart b/lib/features/devices/model/ac_model.dart index 8da6acd..737118d 100644 --- a/lib/features/devices/model/ac_model.dart +++ b/lib/features/devices/model/ac_model.dart @@ -21,7 +21,6 @@ class ACModel extends DeviceModel { required super.name, required super.type, required super.status, - required super.location, required super.image, required super.timer, }); @@ -36,7 +35,6 @@ class ACModel extends DeviceModel { 'name': name, 'status': status, 'type': type, - 'location': location, 'image': image, }; } @@ -50,7 +48,6 @@ class ACModel extends DeviceModel { fanSpeed: json['fanSpeed'], tempMode: json['tempMode'], type: json['type'], - location: json['location'], image: json['image'], timer: json['timer'], coolTo: json['coolTo'], diff --git a/lib/features/devices/model/curtain_model.dart b/lib/features/devices/model/curtain_model.dart index 276cd34..6abc311 100644 --- a/lib/features/devices/model/curtain_model.dart +++ b/lib/features/devices/model/curtain_model.dart @@ -9,7 +9,6 @@ class CurtainModel extends DeviceModel { required super.name, required super.type, required super.status, - required super.location, required super.image, required super.timer, }); @@ -22,7 +21,6 @@ class CurtainModel extends DeviceModel { 'name': name, 'status': status, 'type': type, - 'location': location, 'image': image, }; } @@ -35,7 +33,6 @@ class CurtainModel extends DeviceModel { openPercentage: json['openPercentage'], timer: json['timer'], type: json['type'], - location: json['location'], image: json['image'], ); } diff --git a/lib/features/devices/model/device_model.dart b/lib/features/devices/model/device_model.dart index f4c5b9c..280ba6d 100644 --- a/lib/features/devices/model/device_model.dart +++ b/lib/features/devices/model/device_model.dart @@ -3,7 +3,6 @@ abstract class DeviceModel { final String? name; final String? type; bool? status; - final String? location; final String? image; final double? timer; bool isSelected = false; @@ -13,7 +12,6 @@ abstract class DeviceModel { required this.name, required this.type, required this.status, - required this.location, required this.image, required this.timer, }); diff --git a/lib/features/devices/model/light_model.dart b/lib/features/devices/model/light_model.dart index d267deb..ab2f258 100644 --- a/lib/features/devices/model/light_model.dart +++ b/lib/features/devices/model/light_model.dart @@ -17,7 +17,6 @@ class LightModel extends DeviceModel { required super.name, required super.type, required super.status, - required super.location, required super.image, required super.timer, }); @@ -33,7 +32,6 @@ class LightModel extends DeviceModel { 'name': name, 'status': status, 'type': type, - 'location': location, 'image': image, }; } @@ -48,7 +46,6 @@ class LightModel extends DeviceModel { lightingMode: json['lightingMode'], timer: json['timer'], type: json['type'], - location: json['location'], image: json['image'], recentColors: json['recentColors'], ); diff --git a/lib/features/devices/model/room_model.dart b/lib/features/devices/model/room_model.dart new file mode 100644 index 0000000..921eb36 --- /dev/null +++ b/lib/features/devices/model/room_model.dart @@ -0,0 +1,30 @@ +import 'package:syncrow_app/features/devices/model/device_category_model.dart'; + +class RoomModel { + final String id; + final String name; + + final List categories; + + RoomModel({ + required this.id, + required this.name, + required this.categories, + }); + + Map toJson() { + return { + 'id': id, + 'name': name, + 'devices': categories, + }; + } + + factory RoomModel.fromJson(Map json) { + return RoomModel( + id: json['id'], + name: json['name'], + categories: json['devices'], + ); + } +} diff --git a/lib/features/devices/view/widgets/curtains/curtain_list.dart b/lib/features/devices/view/widgets/curtains/curtain_list.dart index 667849f..5abb05e 100644 --- a/lib/features/devices/view/widgets/curtains/curtain_list.dart +++ b/lib/features/devices/view/widgets/curtains/curtain_list.dart @@ -36,40 +36,19 @@ class CurtainList extends StatelessWidget { padding: const EdgeInsets.all(0), itemCount: CurtainsCubit.category.devices.length, itemBuilder: (context, index) { - CurtainModel ac = + CurtainModel curtain = CurtainsCubit.category.devices[index] as CurtainModel; return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - BodySmall( - text: - CurtainsCubit.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, - ), - ), - ], - ), + const SizedBox(height: 20), + BodySmall( + text: + CurtainsCubit.category.devices[index].name ?? ""), const SizedBox(height: 5), if (CurtainsCubit.category.devices[index] is CurtainModel) DevicesDefaultSwitch( - model: ac, + model: curtain, ), ], ); diff --git a/lib/features/devices/view/widgets/devices_view_body.dart b/lib/features/devices/view/widgets/devices_view_body.dart index 0f26e56..d740482 100644 --- a/lib/features/devices/view/widgets/devices_view_body.dart +++ b/lib/features/devices/view/widgets/devices_view_body.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; -import 'package:syncrow_app/features/devices/view/widgets/devices_categories_view.dart'; +import 'package:syncrow_app/features/devices/view/widgets/wizard_page.dart'; import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.dart'; import 'package:syncrow_app/utils/resource_manager/constants.dart'; @@ -35,7 +35,7 @@ class DevicesViewBody extends StatelessWidget { child: PageView( controller: pageController, children: const [ - DevicesCategoriesView(), + WizardPage(), Padding( padding: EdgeInsets.symmetric( horizontal: Constants.defaultPadding), diff --git a/lib/features/devices/view/widgets/lights/lights_view.dart b/lib/features/devices/view/widgets/lights/lights_view.dart index 98832e2..32671a1 100644 --- a/lib/features/devices/view/widgets/lights/lights_view.dart +++ b/lib/features/devices/view/widgets/lights/lights_view.dart @@ -28,7 +28,7 @@ class LightsView extends StatelessWidget { DevicesCubit.get(context).getSelectedDevice() as LightModel; } List lights = []; - for (var device in DevicesCubit.categories[1].devices) { + for (var device in DevicesCubit.allCategories[1].devices) { if (device is LightModel) { lights.add(device); } diff --git a/lib/features/devices/view/widgets/lights/lights_view_list.dart b/lib/features/devices/view/widgets/lights/lights_view_list.dart index b834ba8..5f3608e 100644 --- a/lib/features/devices/view/widgets/lights/lights_view_list.dart +++ b/lib/features/devices/view/widgets/lights/lights_view_list.dart @@ -30,7 +30,7 @@ class LightsViewList extends StatelessWidget { children: [ const BodySmall(text: "All Lights"), UniversalSwitch( - category: DevicesCubit.categories[1], + category: DevicesCubit.allCategories[1], ), LightsList(lights: lights), ], diff --git a/lib/features/devices/view/widgets/switches.dart b/lib/features/devices/view/widgets/switches.dart index 9e567cd..aac0661 100644 --- a/lib/features/devices/view/widgets/switches.dart +++ b/lib/features/devices/view/widgets/switches.dart @@ -28,7 +28,7 @@ class Switches extends StatelessWidget { padding: const EdgeInsets.only(top: 10), physics: const NeverScrollableScrollPhysics(), shrinkWrap: true, - itemCount: DevicesCubit.categories.length, + itemCount: DevicesCubit.allCategories.length, itemBuilder: (_, index) { return InkWell( onTap: () { @@ -51,11 +51,11 @@ class Switches extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ SvgPicture.asset( - DevicesCubit.categories[index].icon, + DevicesCubit.allCategories[index].icon, fit: BoxFit.contain, ), CustomSwitch( - category: DevicesCubit.categories[index], + category: DevicesCubit.allCategories[index], ), ], ), @@ -63,7 +63,7 @@ class Switches extends StatelessWidget { child: FittedBox( fit: BoxFit.scaleDown, child: BodyLarge( - text: DevicesCubit.categories[index].name, + text: DevicesCubit.allCategories[index].name, style: context.bodyLarge.copyWith( fontWeight: FontWeight.bold, height: 0, diff --git a/lib/features/devices/view/widgets/devices_categories_view.dart b/lib/features/devices/view/widgets/wizard_page.dart similarity index 95% rename from lib/features/devices/view/widgets/devices_categories_view.dart rename to lib/features/devices/view/widgets/wizard_page.dart index 7c5f697..61b8c66 100644 --- a/lib/features/devices/view/widgets/devices_categories_view.dart +++ b/lib/features/devices/view/widgets/wizard_page.dart @@ -7,8 +7,8 @@ import 'package:syncrow_app/features/shared_widgets/text_widgets/title_medium.da import 'package:syncrow_app/utils/resource_manager/constants.dart'; import 'package:syncrow_app/utils/resource_manager/strings_manager.dart'; -class DevicesCategoriesView extends StatelessWidget { - const DevicesCategoriesView({ +class WizardPage extends StatelessWidget { + const WizardPage({ super.key, }); diff --git a/lib/my_app.dart b/lib/my_app.dart index 154b9e6..b92aa33 100644 --- a/lib/my_app.dart +++ b/lib/my_app.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:syncrow_app/features/app_layout/bloc/nav_cubit.dart'; +import 'package:syncrow_app/features/app_layout/bloc/spaces_cubit.dart'; import 'package:syncrow_app/features/auth/bloc/auth_cubit.dart'; import 'package:syncrow_app/utils/resource_manager/color_manager.dart'; import 'package:syncrow_app/utils/resource_manager/constants.dart'; @@ -29,6 +30,9 @@ class MyApp extends StatelessWidget { BlocProvider( create: (context) => NavCubit(), ), + BlocProvider( + create: (context) => SpacesCubit(), + ), BlocProvider( create: (context) => DevicesCubit(), ), diff --git a/lib/utils/resource_manager/theme_manager.dart b/lib/utils/resource_manager/theme_manager.dart index c028314..daf6bff 100644 --- a/lib/utils/resource_manager/theme_manager.dart +++ b/lib/utils/resource_manager/theme_manager.dart @@ -140,6 +140,38 @@ abstract class ThemeManager { // ), // ), + dropdownMenuTheme: const DropdownMenuThemeData( + textStyle: TextStyle( + fontFamily: FontsManager.fontFamily, + fontSize: FontSize.s16, + fontWeight: FontsManager.regular, + color: ColorsManager.textPrimaryColor, + ), + inputDecorationTheme: InputDecorationTheme( + border: OutlineInputBorder( + 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, + ), + ), + menuStyle: MenuStyle( + backgroundColor: MaterialStatePropertyAll(Colors.white), + padding: MaterialStatePropertyAll(EdgeInsets.all(8)), + ), + ), + ///input decoration theme inputDecorationTheme: const InputDecorationTheme( border: OutlineInputBorder( diff --git a/pubspec.lock b/pubspec.lock index 7ddef2b..35200b7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -389,30 +389,6 @@ packages: url: "https://pub.dev" source: hosted version: "0.6.7" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" - url: "https://pub.dev" - source: hosted - version: "10.0.0" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 - url: "https://pub.dev" - source: hosted - version: "2.0.1" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 - url: "https://pub.dev" - source: hosted - version: "2.0.1" lints: dependency: transitive description: @@ -425,26 +401,26 @@ packages: dependency: transitive description: name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" url: "https://pub.dev" source: hosted - version: "0.12.16+1" + version: "0.12.16" material_color_utilities: dependency: transitive description: name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" + sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" url: "https://pub.dev" source: hosted - version: "0.8.0" + version: "0.5.0" meta: dependency: transitive description: name: meta - sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 + sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e url: "https://pub.dev" source: hosted - version: "1.11.0" + version: "1.10.0" nested: dependency: transitive description: @@ -465,10 +441,10 @@ packages: dependency: transitive description: name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" url: "https://pub.dev" source: hosted - version: "1.9.0" + version: "1.8.3" path_parsing: dependency: transitive description: @@ -834,14 +810,6 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 - url: "https://pub.dev" - source: hosted - version: "13.0.0" web: dependency: transitive description: