4scene&6scene&sos

This commit is contained in:
mohammad
2024-11-27 15:04:40 +03:00
parent 51b1438d0e
commit 4e506652f8
8 changed files with 65 additions and 32 deletions

View File

@ -0,0 +1,10 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_4487_7077)">
<path d="M14.06 9.02L14.98 9.94L5.92 19H5V18.08L14.06 9.02ZM17.66 3C17.41 3 17.15 3.1 16.96 3.29L15.13 5.12L18.88 8.87L20.71 7.04C21.1 6.65 21.1 6.02 20.71 5.63L18.37 3.29C18.17 3.09 17.92 3 17.66 3ZM14.06 6.19L3 17.25V21H6.75L17.81 9.94L14.06 6.19Z" fill="#999999"/>
</g>
<defs>
<clipPath id="clip0_4487_7077">
<rect width="24" height="24" fill="white"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 517 B

View File

@ -57,7 +57,8 @@ class SettingProfilePage extends StatelessWidget {
child: SvgPicture.asset( child: SvgPicture.asset(
Assets.sosHomeIcon, Assets.sosHomeIcon,
fit: BoxFit.fitHeight, fit: BoxFit.fitHeight,
height: 100, height:
MediaQuery.of(context).size.height * 0.13,
)) ))
: CircleAvatar( : CircleAvatar(
radius: 55, radius: 55,
@ -69,15 +70,16 @@ class SettingProfilePage extends StatelessWidget {
mainAxisAlignment: mainAxisAlignment:
MainAxisAlignment.center, MainAxisAlignment.center,
children: [ children: [
const SizedBox(
height: 10,
),
Center( Center(
child: SvgPicture.asset( child: SvgPicture.asset(
device!.type == "4S" device!.type == "4S"
? Assets.fourSceneIcon ? Assets.fourSceneIcon
: Assets.sixSceneIcon, : Assets.sixSceneIcon,
fit: BoxFit.contain, fit: BoxFit.contain,
height: MediaQuery.of(context)
.size
.height *
0.08,
), ),
), ),
], ],
@ -123,12 +125,14 @@ class SettingProfilePage extends StatelessWidget {
onTap: () { onTap: () {
_bloc.add(const ChangeNameEvent(value: true)); _bloc.add(const ChangeNameEvent(value: true));
}, },
child: const Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10), padding: EdgeInsets.symmetric(horizontal: 10),
child: Icon( child: SvgPicture.asset(
Icons.edit_outlined, Assets.sosEditProfile,
size: 20, color: Colors.grey,
color: ColorsManager.textPrimaryColor, fit: BoxFit.contain,
height: MediaQuery.of(context).size.height *
0.02,
), ),
), ),
), ),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart'; import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:syncrow_app/features/devices/bloc/device_settings_bloc/device_scene_bloc.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), .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, height: 70,
), ),
) )
: SizedBox( : Padding(
height: 70, padding: device!.type ==
child: SvgPicture.asset( "4S"
device!.type == "4S" ? const EdgeInsets.only(
? Assets.fourSceneIcon top: 5)
: Assets.sixSceneIcon, : const EdgeInsets.only(
fit: BoxFit.contain, top: 0),
child: SizedBox(
height: 70,
child: SvgPicture.asset(
device!.type == "4S"
? Assets
.fourSceneIcon
: Assets
.sixSceneIcon,
fit: BoxFit.contain,
),
), ),
), ),
], ],

View File

@ -67,7 +67,7 @@ class SixSelectSceneFourPage extends StatelessWidget {
} }
: null, : null,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.only(left: 10, right: 10),
child: BodyMedium( child: BodyMedium(
text: 'Save', text: 'Save',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,

View File

@ -32,7 +32,6 @@ class SixSceneScreen extends StatelessWidget {
child: BlocBuilder<SixSceneBloc, SixSceneState>( child: BlocBuilder<SixSceneBloc, SixSceneState>(
builder: (context, state) { builder: (context, state) {
final _bloc = BlocProvider.of<SixSceneBloc>(context); final _bloc = BlocProvider.of<SixSceneBloc>(context);
SixSceneModel model = SixSceneModel( SixSceneModel model = SixSceneModel(
scene_1: '', scene_1: '',
scene_2: '', scene_2: '',
@ -43,25 +42,25 @@ class SixSceneScreen extends StatelessWidget {
scene_id_group_id: '', scene_id_group_id: '',
switch_backlight: '', switch_backlight: '',
); );
if (state is LoadingNewSate) { if (state is LoadingNewSate) {
model = state.device; model = state.device;
} else if (state is UpdateState) { } else if (state is UpdateState) {
model = state.device; model = state.device;
} }
return DefaultScaffold( return DefaultScaffold(
title: _bloc.deviceInfo.subspace.subspaceName, title: _bloc.deviceInfo.name,
actions: [ actions: [
InkWell( InkWell(
onTap: () async { onTap: () async {
bool val = await Navigator.of(context).push( var val = await Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => SettingsPage(device: device!), builder: (context) => SettingsPage(device: device!),
), ),
); );
if (val == true) { if (val == null) {
_bloc.add(const SixSceneInitialInfo()); _bloc.add(const SixSceneInitialInfo());
_bloc.add(const SixSceneInitial());
_bloc.add(const SexSceneSwitchInitial());
} }
}, },
child: SvgPicture.asset(Assets.assetsIconsSettings), child: SvgPicture.asset(Assets.assetsIconsSettings),
@ -196,11 +195,10 @@ class SixSceneScreen extends StatelessWidget {
); );
}, },
); );
if (value == true) { if (value == true) {
Future.delayed( Future.delayed(
const Duration( const Duration(
milliseconds: 250), () { milliseconds: 200), () {
_bloc.add( _bloc.add(
const SexSceneSwitchInitial()); const SexSceneSwitchInitial());
}); });

View File

@ -50,12 +50,17 @@ class FourSceneScreen extends StatelessWidget {
title: _bloc.deviceInfo.name, title: _bloc.deviceInfo.name,
actions: [ actions: [
InkWell( InkWell(
onTap: () { onTap: () async {
Navigator.of(context).push( var val = await Navigator.of(context).push(
MaterialPageRoute( MaterialPageRoute(
builder: (context) => SettingsPage(device: device!), 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), child: SvgPicture.asset(Assets.assetsIconsSettings),
), ),

View File

@ -67,7 +67,7 @@ class FourSelectSceneFourPage extends StatelessWidget {
} }
: null, : null,
child: Padding( child: Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.only(left: 10, right: 15),
child: BodyMedium( child: BodyMedium(
text: 'Save', text: 'Save',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
@ -169,7 +169,8 @@ class FourSelectSceneFourPage extends StatelessWidget {
onChanged: (newSelection) { onChanged: (newSelection) {
// If selected, assign the scene // If selected, assign the scene
sensorBloc.add(SelectOptionEvent(selectedOption: scene.id)); 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, icon: scene.iconInBytes,
title: scene.name, title: scene.name,

View File

@ -1123,6 +1123,6 @@ class Assets {
static const String sixSceneHomeIcon = "assets/icons/six_scene_home_icon.svg"; static const String sixSceneHomeIcon = "assets/icons/six_scene_home_icon.svg";
static const String editDeviceNameIcon = static const String editDeviceNameIcon =
"assets/icons/edit_device_name_icon.svg"; "assets/icons/edit_device_name_icon.svg";
static const String sosHomeIcon = static const String sosHomeIcon = "assets/icons/sos_home_icon.svg";
"assets/icons/sos_home_icon.svg"; static const String editNameSetting = "assets/icons/edit_name_setting.svg";
} }