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(
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,
),
),
),

View File

@ -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,
),
),
),
],

View File

@ -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,

View File

@ -32,7 +32,6 @@ class SixSceneScreen extends StatelessWidget {
child: BlocBuilder<SixSceneBloc, SixSceneState>(
builder: (context, state) {
final _bloc = BlocProvider.of<SixSceneBloc>(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());
});

View File

@ -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),
),

View File

@ -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,

View File

@ -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";
}