mirror of
https://github.com/SyncrowIOT/web.git
synced 2025-07-10 07:07:19 +00:00
push fetch devices and connecting the filters
This commit is contained in:
@ -25,6 +25,7 @@ abstract class ColorsManager {
|
||||
static const Color slidingBlueColor = Color(0x99023DFE);
|
||||
static const Color blackColor = Color(0xFF000000);
|
||||
static const Color lightGreen = Color(0xFF00FF0A);
|
||||
static const Color green = Color(0xFF008905);
|
||||
static const Color grayColor = Color(0xFF999999);
|
||||
static const Color red = Color(0xFFFF0000);
|
||||
static const Color graysColor = Color(0xffEBEBEB);
|
||||
|
@ -5,21 +5,28 @@ abstract class ApiEndpoints {
|
||||
////////////////////////////////////// Authentication ///////////////////////////////
|
||||
static const String signUp = '$baseUrl/authentication/user/signup';
|
||||
static const String login = '$baseUrl/authentication/user/login';
|
||||
static const String forgetPassword = '$baseUrl/authentication/user/forget-password';
|
||||
static const String forgetPassword =
|
||||
'$baseUrl/authentication/user/forget-password';
|
||||
static const String sendOtp = '$baseUrl/authentication/user/send-otp';
|
||||
static const String verifyOtp = '$baseUrl/authentication/user/verify-otp';
|
||||
static const String getRegion = '$baseUrl/region';
|
||||
static const String visitorPassword = '$baseUrl/visitor-password';
|
||||
static const String getDevices = '$baseUrl/visitor-password/devices';
|
||||
|
||||
|
||||
static const String sendOnlineOneTime = '$baseUrl/visitor-password/temporary-password/online/one-time';
|
||||
static const String sendOnlineMultipleTime = '$baseUrl/visitor-password/temporary-password/online/multiple-time';
|
||||
static const String sendOnlineOneTime =
|
||||
'$baseUrl/visitor-password/temporary-password/online/one-time';
|
||||
static const String sendOnlineMultipleTime =
|
||||
'$baseUrl/visitor-password/temporary-password/online/multiple-time';
|
||||
|
||||
//offline Password
|
||||
static const String sendOffLineOneTime = '$baseUrl/visitor-password/temporary-password/offline/one-time';
|
||||
static const String sendOffLineMultipleTime = '$baseUrl/visitor-password/temporary-password/offline/multiple-time';
|
||||
|
||||
static const String sendOffLineOneTime =
|
||||
'$baseUrl/visitor-password/temporary-password/offline/one-time';
|
||||
static const String sendOffLineMultipleTime =
|
||||
'$baseUrl/visitor-password/temporary-password/offline/multiple-time';
|
||||
|
||||
static const String getUser = '$baseUrl/user/{userUuid}';
|
||||
|
||||
////// Devices Management ////////////////
|
||||
|
||||
static const String getAllDevices = '$baseUrl/device';
|
||||
}
|
||||
|
@ -13,10 +13,12 @@ class Assets {
|
||||
static const String rightLine = "assets/images/right_line.png";
|
||||
static const String google = "assets/images/google.svg";
|
||||
static const String facebook = "assets/images/facebook.svg";
|
||||
static const String invisiblePassword = "assets/images/Password_invisible.svg";
|
||||
static const String invisiblePassword =
|
||||
"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 spaseManagementIcon = "assets/images/spase_management_icon.svg";
|
||||
static const String spaseManagementIcon =
|
||||
"assets/images/spase_management_icon.svg";
|
||||
static const String devicesIcon = "assets/images/devices_icon.svg";
|
||||
static const String moveinIcon = "assets/images/movein_icon.svg";
|
||||
static const String constructionIcon = "assets/images/construction_icon.svg";
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
enum AccessType {
|
||||
onlineOnetime,
|
||||
onlineMultiple,
|
||||
@ -36,11 +35,6 @@ extension AccessTypeExtension on AccessType {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
enum DeviseStatus {
|
||||
online,
|
||||
offline,
|
||||
@ -53,7 +47,6 @@ extension OnlineTypeExtension on DeviseStatus {
|
||||
return "Online";
|
||||
case DeviseStatus.offline:
|
||||
return "Offline";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -69,10 +62,9 @@ extension OnlineTypeExtension on DeviseStatus {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
enum AccessStatus {
|
||||
expired ,
|
||||
effective ,
|
||||
expired,
|
||||
effective,
|
||||
toBeEffective,
|
||||
}
|
||||
|
||||
@ -82,28 +74,22 @@ extension AccessStatusExtension on AccessStatus {
|
||||
case AccessStatus.expired:
|
||||
return "Expired";
|
||||
case AccessStatus.effective:
|
||||
return "Effective" ;
|
||||
case AccessStatus.toBeEffective:
|
||||
return "Effective";
|
||||
case AccessStatus.toBeEffective:
|
||||
return "To be effective";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static AccessStatus fromString(String value) {
|
||||
switch (value) {
|
||||
case "EXPIRED" :
|
||||
case "EXPIRED":
|
||||
return AccessStatus.expired;
|
||||
case "EFFECTIVE" :
|
||||
case "EFFECTIVE":
|
||||
return AccessStatus.effective;
|
||||
case "TO_BE_EFFECTIVE":
|
||||
case "TO_BE_EFFECTIVE":
|
||||
return AccessStatus.toBeEffective;
|
||||
default:
|
||||
throw ArgumentError("Invalid access type: $value");
|
||||
throw ArgumentError("Invalid access type: $value");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
11
lib/utils/format_date_time.dart
Normal file
11
lib/utils/format_date_time.dart
Normal file
@ -0,0 +1,11 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
String formatDateTime(DateTime? dateTime) {
|
||||
if (dateTime == null) {
|
||||
return '-';
|
||||
}
|
||||
final DateFormat dateFormatter = DateFormat('dd/MM/yyyy');
|
||||
final DateFormat timeFormatter = DateFormat('HH:mm');
|
||||
|
||||
return '${dateFormatter.format(dateTime)} ${timeFormatter.format(dateTime)}';
|
||||
}
|
@ -4,7 +4,7 @@ String decodeBase64(String str) {
|
||||
//'-', '+' 62nd char of encoding, '_', '/' 63rd char of encoding
|
||||
String output = str.replaceAll('-', '+').replaceAll('_', '/');
|
||||
switch (output.length % 4) {
|
||||
// Pad with trailing '='
|
||||
// Pad with trailing '='
|
||||
case 0: // No pad chars in this case
|
||||
break;
|
||||
case 2: // Two pad chars
|
||||
|
@ -1,19 +1,20 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
||||
class ResponsiveLayout extends StatelessWidget {
|
||||
final Widget desktopBody;
|
||||
final Widget desktopBody;
|
||||
final Widget mobileBody;
|
||||
const ResponsiveLayout({super.key,required this.desktopBody,required this.mobileBody});
|
||||
const ResponsiveLayout(
|
||||
{super.key, required this.desktopBody, required this.mobileBody});
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return LayoutBuilder(builder: (context, constraints) {
|
||||
if(constraints.maxWidth<600){
|
||||
return mobileBody;
|
||||
}else{
|
||||
return desktopBody;
|
||||
}
|
||||
},
|
||||
return LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
if (constraints.maxWidth < 600) {
|
||||
return mobileBody;
|
||||
} else {
|
||||
return desktopBody;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -16,7 +16,6 @@ class CustomSnackBar {
|
||||
BuildContext? currentContext = key?.currentContext;
|
||||
if (key != null && currentContext != null) {
|
||||
final snackBar = SnackBar(
|
||||
|
||||
padding: const EdgeInsets.all(16),
|
||||
backgroundColor: Colors.green,
|
||||
content: Row(mainAxisAlignment: MainAxisAlignment.center, children: [
|
||||
|
@ -1,46 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'color_manager.dart';
|
||||
|
||||
InputDecoration? textBoxDecoration({bool suffixIcon = false}) => InputDecoration(
|
||||
focusColor: ColorsManager.grayColor,
|
||||
suffixIcon:suffixIcon? const Icon(Icons.search):null,
|
||||
hintText: 'Search',
|
||||
filled: true, // Enable background filling
|
||||
fillColor: const Color(0xffF5F6F7), // Set the background color
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Add border radius
|
||||
borderSide: BorderSide.none, // Remove the underline
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Add border radius
|
||||
borderSide: BorderSide.none, // Remove the underline
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Add border radius
|
||||
borderSide: BorderSide.none, // Remove the underline
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
);
|
||||
InputDecoration? textBoxDecoration({bool suffixIcon = false}) =>
|
||||
InputDecoration(
|
||||
focusColor: ColorsManager.grayColor,
|
||||
suffixIcon: suffixIcon ? const Icon(Icons.search) : null,
|
||||
hintText: 'Search',
|
||||
filled: true, // Enable background filling
|
||||
fillColor: const Color(0xffF5F6F7), // Set the background color
|
||||
border: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Add border radius
|
||||
borderSide: BorderSide.none, // Remove the underline
|
||||
),
|
||||
enabledBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Add border radius
|
||||
borderSide: BorderSide.none, // Remove the underline
|
||||
),
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8), // Add border radius
|
||||
borderSide: BorderSide.none, // Remove the underline
|
||||
),
|
||||
errorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
focusedErrorBorder: OutlineInputBorder(
|
||||
borderSide: BorderSide(color: Colors.red, width: 2),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
BoxDecoration containerDecoration = BoxDecoration(
|
||||
BoxDecoration containerDecoration = BoxDecoration(
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Colors.grey.withOpacity(0.5),
|
||||
spreadRadius: 5,
|
||||
blurRadius: 8,
|
||||
offset: const Offset(0,
|
||||
3), // changes position of shadow
|
||||
offset: const Offset(0, 3), // changes position of shadow
|
||||
),
|
||||
],
|
||||
color: ColorsManager.boxColor,
|
||||
borderRadius: const BorderRadius.all(Radius.circular(10)));
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user