diff --git a/assets/icons/edit_name_setting.svg b/assets/icons/edit_name_setting.svg new file mode 100644 index 0000000..9011e82 --- /dev/null +++ b/assets/icons/edit_name_setting.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/lib/features/devices/view/device_settings/profile_page.dart b/lib/features/devices/view/device_settings/profile_page.dart index 216ab12..83b53cf 100644 --- a/lib/features/devices/view/device_settings/profile_page.dart +++ b/lib/features/devices/view/device_settings/profile_page.dart @@ -57,7 +57,8 @@ class SettingProfilePage extends StatelessWidget { child: SvgPicture.asset( Assets.sosHomeIcon, fit: BoxFit.fitHeight, - height: 100, + height: + MediaQuery.of(context).size.height * 0.13, )) : CircleAvatar( radius: 55, @@ -69,15 +70,16 @@ class SettingProfilePage extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, children: [ - const SizedBox( - height: 10, - ), Center( child: SvgPicture.asset( device!.type == "4S" ? Assets.fourSceneIcon : Assets.sixSceneIcon, fit: BoxFit.contain, + height: MediaQuery.of(context) + .size + .height * + 0.08, ), ), ], @@ -123,12 +125,14 @@ class SettingProfilePage extends StatelessWidget { onTap: () { _bloc.add(const ChangeNameEvent(value: true)); }, - child: const Padding( + child: Padding( padding: EdgeInsets.symmetric(horizontal: 10), - child: Icon( - Icons.edit_outlined, - size: 20, - color: ColorsManager.textPrimaryColor, + child: SvgPicture.asset( + Assets.sosEditProfile, + color: Colors.grey, + fit: BoxFit.contain, + height: MediaQuery.of(context).size.height * + 0.02, ), ), ), diff --git a/lib/features/devices/view/device_settings/settings_page.dart b/lib/features/devices/view/device_settings/settings_page.dart index 43c220c..e6e0573 100644 --- a/lib/features/devices/view/device_settings/settings_page.dart +++ b/lib/features/devices/view/device_settings/settings_page.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter/widgets.dart'; import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_bloc.dart'; @@ -97,7 +98,11 @@ class SettingsPage extends StatelessWidget { .subspace.subspaceName), ], ), - const Icon(Icons.edit_sharp) + SvgPicture.asset( + Assets.editNameSetting, + fit: BoxFit.contain, + height: 30, + ), ], ), ), @@ -132,13 +137,23 @@ class SettingsPage extends StatelessWidget { height: 70, ), ) - : SizedBox( - height: 70, - child: SvgPicture.asset( - device!.type == "4S" - ? Assets.fourSceneIcon - : Assets.sixSceneIcon, - fit: BoxFit.contain, + : Padding( + padding: device!.type == + "4S" + ? const EdgeInsets.only( + top: 5) + : const EdgeInsets.only( + top: 0), + child: SizedBox( + height: 70, + child: SvgPicture.asset( + device!.type == "4S" + ? Assets + .fourSceneIcon + : Assets + .sixSceneIcon, + fit: BoxFit.contain, + ), ), ), ], diff --git a/lib/features/devices/view/widgets/6_scene_switch/select_scene_page.dart b/lib/features/devices/view/widgets/6_scene_switch/select_scene_page.dart index 1257133..cb1ee63 100644 --- a/lib/features/devices/view/widgets/6_scene_switch/select_scene_page.dart +++ b/lib/features/devices/view/widgets/6_scene_switch/select_scene_page.dart @@ -67,7 +67,7 @@ class SixSelectSceneFourPage extends StatelessWidget { } : null, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.only(left: 10, right: 10), child: BodyMedium( text: 'Save', fontWeight: FontWeight.w700, diff --git a/lib/features/devices/view/widgets/6_scene_switch/six_scene_screen.dart b/lib/features/devices/view/widgets/6_scene_switch/six_scene_screen.dart index 908f5f8..4b4a369 100644 --- a/lib/features/devices/view/widgets/6_scene_switch/six_scene_screen.dart +++ b/lib/features/devices/view/widgets/6_scene_switch/six_scene_screen.dart @@ -32,7 +32,6 @@ class SixSceneScreen extends StatelessWidget { child: BlocBuilder( builder: (context, state) { final _bloc = BlocProvider.of(context); - SixSceneModel model = SixSceneModel( scene_1: '', scene_2: '', @@ -43,25 +42,25 @@ class SixSceneScreen extends StatelessWidget { scene_id_group_id: '', switch_backlight: '', ); - if (state is LoadingNewSate) { model = state.device; } else if (state is UpdateState) { model = state.device; } - return DefaultScaffold( - title: _bloc.deviceInfo.subspace.subspaceName, + title: _bloc.deviceInfo.name, actions: [ InkWell( onTap: () async { - bool val = await Navigator.of(context).push( + var val = await Navigator.of(context).push( MaterialPageRoute( builder: (context) => SettingsPage(device: device!), ), ); - if (val == true) { + if (val == null) { _bloc.add(const SixSceneInitialInfo()); + _bloc.add(const SixSceneInitial()); + _bloc.add(const SexSceneSwitchInitial()); } }, child: SvgPicture.asset(Assets.assetsIconsSettings), @@ -196,11 +195,10 @@ class SixSceneScreen extends StatelessWidget { ); }, ); - if (value == true) { Future.delayed( const Duration( - milliseconds: 250), () { + milliseconds: 200), () { _bloc.add( const SexSceneSwitchInitial()); }); diff --git a/lib/features/devices/view/widgets/four_scene_switch/four_scene_screen.dart b/lib/features/devices/view/widgets/four_scene_switch/four_scene_screen.dart index 6426e64..9e63b16 100644 --- a/lib/features/devices/view/widgets/four_scene_switch/four_scene_screen.dart +++ b/lib/features/devices/view/widgets/four_scene_switch/four_scene_screen.dart @@ -50,12 +50,17 @@ class FourSceneScreen extends StatelessWidget { title: _bloc.deviceInfo.name, actions: [ InkWell( - onTap: () { - Navigator.of(context).push( + onTap: () async { + var val = await Navigator.of(context).push( MaterialPageRoute( builder: (context) => SettingsPage(device: device!), ), ); + if (val == null) { + _bloc.add(const FourSceneInitial()); + _bloc.add(const FourSceneInitialInfo()); + _bloc.add(const FourSceneSwitchInitial()); + } }, child: SvgPicture.asset(Assets.assetsIconsSettings), ), diff --git a/lib/features/devices/view/widgets/four_scene_switch/four_select_scene_page.dart b/lib/features/devices/view/widgets/four_scene_switch/four_select_scene_page.dart index 4ffdd3a..bf18442 100644 --- a/lib/features/devices/view/widgets/four_scene_switch/four_select_scene_page.dart +++ b/lib/features/devices/view/widgets/four_scene_switch/four_select_scene_page.dart @@ -67,7 +67,7 @@ class FourSelectSceneFourPage extends StatelessWidget { } : null, child: Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.only(left: 10, right: 15), child: BodyMedium( text: 'Save', fontWeight: FontWeight.w700, @@ -169,7 +169,8 @@ class FourSelectSceneFourPage extends StatelessWidget { onChanged: (newSelection) { // If selected, assign the scene sensorBloc.add(SelectOptionEvent(selectedOption: scene.id)); - sensorBloc.add(SelectSceneEvent(selectedSceneId: scene.id,isSelected:newSelection)); + sensorBloc.add(SelectSceneEvent( + selectedSceneId: scene.id, isSelected: newSelection)); }, icon: scene.iconInBytes, title: scene.name, diff --git a/lib/generated/assets.dart b/lib/generated/assets.dart index 859ae1c..7ff3fa0 100644 --- a/lib/generated/assets.dart +++ b/lib/generated/assets.dart @@ -1123,6 +1123,6 @@ class Assets { static const String sixSceneHomeIcon = "assets/icons/six_scene_home_icon.svg"; static const String editDeviceNameIcon = "assets/icons/edit_device_name_icon.svg"; - static const String sosHomeIcon = - "assets/icons/sos_home_icon.svg"; + static const String sosHomeIcon = "assets/icons/sos_home_icon.svg"; + static const String editNameSetting = "assets/icons/edit_name_setting.svg"; }