diff --git a/assets/dome.json b/assets/dome.json
new file mode 100644
index 00000000..39e6ee7c
--- /dev/null
+++ b/assets/dome.json
@@ -0,0 +1,88 @@
+[
+ {
+ "accessUser": "Ali Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ }, {
+ "accessUser": "oamr Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ }, {
+ "accessUser": "John Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ },
+
+ {
+ "accessUser": "John Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ },
+ {
+ "accessUser": "John Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ },
+ {
+ "accessUser": "John Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01 ",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ }, {
+ "accessUser": "John Doe",
+ "accessType": "Admin",
+ "accessPeriod": "2023-08-01 ",
+ "accessibleDevice": "Smart Door",
+ "authorizationSource": "System",
+ "authorizer": "Jane Smith",
+ "authorizationTime": "2023-08-01 10:00 AM",
+ "accessStatus": "Granted",
+ "actions": "View"
+ },
+ {
+ "accessUser": "Alice Johnson",
+ "accessType": "User",
+ "accessPeriod": "2023-08-01 to 2023-08-31",
+ "accessibleDevice": "Smart Lock",
+ "authorizationSource": "Admin",
+ "authorizer": "John Doe",
+ "authorizationTime": "2023-08-02 11:00 AM",
+ "accessStatus": "Pending",
+ "actions": "Approve"
+ }
+]
diff --git a/assets/images/calendar_icon.svg b/assets/images/calendar_icon.svg
new file mode 100644
index 00000000..bdf23bee
--- /dev/null
+++ b/assets/images/calendar_icon.svg
@@ -0,0 +1,13 @@
+
diff --git a/lib/main.dart b/lib/main.dart
index 14d48c3e..615851eb 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -29,9 +29,7 @@ class MyApp extends StatelessWidget {
providers: [
BlocProvider(create: (context) => HomeBloc()),
],
- child:
-
- MaterialApp(
+ child: MaterialApp(
debugShowCheckedModeBanner: false, // Hide debug banner
scrollBehavior: const MaterialScrollBehavior().copyWith(
dragDevices: {
@@ -58,7 +56,7 @@ class MyApp extends StatelessWidget {
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple), // Set up color scheme
useMaterial3: true, // Enable Material 3
),
- home: isLoggedIn == 'Success' ? const HomePage() : const LoginPage(),
+ home: isLoggedIn == 'Success' ? const HomePage() : const LoginPage(),
));
}
}
diff --git a/lib/pages/access_management/access_management.dart b/lib/pages/access_management/access_management.dart
deleted file mode 100644
index f7fee005..00000000
--- a/lib/pages/access_management/access_management.dart
+++ /dev/null
@@ -1,142 +0,0 @@
-import 'package:flutter/material.dart';
-import 'package:flutter_svg/svg.dart';
-import 'package:syncrow_web/utils/color_manager.dart';
-import 'package:syncrow_web/utils/constants/assets.dart';
-import 'package:syncrow_web/web_layout/web_scaffold.dart';
-
-class AccessManagementPage extends StatelessWidget {
- const AccessManagementPage({super.key});
-
- @override
- Widget build(BuildContext context) {
- Size size = MediaQuery.of(context).size;
-
- return WebScaffold(
- enableMenuSideba: false,
- appBarTitle: Row(
- children: [
- Text(
- 'Access Management',
- style: Theme.of(context).textTheme.headlineLarge,
- )
- ],
- ),
- appBarBody: [
- Text(
- 'Physical Access',
- style: Theme.of(context)
- .textTheme
- .headlineMedium!
- .copyWith(color: Colors.white),
- ),
- Text(
- 'App Access',
- style: Theme.of(context)
- .textTheme
- .headlineMedium!
- .copyWith(color: Colors.white),
- )
- ],
- scaffoldBody: Container(
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Container(
- width:size.width*0.3,
- height: size.height*0.05,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.grey.withOpacity(0.5),
- spreadRadius: 5,
- blurRadius: 7,
- offset: Offset(0, 3), // changes position of shadow
- ),
- ],
- color: ColorsManager.boxColor,
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.spaceAround,
- children: [
- Text('All'),
- Text('To Be Effective (0)'),
- Text('Effective (0)'),
- Text('Expired'),
- ],
- ),
- ),
- SizedBox(height: 10,),
- Row(
- children: [
- Container(
- width:size.width*0.08,
- height: size.height*0.05,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.grey.withOpacity(0.5),
- spreadRadius: 5,
- blurRadius: 7,
- offset: Offset(0, 3), // changes position of shadow
- ),
- ],
- color: ColorsManager.boxColor,
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: TextFormField()
- ),
- Container(
- width:size.width*0.08,
- height: size.height*0.05,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.grey.withOpacity(0.5),
- spreadRadius: 5,
- blurRadius: 7,
- offset: Offset(0, 3), // changes position of shadow
- ),
- ],
- color: ColorsManager.boxColor,
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: TextFormField()
- ),
- Container(
- width:size.width*0.08,
- height: size.height*0.05,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.grey.withOpacity(0.5),
- spreadRadius: 5,
- blurRadius: 7,
- offset: Offset(0, 3), // changes position of shadow
- ),
- ],
- color: ColorsManager.boxColor,
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: TextFormField()
- ),
- Container(
- width:size.width*0.08,
- height: size.height*0.05,
- decoration: BoxDecoration(
- boxShadow: [
- BoxShadow(
- color: Colors.grey.withOpacity(0.5),
- spreadRadius: 5,
- blurRadius: 7,
- offset: Offset(0, 3), // changes position of shadow
- ),
- ],
- color: ColorsManager.boxColor,
- borderRadius: BorderRadius.all(Radius.circular(10))),
- child: TextFormField()
- )
- ],
- ),
-
- ],
- ),
- ));
- }
-}
diff --git a/lib/pages/access_management/bloc/access_bloc.dart b/lib/pages/access_management/bloc/access_bloc.dart
new file mode 100644
index 00000000..8938fc36
--- /dev/null
+++ b/lib/pages/access_management/bloc/access_bloc.dart
@@ -0,0 +1,26 @@
+import 'package:flutter_bloc/flutter_bloc.dart';
+import 'package:syncrow_web/pages/access_management/bloc/access_event.dart';
+import 'package:syncrow_web/pages/access_management/bloc/access_state.dart';
+import 'package:syncrow_web/pages/access_management/model/access_manag_model.dart';
+import 'package:syncrow_web/services/access_mang_api.dart';
+
+class AccessBloc extends Bloc {
+ AccessBloc() : super((AccessInitial())) {
+ on(_onFetchTableData);
+ }
+ String startTime = 'Start Time';
+ String endTime = 'End Time';
+
+ Future _onFetchTableData(
+ FetchTableData event, Emitter emit) async {
+ try {
+ emit(AccessLoaded());
+ List data = await AccessMangApi().fetchInfo();
+ print('objectwww888888${data[0].accessPeriod}');
+
+ emit(TableLoaded(data));
+ } catch (e) {
+ emit(FailedState(e.toString()));
+ }
+ }
+}
diff --git a/lib/pages/access_management/bloc/access_event.dart b/lib/pages/access_management/bloc/access_event.dart
new file mode 100644
index 00000000..60512387
--- /dev/null
+++ b/lib/pages/access_management/bloc/access_event.dart
@@ -0,0 +1,11 @@
+
+import 'package:equatable/equatable.dart';
+
+abstract class AccessEvent extends Equatable {
+ const AccessEvent();
+
+ @override
+ List