This repository has been archived on 2024-06-08. You can view files and clone it, but cannot push or open issues or pull requests.
SolarAgent/lib/main.dart

65 lines
1.7 KiB
Dart
Raw Normal View History

2024-02-08 07:19:37 +00:00
import 'package:firebase_messaging/firebase_messaging.dart';
2024-02-07 17:25:58 +00:00
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
import 'package:goatagent/auth.dart';
import 'package:goatagent/firebase.dart';
import 'package:goatagent/screens/account.dart';
import 'package:goatagent/screens/dashboard.dart';
2024-02-08 07:19:37 +00:00
import 'package:goatagent/screens/notifications.dart';
2024-02-07 17:25:58 +00:00
import 'layouts/navigation.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
2024-02-07 20:40:56 +00:00
AuthGuard().pickClient();
2024-02-07 17:25:58 +00:00
initializeFirebase();
runApp(GoatAgent());
}
class GoatAgent extends StatelessWidget {
final _router = GoRouter(
navigatorKey: GlobalKey<NavigatorState>(),
routes: [
GoRoute(
2024-02-08 07:19:37 +00:00
path: '/',
builder: (context, state) => const DashboardScreen(),
),
GoRoute(
path: '/notifications',
builder: (context, state) => const NotificationScreen(),
),
GoRoute(
path: '/account',
builder: (context, state) => const AccountScreen(),
),
2024-02-07 17:25:58 +00:00
],
);
GoatAgent({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp.router(
routerConfig: _router,
title: 'GoatAgent',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.indigo),
useMaterial3: true,
),
builder: (BuildContext context, Widget? child) {
return Overlay(initialEntries: [
OverlayEntry(
2024-02-08 07:19:37 +00:00
builder: (context) => Scaffold(
body: child,
// bottomNavigationBar: const AgentBottomNavigation()
bottomNavigationBar: AgentNavigation(router: _router),
),
)
2024-02-07 17:25:58 +00:00
]);
},
);
}
}