Skip to content

Commit

Permalink
Merge pull request #358 from lahirulakruwan/main
Browse files Browse the repository at this point in the history
Asset function side navigation bar changes added
  • Loading branch information
YujithIsura authored May 20, 2024
2 parents a61383a + dbdac5f commit 7c73602
Show file tree
Hide file tree
Showing 10 changed files with 448 additions and 110 deletions.
23 changes: 20 additions & 3 deletions campus/frontend/lib/avinya/asset_admin/lib/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class _AssetAdminSystemState extends State<AssetAdminSystem> {
'/signin',
'/resource_allocation_report',
'/resource_allocations/:id',
'/asset_dashboard',
'/consumable_dashboard'
// '/assets/new',
// '/assets/all',
// '/assets/popular',
Expand All @@ -41,7 +43,7 @@ class _AssetAdminSystemState extends State<AssetAdminSystem> {
],
guard: _guard,
// initialRoute: '/signin',
initialRoute: '/resource_allocation_report',
initialRoute: '/asset_dashboard',
);

_routeState = RouteState(_routeParser);
Expand Down Expand Up @@ -80,6 +82,11 @@ class _AssetAdminSystemState extends State<AssetAdminSystem> {
TargetPlatform.windows: FadeUpwardsPageTransitionsBuilder(),
},
),
drawerTheme: DrawerThemeData(
backgroundColor: Colors.yellow[800],
//width: 270.0,
),
appBarTheme: AppBarTheme(backgroundColor: Colors.yellow[800]),
),
),
),
Expand All @@ -93,6 +100,12 @@ class _AssetAdminSystemState extends State<AssetAdminSystem> {

final resourceAllocationReportRoute =
ParsedRoute('/resource_allocation_report', '/resource_allocation_report', {}, {});

final assetDashboardReportRoute = ParsedRoute(
'/asset_dashboard', '/asset_dashboard', {}, {});

final consumableDashboardReportRoute =
ParsedRoute('/consumable_dashboard', '/consumable_dashboard', {}, {});

// // Go to /apply if the user is not signed in
log("_guard signed in $signedIn");
Expand All @@ -101,10 +114,14 @@ class _AssetAdminSystemState extends State<AssetAdminSystem> {

if (signedIn && from == resourceAllocationReportRoute ) {
return resourceAllocationReportRoute;
}else if (signedIn && from == assetDashboardReportRoute) {
return assetDashboardReportRoute;
} else if (signedIn && from == consumableDashboardReportRoute) {
return consumableDashboardReportRoute;
}
// Go to /application if the user is signed in and tries to go to /signin.
else if (signedIn && from == signInRoute) {
return ParsedRoute('/resource_allocation_report', '/resource_allocation_report', {}, {});
return ParsedRoute('/asset_dashboard', '/asset_dashboard', {}, {});
}
log("_guard signed in2 $signedIn");
// } else if (signedIn && jwt_sub != null) {
Expand All @@ -117,7 +134,7 @@ class _AssetAdminSystemState extends State<AssetAdminSystem> {
bool signedIn = await _auth.getSignedIn();
if (!signedIn) {
// _routeState.go('/signin');
_routeState.go('/resource_allocation_report');
_routeState.go('/asset_dashboard');
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';

class AssetDashboardScreen extends StatefulWidget {
const AssetDashboardScreen({super.key});

@override
State<AssetDashboardScreen> createState() => _AssetDashboardScreenState();
}

class _AssetDashboardScreenState extends State<AssetDashboardScreen> {
@override
Widget build(BuildContext context) {
return const Center(
child: Text('Asset Dashboard Screen'),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import 'package:flutter/material.dart';

class ConsumableDashboardScreen extends StatefulWidget {
const ConsumableDashboardScreen({super.key});

@override
State<ConsumableDashboardScreen> createState() => _ConsumableDashboardScreenState();
}

class _ConsumableDashboardScreenState extends State<ConsumableDashboardScreen> {
@override
Widget build(BuildContext context) {
return const Center(
child: Text('Consumable Dashboard Screen'),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import 'package:flutter/material.dart';

class EmptyScreen extends StatefulWidget {
const EmptyScreen({super.key});

@override
State<EmptyScreen> createState() => _EmptyScreenState();
}

class _EmptyScreenState extends State<EmptyScreen> {
@override
Widget build(BuildContext context) {
return const Placeholder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class _SMSNavigatorState extends State<SMSNavigator> {
var signedIn = await authState.signIn(
credentials.username, credentials.password);
if (signedIn) {
await routeState.go('/resource_allocation_report');
await routeState.go('/asset_dashboard');
}
},
),
Expand All @@ -99,7 +99,7 @@ class _SMSNavigatorState extends State<SMSNavigator> {
// Display the app
FadeTransitionPage<void>(
key: _scaffoldKey,
child: const SMSScaffold(),
child: SMSScaffold(),
),
// Add an additional page to the stack if the user is viewing a book
// or an author
Expand Down
Loading

0 comments on commit 7c73602

Please sign in to comment.