mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-08-25 14:29:41 +00:00
Merge branch 'dev' into SP-1601-FE-Community-and-Space-Dialog-Redesign-in-the-routine-tab
This commit is contained in:
@ -1,17 +1,31 @@
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:syncrow_web/pages/access_management/view/access_management.dart';
|
||||
import 'package:syncrow_web/pages/analytics/modules/analytics/views/analytics_page.dart';
|
||||
import 'package:syncrow_web/pages/auth/bloc/auth_bloc.dart';
|
||||
import 'package:syncrow_web/pages/auth/view/login_page.dart';
|
||||
import 'package:syncrow_web/pages/device_managment/all_devices/view/device_managment_page.dart';
|
||||
import 'package:syncrow_web/pages/home/view/home_page.dart';
|
||||
import 'package:syncrow_web/pages/roles_and_permission/view/roles_and_permission_page.dart';
|
||||
import 'package:syncrow_web/pages/spaces_management/all_spaces/view/spaces_management_page.dart';
|
||||
import 'package:syncrow_web/pages/space_management_v2/main_module/views/space_management_page.dart';
|
||||
import 'package:syncrow_web/pages/visitor_password/view/visitor_password_dialog.dart';
|
||||
import 'package:syncrow_web/utils/constants/routes_const.dart';
|
||||
|
||||
class AppRoutes {
|
||||
static List<GoRoute> getRoutes() {
|
||||
return [
|
||||
abstract final class AppRoutes {
|
||||
const AppRoutes._();
|
||||
|
||||
static final GoRouter router = GoRouter(
|
||||
initialLocation: RoutesConst.auth,
|
||||
redirect: (context, state) async {
|
||||
final checkToken = await AuthBloc.getTokenAndValidate();
|
||||
final loggedIn = checkToken == 'Success';
|
||||
final goingToLogin = state.uri.toString() == RoutesConst.auth;
|
||||
|
||||
if (!loggedIn && !goingToLogin) return RoutesConst.auth;
|
||||
if (loggedIn && goingToLogin) return RoutesConst.home;
|
||||
|
||||
return null;
|
||||
},
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: RoutesConst.auth,
|
||||
builder: (context, state) => const LoginPage(),
|
||||
@ -43,6 +57,6 @@ class AppRoutes {
|
||||
name: 'analytics',
|
||||
builder: (context, state) => const AnalyticsPage(),
|
||||
),
|
||||
];
|
||||
}
|
||||
],
|
||||
);
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ abstract class ColorsManager {
|
||||
static const Color lightGrayColor = Color(0xB2999999);
|
||||
static const Color grayBorder = Color(0xFFCFCFCF);
|
||||
static const Color textGray = Color(0xffD5D5D5);
|
||||
static const Color titleGray = Color(0xB2999999);
|
||||
static const Color btnColor = Color(0xFF00008B);
|
||||
static const Color blueColor = Color(0xFF0036E6);
|
||||
static const Color boxColor = Color(0xFFF5F6F7);
|
||||
@ -64,6 +65,7 @@ abstract class ColorsManager {
|
||||
static const Color circleRolesBackground = Color(0xFFF8F8F8);
|
||||
static const Color activeGreen = Color(0xFF99FF93);
|
||||
static const Color activeGreenText = Color(0xFF008905);
|
||||
static const Color trueIconGreen = Color(0xFFBBEC6C);
|
||||
static const Color disabledPink = Color(0xFFFF9395);
|
||||
static const Color disabledRedText = Color(0xFF890002);
|
||||
static const Color invitedOrange = Color(0xFFFFE193);
|
||||
@ -88,5 +90,10 @@ abstract class ColorsManager {
|
||||
static const Color grey50 = Color(0xFF718096);
|
||||
static const Color red100 = Color(0xFFFE0202);
|
||||
static const Color grey800 = Color(0xffF8F8F8);
|
||||
static const Color shadowOfSearchTextfield = Color(0x26000000);
|
||||
static const Color hintTextGrey = Colors.grey;
|
||||
static const Color shadowOfDetailsContainer = Color(0x40000000);
|
||||
static const Color checkBoxBorderGray = Color(0xffD0D0D0);
|
||||
static const Color timePickerColor = Color(0xff000000);
|
||||
|
||||
}
|
||||
|
@ -41,6 +41,8 @@ abstract class ApiEndpoints {
|
||||
'/projects/{projectId}/communities/{communityId}/spaces/{spaceId}';
|
||||
static const String getSpaceHierarchy =
|
||||
'/projects/{projectId}/communities/{communityId}/spaces';
|
||||
static const String reorderSpaces =
|
||||
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{parentSpaceUuid}/spaces/order';
|
||||
|
||||
// Community Module
|
||||
static const String createCommunity = '/projects/{projectId}/communities';
|
||||
@ -139,6 +141,12 @@ abstract class ApiEndpoints {
|
||||
'/projects/{projectUuid}/communities/{communityUuid}/spaces/{spaceUuid}/subspaces/{subSpaceUuid}/devices/{deviceUuid}';
|
||||
static const String saveSchedule = '/schedule/{deviceUuid}';
|
||||
|
||||
static const String getBookableSpaces = '/bookable-spaces';
|
||||
|
||||
|
||||
////booking System
|
||||
static const String bookableSpaces = '/bookable-spaces';
|
||||
static const String getCalendarEvents = '/api';
|
||||
static const String getBookings =
|
||||
'/bookings?month={mm}%2F{yyyy}&space={space}';
|
||||
|
||||
}
|
||||
|
@ -4,6 +4,8 @@ class Assets {
|
||||
static const String webBackground = 'assets/images/web_Background.svg';
|
||||
static const String webBackgroundPng = 'assets/images/web_Background.png';
|
||||
static const String blackLogo = 'assets/images/black-logo.png';
|
||||
static const String fourSceenSwitch = 'assets/images/4_sceen_switch.svg';
|
||||
static const String sixSceenSwitch = 'assets/images/6_sceen_switch.svg';
|
||||
static const String logo = 'assets/images/Logo.svg';
|
||||
static const String logoHorizontal = 'assets/images/logo_horizontal.png';
|
||||
static const String vector = 'assets/images/Vector.png';
|
||||
@ -18,6 +20,9 @@ class Assets {
|
||||
'assets/images/Password_invisible.svg';
|
||||
static const String visiblePassword = 'assets/images/password_visible.svg';
|
||||
static const String accessIcon = 'assets/images/access_icon.svg';
|
||||
static const String addButtonIcon = 'assets/icons/add_button_Icon.svg';
|
||||
static const String backButtonIcon = 'assets/icons/back_button_icon.svg';
|
||||
static const String emptyDataTable = 'assets/icons/no_data_table.svg';
|
||||
static const String spaseManagementIcon =
|
||||
'assets/images/spase_management_icon.svg';
|
||||
static const String devicesIcon = 'assets/images/devices_icon.svg';
|
||||
@ -205,6 +210,7 @@ class Assets {
|
||||
|
||||
//assets/icons/ac_lock.svg
|
||||
static const String acLock = 'assets/icons/ac_lock.svg';
|
||||
static const String clockIcon = 'assets/icons/clock_icon.svg';
|
||||
|
||||
//assets/icons/ac_schedule.svg
|
||||
static const String acSchedule = 'assets/icons/ac_schedule.svg';
|
||||
@ -517,4 +523,5 @@ class Assets {
|
||||
static const String emptyRangeOfAqi = 'assets/icons/empty_range_of_aqi.svg';
|
||||
static const String homeIcon = 'assets/icons/home_icon.svg';
|
||||
static const String groupIcon = 'assets/icons/group_icon.svg';
|
||||
static const String xDelete = 'assets/icons/x_delete.svg';
|
||||
}
|
||||
|
@ -21,6 +21,9 @@ enum DeviceType {
|
||||
NCPS,
|
||||
DoorSensor,
|
||||
PC,
|
||||
fourSceen,
|
||||
sixSceen,
|
||||
SOS,
|
||||
Other,
|
||||
}
|
||||
/*
|
||||
@ -63,4 +66,7 @@ Map<String, DeviceType> devicesTypesMap = {
|
||||
'WL': DeviceType.WaterLeak,
|
||||
'NCPS': DeviceType.NCPS,
|
||||
'PC': DeviceType.PC,
|
||||
'4S': DeviceType.fourSceen,
|
||||
'6S': DeviceType.sixSceen,
|
||||
'SOS': DeviceType.SOS,
|
||||
};
|
||||
|
@ -1,6 +1,21 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class StringUtils {
|
||||
static String capitalizeFirstLetter(String text) {
|
||||
if (text.isEmpty) return text;
|
||||
return text[0].toUpperCase() + text.substring(1);
|
||||
}
|
||||
}
|
||||
|
||||
bool isEndTimeAfterStartTime(TimeOfDay start, TimeOfDay end) {
|
||||
final startMinutes = start.hour * 60 + start.minute;
|
||||
final endMinutes = end.hour * 60 + end.minute;
|
||||
|
||||
return endMinutes <= startMinutes;
|
||||
}
|
||||
|
||||
String formatTimeOfDayTo24HourString(TimeOfDay time) {
|
||||
final hour = time.hour.toString().padLeft(2, '0');
|
||||
final minute = time.minute.toString().padLeft(2, '0');
|
||||
return '$hour:$minute';
|
||||
}
|
||||
|
Reference in New Issue
Block a user