!! 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

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 = [