!! BIG CHANGE TO ASSETS GEN !!

changed the method of generating assets to be more declrative when it comes to names of the assets.

it now include the file path name e.g (asset in the path "assets/images/home-images/home.png" will be generated as this "String assetsImagesHomeImageshome = "path" ".

this will be very helpful in the future when we want to orgnize the assets dir.
This commit is contained in:
Mohammad Salameh
2024-05-07 12:26:12 +03:00
parent a9927e5821
commit fbe2f5fe53
46 changed files with 1694 additions and 527 deletions
+20 -9
View File
@@ -5,8 +5,11 @@ import 'package:syncrow_app/features/app_layout/model/space_model.dart';
import 'package:syncrow_app/features/app_layout/view/widgets/app_bar_home_dropdown.dart';
import 'package:syncrow_app/features/dashboard/view/dashboard_view.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/room_model.dart';
import 'package:syncrow_app/features/devices/model/status_model.dart';
import 'package:syncrow_app/features/devices/view/widgets/curtains/blind_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/curtains/curtain_view.dart';
import 'package:syncrow_app/features/devices/view/widgets/devices_view_body.dart';
import 'package:syncrow_app/features/menu/view/menu_view.dart';
import 'package:syncrow_app/features/scene/view/scene_view.dart';
@@ -15,6 +18,7 @@ import 'package:syncrow_app/navigation/navigation_service.dart';
import 'package:syncrow_app/services/api/spaces_api.dart';
import 'package:syncrow_app/utils/helpers/custom_page_route.dart';
import 'package:syncrow_app/utils/resource_manager/color_manager.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
part 'home_state.dart';
@@ -175,7 +179,13 @@ class HomeCubit extends Cubit<HomeState> {
Navigator.push(
NavigationService.navigatorKey.currentContext!,
CustomPageRoute(
builder: (context) => const BlindsView(),
builder: (context) => CurtainView(
curtain: DeviceModel(
name: "Curtain",
status: [StatusModel(code: "awd", value: 1)],
productType: DeviceType.Curtain,
),
),
),
);
},
@@ -208,7 +218,7 @@ class HomeCubit extends Cubit<HomeState> {
'Routine': [
// IconButton(
// icon: Image.asset(
// Assets.iconsFilter,
// Assets.assetsIconsFilter,
// height: 20,
// width: 20,
// ),
@@ -240,7 +250,7 @@ class HomeCubit extends Cubit<HomeState> {
'Menu': [
IconButton(
icon: SvgPicture.asset(
Assets.iconsScan,
Assets.assetsIconsScan,
height: 20,
width: 20,
),
@@ -256,7 +266,7 @@ class HomeCubit extends Cubit<HomeState> {
'Menu': Padding(
padding: const EdgeInsets.only(left: 15),
child: Image.asset(
Assets.imagesLogoHorizontal,
Assets.assetsImagesLogoHorizontal,
height: 15,
width: 100,
fit: BoxFit.scaleDown,
@@ -265,11 +275,12 @@ class HomeCubit extends Cubit<HomeState> {
};
static var bottomNavItems = [
defaultBottomNavBarItem(icon: Assets.iconsDashboard, label: 'Dashboard'),
// defaultBottomNavBarItem(icon: Assets.iconslayout, label: 'Layout'),
defaultBottomNavBarItem(icon: Assets.iconsDevices, label: 'Devices'),
defaultBottomNavBarItem(icon: Assets.iconsRoutines, label: 'Routine'),
defaultBottomNavBarItem(icon: Assets.iconsMenu, label: 'Menu'),
defaultBottomNavBarItem(
icon: Assets.assetsIconsDashboard, label: 'Dashboard'),
// defaultBottomNavBarItem(icon: Assets.assetsIconslayout, label: 'Layout'),
defaultBottomNavBarItem(icon: Assets.assetsIconsDevices, label: 'Devices'),
defaultBottomNavBarItem(icon: Assets.assetsIconsRoutines, label: 'Routine'),
defaultBottomNavBarItem(icon: Assets.assetsIconsMenu, label: 'Menu'),
];
final List<Widget> pages = [
@@ -36,7 +36,7 @@ class AppBarHomeDropdown extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SvgPicture.asset(
Assets.iconsHome,
Assets.assetsIconsHome,
width: 25,
height: 25,
colorFilter: const ColorFilter.mode(
@@ -41,7 +41,7 @@ class LoginView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
),
@@ -52,7 +52,7 @@ class LoginView extends StatelessWidget {
height: MediaQuery.sizeOf(context).height,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(Assets.imagesVector),
image: AssetImage(Assets.assetsImagesVector),
fit: BoxFit.cover,
opacity: 0.9,
),
@@ -72,7 +72,7 @@ class LoginView extends StatelessWidget {
children: [
Center(
child: SvgPicture.asset(
Assets.imagesLogo,
Assets.assetsImagesLogo,
width: 160,
),
),
@@ -22,7 +22,7 @@ class LoginWithGoogleFacebook extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(Assets.iconsGoogle),
SvgPicture.asset(Assets.assetsIconsGoogle),
const SizedBox(width: 10),
BodyMedium(
text: "Google",
@@ -43,7 +43,7 @@ class LoginWithGoogleFacebook extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(Assets.iconsFacebook),
SvgPicture.asset(Assets.assetsIconsFacebook),
const SizedBox(width: 10),
BodyMedium(
text: "Facebook",
@@ -41,7 +41,7 @@ class CarbonEmission extends StatelessWidget {
SizedBox.square(
dimension: 30,
child: SvgPicture.asset(
Assets.iconsCO2,
Assets.assetsIconsCO2,
fit: BoxFit.contain,
),
),
@@ -71,7 +71,7 @@ class CarbonEmission extends StatelessWidget {
SizedBox.square(
dimension: 30,
child: SvgPicture.asset(
Assets.iconsSustainability,
Assets.assetsIconsSustainability,
fit: BoxFit.contain,
),
),
@@ -61,7 +61,7 @@ class Consumption extends StatelessWidget {
SizedBox.square(
dimension: 60,
child: Image.asset(
Assets.imagesTestDash2,
Assets.assetsImagesTestDash2,
fit: BoxFit.contain,
),
)
@@ -15,21 +15,21 @@ class LiveMonitorTab extends StatelessWidget {
children: [
Expanded(
child: LiveMonitorWidget(
image: Assets.iconsActive,
image: Assets.assetsIconsActive,
title: StringsManager.active,
value: '10.00w',
),
),
Expanded(
child: LiveMonitorWidget(
image: Assets.iconsVoltMeter,
image: Assets.assetsIconsVoltMeter,
title: StringsManager.current,
value: '12.1 A',
),
),
Expanded(
child: LiveMonitorWidget(
image: Assets.iconsFrequency,
image: Assets.assetsIconsFrequency,
title: StringsManager.frequency,
value: '50 Hz',
),
+18 -12
View File
@@ -10,7 +10,7 @@ import 'package:syncrow_app/features/devices/model/device_control_model.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/devices/model/status_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/curtains/curtain_list_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/three_gang/three_gang_interface.dart';
@@ -86,7 +86,7 @@ class DevicesCubit extends Cubit<DevicesState> {
case DeviceType.DoorLock:
return const DoorsListView();
case DeviceType.Curtain:
return const CurtainView();
return const CurtainListView();
// case DeviceType.ThreeGang:
// return const ThreeGangSwitchesView();
case DeviceType.Gateway:
@@ -389,11 +389,14 @@ class DevicesCubit extends Cubit<DevicesState> {
// }
//////////////////////////////////CURTAINS//////////////////////////////////////
double height = 310;
double curtainWidth = 270;
double curtainOpeningSpace = 195;
double blindWindowHight = 310;
double blindOpeningSpace = 245;
double _openPercentage = 0;
bool isMoving = false;
openCurtain() async {
openCurtain(DeviceType type) async {
if (state is CurtainsIsOpening) {
return;
}
@@ -401,7 +404,7 @@ class DevicesCubit extends Cubit<DevicesState> {
isMoving = true;
while (_openPercentage < 100.0) {
if (state is CurtainsIsClosing) {
// interrupted by the closing process
//listen to interruption by the closing process
pauseCurtain();
break;
}
@@ -411,22 +414,24 @@ class DevicesCubit extends Cubit<DevicesState> {
if (isMoving) {
await Future.delayed(const Duration(milliseconds: 200), () {
_openPercentage += 10.0;
height -= 24.5;
//25.5 is the 10% of the curtain opening space, its used to update the
// animated container of thecurtain
type == DeviceType.Curtain
? curtainWidth -= curtainOpeningSpace / 10
: blindWindowHight -= blindOpeningSpace / 10;
if (_openPercentage >= 100.0) {
print('done open');
pauseCurtain();
}
});
} else {
print('stopped open');
pauseCurtain();
break;
}
}
}
closeCurtain() async {
closeCurtain(DeviceType type) async {
if (state is CurtainsIsClosing) {
return;
}
@@ -444,15 +449,16 @@ class DevicesCubit extends Cubit<DevicesState> {
if (isMoving) {
await Future.delayed(const Duration(milliseconds: 200), () {
_openPercentage -= 10.0;
height += 24.5;
//25.5 is the 10% of the curtain opening space, its used to update the
type == DeviceType.Curtain
? curtainWidth += curtainOpeningSpace / 10
: blindWindowHight += 24.5;
if (_openPercentage <= 0.0) {
print('done close');
pauseCurtain();
}
});
} else {
print('stopped close');
pauseCurtain();
break;
}
@@ -54,13 +54,13 @@ class DevicesCategoryModel {
}
Map<DeviceType, String> deviceTypeIconMap = {
DeviceType.AC: Assets.iconsAC,
DeviceType.LightBulb: Assets.iconsLight,
DeviceType.DoorLock: Assets.iconsDoorLock,
DeviceType.Curtain: Assets.iconsCurtain,
DeviceType.Gateway: Assets.iconsGateway,
DeviceType.CeilingSensor: Assets.iconsSensors,
DeviceType.WallSensor: Assets.iconsSensors,
DeviceType.ThreeGang: Assets.iconsGang,
DeviceType.Other: Assets.iconsAC,
DeviceType.AC: Assets.assetsIconsAC,
DeviceType.LightBulb: Assets.assetsIconsLight,
DeviceType.DoorLock: Assets.assetsIconsDoorLock,
DeviceType.Curtain: Assets.assetsIconsCurtain,
DeviceType.Gateway: Assets.assetsIconsGateway,
DeviceType.CeilingSensor: Assets.assetsIconsSensors,
DeviceType.WallSensor: Assets.assetsIconsSensors,
DeviceType.ThreeGang: Assets.assetsIconsGang,
DeviceType.Other: Assets.assetsIconsAC,
};
@@ -10,7 +10,6 @@ class DeviceControlModel {
});
factory DeviceControlModel.fromJson(Map<String, dynamic> json) {
print('json: $json');
return DeviceControlModel(
deviceId: json['deviceUuid'],
code: json['code'],
+8 -8
View File
@@ -42,22 +42,22 @@ class DeviceModel {
DeviceType type = devicesTypesMap[json['productType']] ?? DeviceType.Other;
if (type == DeviceType.LightBulb) {
tempIcon = Assets.iconsLight;
tempIcon = Assets.assetsIconsLight;
} else if (type == DeviceType.CeilingSensor ||
type == DeviceType.WallSensor) {
tempIcon = Assets.iconsSensors;
tempIcon = Assets.assetsIconsSensors;
} else if (type == DeviceType.AC) {
tempIcon = Assets.iconsAC;
tempIcon = Assets.assetsIconsAC;
} else if (type == DeviceType.DoorLock) {
tempIcon = Assets.iconsDoorLock;
tempIcon = Assets.assetsIconsDoorLock;
} else if (type == DeviceType.Curtain) {
tempIcon = Assets.iconsCurtain;
tempIcon = Assets.assetsIconsCurtain;
} else if (type == DeviceType.ThreeGang) {
tempIcon = Assets.icons3GangSwitch;
tempIcon = Assets.assetsIcons3GangSwitch;
} else if (type == DeviceType.Gateway) {
tempIcon = Assets.iconsGateway;
tempIcon = Assets.assetsIconsGateway;
} else {
tempIcon = Assets.iconsLogo;
tempIcon = Assets.assetsIconsLogo;
}
return DeviceModel(
icon: tempIcon,
@@ -54,7 +54,7 @@ class AcInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -31,7 +31,8 @@ class AcInterfaceControls extends StatelessWidget {
child: DefaultContainer(
height: 55,
child: Center(
child: SvgPicture.asset(Assets.iconsAutomatedClock),
child:
SvgPicture.asset(Assets.assetsIconsAutomatedClock),
),
),
),
@@ -43,7 +44,7 @@ class AcInterfaceControls extends StatelessWidget {
child: DefaultContainer(
height: 55,
child: Center(
child: SvgPicture.asset(Assets.iconsLock),
child: SvgPicture.asset(Assets.assetsIconsLock),
),
),
),
@@ -128,7 +128,7 @@ class AcInterfaceTempUnit extends StatelessWidget {
}
},
child: SvgPicture.asset(
Assets.iconsMinus,
Assets.assetsIconsMinus,
),
),
),
@@ -178,7 +178,7 @@ class AcInterfaceTempUnit extends StatelessWidget {
}
},
child: SvgPicture.asset(
Assets.iconsPlus,
Assets.assetsIconsPlus,
height: 24,
width: 24,
),
@@ -35,7 +35,7 @@ class ACTempWidget extends StatelessWidget {
// .setACTemp(DeviceModel, DeviceModel.temperature - 0.5);
},
child: SvgPicture.asset(
Assets.iconsMinus,
Assets.assetsIconsMinus,
),
),
),
@@ -55,7 +55,7 @@ class ACTempWidget extends StatelessWidget {
// .setACTemp(DeviceModel, DeviceModel.temperature + 0.5);
},
child: SvgPicture.asset(
Assets.iconsPlus,
Assets.assetsIconsPlus,
height: 24,
width: 24,
),
@@ -41,7 +41,7 @@ class ACsView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -30,7 +30,7 @@ class UniversalACTemp extends StatelessWidget {
// .setTempToAll(DevicesCubit.universalACTemp - .5);
},
child: SvgPicture.asset(
Assets.iconsMinus,
Assets.assetsIconsMinus,
),
),
),
@@ -50,7 +50,7 @@ class UniversalACTemp extends StatelessWidget {
// .setTempToAll(DevicesCubit.universalACTemp + .5);
},
child: SvgPicture.asset(
Assets.iconsPlus,
Assets.assetsIconsPlus,
height: 24,
width: 24,
),
@@ -1,27 +1,158 @@
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/features/devices/view/widgets/curtains/blinds_blades.dart';
import 'package:syncrow_app/features/devices/model/device_model.dart';
import 'package:syncrow_app/features/shared_widgets/default_scaffold.dart';
import 'package:syncrow_app/generated/assets.dart';
import 'package:syncrow_app/utils/resource_manager/constants.dart';
class BlindsView extends StatelessWidget {
const BlindsView({super.key});
const BlindsView({
super.key,
this.blind,
});
final DeviceModel? blind;
@override
Widget build(BuildContext context) {
return BlocProvider(
create: (context) => DevicesCubit.getInstance(),
child: BlocBuilder<DevicesCubit, DevicesState>(
builder: (context, state) {
return const DefaultScaffold(
title: 'Blinds',
return DefaultScaffold(
title: blind?.name ?? 'Blinds',
child: Column(
children: [
Spacer(),
BlindsBlades(),
// SizedBox(height: 80),
// BlindsBottons(),
Spacer(),
Column(
children: [
Stack(
alignment: Alignment.topCenter,
children: [
Container(
height: 340,
width: 365,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.assetsImagesWindow,
),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 15, bottom: 10),
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),
curve: Curves.linear,
height: DevicesCubit.get(context).blindWindowHight,
width: 270,
child: Stack(
children: List.generate(
25,
(index) {
double spacing = DevicesCubit.get(context)
.blindWindowHight /
24;
double topPosition = index * spacing;
return AnimatedPositioned(
duration: const Duration(milliseconds: 200),
curve: Curves.linear,
top: topPosition,
child: SizedBox(
height: 10,
width: 270,
child: Image.asset(
Assets.assetsImagesHorizintalBlade,
fit: BoxFit.fill,
),
),
);
},
),
),
),
),
],
),
const SizedBox(height: 80),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
DecoratedBox(
decoration:
BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: const Offset(3, 3),
),
]),
child: InkWell(
overlayColor:
MaterialStateProperty.all(Colors.transparent),
onTap: () {
// DevicesCubit.get(context).setHight(false);
DevicesCubit.get(context).openCurtain(
blind?.productType! ?? DeviceType.Blind);
},
child: Image.asset(
Assets.assetsImagesUp,
width: 60,
height: 60,
),
),
),
DecoratedBox(
decoration:
BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: const Offset(3, 3),
),
]),
child: InkWell(
overlayColor:
MaterialStateProperty.all(Colors.transparent),
onTap: () {
DevicesCubit.get(context).pauseCurtain();
},
child: Image.asset(
Assets.assetsImagesPause,
width: 60,
height: 60,
),
),
),
DecoratedBox(
decoration:
BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: const Offset(3, 3),
),
]),
child: InkWell(
overlayColor:
MaterialStateProperty.all(Colors.transparent),
onTap: () {
DevicesCubit.get(context).closeCurtain(
blind?.productType! ?? DeviceType.Blind);
},
child: Image.asset(
Assets.assetsImagesDown,
width: 60,
height: 60,
),
),
),
],
),
],
),
],
),
);
@@ -1,144 +0,0 @@
// ignore_for_file: avoid_print
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
import 'package:syncrow_app/generated/assets.dart';
class BlindsBlades extends StatelessWidget {
const BlindsBlades({
super.key,
});
@override
Widget build(BuildContext context) {
return BlocBuilder<DevicesCubit, DevicesState>(
builder: (context, state) {
return Column(
children: [
Stack(
alignment: Alignment.topCenter,
children: [
Container(
height: 340,
width: 365,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesWindow,
),
),
),
),
Padding(
padding: const EdgeInsets.only(top: 15, bottom: 10),
child: AnimatedContainer(
duration: const Duration(milliseconds: 200),
curve: Curves.linear,
height: DevicesCubit.get(context).height,
width: 270,
child: Stack(
children: List.generate(
25,
(index) {
double spacing =
DevicesCubit.get(context).height / 24;
double topPosition = index * spacing;
return AnimatedPositioned(
duration: const Duration(milliseconds: 200),
curve: Curves.linear,
top: topPosition,
child: SizedBox(
height: 10,
width: 270,
child: Image.asset(
Assets.imagesHorizintalBlade,
fit: BoxFit.fill,
),
),
);
},
),
),
),
),
],
),
const SizedBox(height: 80),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
DecoratedBox(
decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: const Offset(3, 3),
),
]),
child: InkWell(
overlayColor: MaterialStateProperty.all(Colors.transparent),
onTap: () {
// DevicesCubit.get(context).setHight(false);
DevicesCubit.get(context).openCurtain();
},
child: Image.asset(
Assets.imagesUp,
width: 60,
height: 60,
),
),
),
DecoratedBox(
decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: const Offset(3, 3),
),
]),
child: InkWell(
overlayColor: MaterialStateProperty.all(Colors.transparent),
onTap: () {
DevicesCubit.get(context).pauseCurtain();
},
child: Image.asset(
Assets.imagesPause,
width: 60,
height: 60,
),
),
),
DecoratedBox(
decoration: BoxDecoration(shape: BoxShape.circle, boxShadow: [
BoxShadow(
color: Colors.grey.withOpacity(0.5),
spreadRadius: 1,
blurRadius: 5,
offset: const Offset(3, 3),
),
]),
child: InkWell(
overlayColor: MaterialStateProperty.all(Colors.transparent),
onTap: () {
// DevicesCubit.get(context).setHight(true);
// DevicesCubit.get(context).openCurtain();
DevicesCubit.get(context).closeCurtain();
},
child: Image.asset(
Assets.imagesDown,
width: 60,
height: 60,
),
),
),
],
),
],
);
},
);
}
}
@@ -1,6 +1,6 @@
// import 'package:flutter/material.dart';
// import 'package:syncrow_app/features/devices/bloc/devices_cubit.dart';
// import 'package:syncrow_app/generated/assets.dart';
// import 'package:syncrow_app/generated2/assets.dart';
// class BlindsBottons extends StatelessWidget {
// const BlindsBottons({
@@ -28,7 +28,7 @@
// DevicesCubit.get(context).closeCurtain();
// },
// child: Image.asset(
// Assets.imagesUp,
// Assets.assetsImagesUp,
// width: 60,
// height: 60,
// ),
@@ -49,7 +49,7 @@
// // DevicesCubit.get(context).setHight(false);
// },
// child: Image.asset(
// Assets.imagesPause,
// Assets.assetsImagesPause,
// width: 60,
// height: 60,
// ),
@@ -71,7 +71,7 @@
// DevicesCubit.get(context).openCurtain();
// },
// child: Image.asset(
// Assets.imagesDown,
// Assets.assetsImagesDown,
// width: 60,
// height: 60,
// ),
@@ -29,7 +29,7 @@ class DevicesModeTab extends StatelessWidget {
height: 30,
width: 25,
child: SvgPicture.asset(
Assets.iconsWinter,
Assets.assetsIconsWinter,
fit: BoxFit.contain,
),
),
@@ -57,7 +57,7 @@ class DevicesModeTab extends StatelessWidget {
height: 30,
width: 25,
child: SvgPicture.asset(
Assets.iconsSummer,
Assets.assetsIconsSummer,
fit: BoxFit.contain,
),
),
@@ -55,7 +55,7 @@ class LightInterfaceRecentColor extends StatelessWidget {
color: ColorsManager.greyColor,
),
SvgPicture.asset(
Assets.iconsKalvin,
Assets.assetsIconsKalvin,
height: 40,
width: 40,
),
@@ -63,7 +63,7 @@ class LightInterfaceRecentColor extends StatelessWidget {
width: 10,
),
SvgPicture.asset(
Assets.iconsColorWheel,
Assets.assetsIconsColorWheel,
height: 40,
width: 40,
),
@@ -46,7 +46,7 @@ class LightsView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -14,7 +14,7 @@ class NoDevicesView extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesBoxEmpty,
Assets.assetsImagesBoxEmpty,
opacity: const AlwaysStoppedAnimation(0.5),
scale: 1,
width: 140,
@@ -51,7 +51,7 @@ class CeilingSensorInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -104,8 +104,9 @@ class CeilingSensorInterface extends StatelessWidget {
},
child: SvgPicture.asset(
state == 'presence'
? Assets.presenceSensorAssetsPresence
: Assets.presenceSensorAssetsPresenceSensorMotion,
? Assets.assetsIconsPresenceSensorAssetsPresence
: Assets
.assetsIconsPresenceSensorAssetsPresenceSensorMotion,
width: 100,
height: 100,
// colorFilter: ColorFilter.mode(
@@ -258,17 +259,17 @@ class CeilingSensorInterface extends StatelessWidget {
var ceilingSensorButtons = [
{
'title': 'Parameter Settings',
'icon': Assets.presenceSensorAssetsParameterSettings,
'icon': Assets.assetsIconsPresenceSensorAssetsParameterSettings,
'page': null,
},
{
'title': 'Induction History',
'icon': Assets.presenceSensorAssetsInductionRecording,
'icon': Assets.assetsIconsPresenceSensorAssetsInductionRecording,
'page': null,
},
{
'title': 'Help Description',
'icon': Assets.presenceSensorAssetsHelpDescription,
'icon': Assets.assetsIconsPresenceSensorAssetsHelpDescription,
'page': null,
},
];
@@ -213,38 +213,38 @@ class ParametersList extends StatelessWidget {
//{"result":{"productId":"awarhusb","productType":"WPS","status":[{"code":"presence_state","value":"none"},{"code":"far_detection","value":75},{"code":"presence_time","value":0},{"code":"motion_sensitivity_value","value":5},{"code":"motionless_sensitivity","value":5},{"code":"dis_current","value":214},{"code":"illuminance_value","value":231},{"code":"indicator","value":true}]},"success":true}
final List<Map<String, Object?>> wallSensorButtons = const [
{
'icon': Assets.presenceSensorAssetsTime,
'icon': Assets.assetsIconsPresenceSensorAssetsTime,
'title': 'Presence Time',
'code': 'presence_time',
},
{
'icon': Assets.presenceSensorAssetsDistance,
'icon': Assets.assetsIconsPresenceSensorAssetsDistance,
'title': 'Current Distance',
'code': 'dis_current',
},
{
'icon': Assets.presenceSensorAssetsIlluminanceValue,
'icon': Assets.assetsIconsPresenceSensorAssetsIlluminanceValue,
'title': 'Illuminance Value',
'code': 'illuminance_value',
},
{
'icon': Assets.presenceSensorAssetsEmpty,
'icon': Assets.assetsIconsPresenceSensorAssetsEmpty,
'title': 'Nobody Time',
'code': null,
//TODO: Implement the nobody time
},
{
'icon': Assets.presenceSensorAssetsIndicator,
'icon': Assets.assetsIconsPresenceSensorAssetsIndicator,
'title': 'Indicator',
'code': 'indicator',
},
{
'icon': Assets.presenceSensorAssetsRecord,
'icon': Assets.assetsIconsPresenceSensorAssetsRecord,
'title': 'Presence Record',
'code': null
},
{
'icon': Assets.presenceSensorAssetsIlluminanceRecord,
'icon': Assets.assetsIconsPresenceSensorAssetsIlluminanceRecord,
'title': 'Illuminance Record',
'code': null
},
@@ -16,8 +16,8 @@ class PresenceIndicator extends StatelessWidget {
children: [
SvgPicture.asset(
state == 'presence'
? Assets.presenceSensorAssetsPresence
: Assets.presenceSensorAssetsPresenceSensorMotion,
? Assets.assetsIconsPresenceSensorAssetsPresence
: Assets.assetsIconsPresenceSensorAssetsPresenceSensorMotion,
width: 100,
height: 100,
),
@@ -52,7 +52,7 @@ class WallMountedInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -163,7 +163,7 @@ class _DoorLockButtonState extends State<DoorLockButton>
),
child: Center(
child: SvgPicture.asset(
Assets.doorlockAssetsLockIcon,
Assets.assetsIconsDoorlockAssetsLockIcon,
),
),
),
@@ -69,22 +69,22 @@ class DoorLockGrid extends StatelessWidget {
List<Map<String, dynamic>> doorLockButtons = [
{
'title': 'Unlocking Records',
'image': Assets.doorlockAssetsUnlockingRecords,
'image': Assets.assetsIconsDoorlockAssetsUnlockingRecords,
'page': const UnlockingRecordsView(),
},
{
'title': 'Memebers Managment',
'image': Assets.doorlockAssetsMembersManagement,
'image': Assets.assetsIconsDoorlockAssetsMembersManagement,
'page': const MembersManagementView(),
},
{
'title': 'Temporary Password',
'image': Assets.doorlockAssetsTemporaryPassword,
'image': Assets.assetsIconsDoorlockAssetsTemporaryPassword,
'page': null,
},
{
'title': 'Smart Linkage',
'image': Assets.doorlockAssetsSmartLinkage,
'image': Assets.assetsIconsDoorlockAssetsSmartLinkage,
'page': const SmartLinkgeView()
},
];
@@ -42,7 +42,7 @@ class DoorInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -12,8 +12,9 @@ class DoorLockStatusBar extends StatelessWidget {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
SvgPicture.asset(Assets.iconsWifi),
SvgPicture.asset(Assets.dmOffPerOnchargOfflowOffpmOffstDefaultdmOff),
SvgPicture.asset(Assets.assetsIconsWifi),
SvgPicture.asset(Assets
.assetsIconsBatteryDmOffPerOnchargOfflowOffpmOffstDefaultdmOff),
],
);
}
@@ -25,7 +25,8 @@ class SmartLinkgeView extends StatelessWidget {
SizedBox(
width: 45,
height: 40,
child: SvgPicture.asset(Assets.linkageIconsFamilyHome),
child: SvgPicture.asset(
Assets.assetsIconsLinkageIconsFamilyHome),
),
const SizedBox(width: 15),
const Expanded(
@@ -62,7 +63,8 @@ class SmartLinkgeView extends StatelessWidget {
SizedBox(
width: 45,
height: 40,
child: SvgPicture.asset(Assets.linkageIconsDoorLockAlarm),
child: SvgPicture.asset(
Assets.assetsIconsLinkageIconsDoorLockAlarm),
),
const SizedBox(width: 15),
const Expanded(
@@ -48,13 +48,13 @@ class UnlockingRecordsView extends StatelessWidget {
child: records[i]['method'] ==
UnlockingMethod.Fingerprint
? SvgPicture.asset(Assets
.unlockingMethodsIconsFingerprint)
.assetsIconsUnlockingMethodsIconsFingerprint)
: records[i]['method'] ==
UnlockingMethod.Remote
? SvgPicture.asset(Assets
.unlockingMethodsIconsRemote)
.assetsIconsUnlockingMethodsIconsRemote)
: SvgPicture.asset(Assets
.unlockingMethodsIconsFace),
.assetsIconsUnlockingMethodsIconsFace),
),
const SizedBox(
width: 13,
@@ -66,8 +66,8 @@ class GangSwitch extends StatelessWidget {
child: Center(child: CircularProgressIndicator()))
: SvgPicture.asset(
control.value!
? Assets.iconsLightSwitchOn
: Assets.iconsLightSwitchOff,
? Assets.assetsIconsLightSwitchOn
: Assets.assetsIconsLightSwitchOff,
fit: BoxFit.fill,
),
),
@@ -40,7 +40,7 @@ class ThreeGangInterface extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -16,7 +16,7 @@ class JoinHomeView extends StatelessWidget {
child: Column(
children: [
SvgPicture.asset(
Assets.homeManagementIconsJoinAHome,
Assets.assetsIconsMenuIconsHomeManagementIconsJoinAHome,
width: 70,
height: 70,
),
+2 -2
View File
@@ -50,7 +50,7 @@ class SceneView extends StatelessWidget {
Image.asset(
height: 50,
width: 50,
Assets.iconsHot1,
Assets.assetsIconsHot1,
fit: BoxFit.contain,
),
const Icon(
@@ -87,7 +87,7 @@ class SceneView extends StatelessWidget {
Image.asset(
height: 50,
width: 50,
Assets.iconsWinter1,
Assets.assetsIconsWinter1,
fit: BoxFit.contain,
),
const Icon(
@@ -16,7 +16,7 @@ class SceneViewNoScenes extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
Assets.imagesAutomation,
Assets.assetsImagesAutomation,
scale: 1,
opacity: const AlwaysStoppedAnimation(.5),
width: 140,
@@ -51,7 +51,7 @@ class DefaultScaffold extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
opacity: 0.4,
@@ -14,7 +14,9 @@ class SyncrowLogo extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Image.asset(isDark ? Assets.imagesBlackLogo : Assets.imagesWhiteLogo,
scale: 1, width: width);
return Image.asset(
isDark ? Assets.assetsImagesBlackLogo : Assets.assetsImagesWhiteLogo,
scale: 1,
width: width);
}
}
+3 -3
View File
@@ -37,7 +37,7 @@ class SplashView extends StatelessWidget {
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(
Assets.imagesBackground,
Assets.assetsImagesBackground,
),
fit: BoxFit.cover,
),
@@ -48,14 +48,14 @@ class SplashView extends StatelessWidget {
height: MediaQuery.sizeOf(context).height,
decoration: const BoxDecoration(
image: DecorationImage(
image: AssetImage(Assets.imagesVector),
image: AssetImage(Assets.assetsImagesVector),
fit: BoxFit.cover,
opacity: 0.9,
),
),
),
SvgPicture.asset(
Assets.imagesLogo,
Assets.assetsImagesLogo,
width: 240,
)
],