48 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
			
		
		
	
	
			48 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Dart
		
	
	
	
	
	
| import 'package:flutter/material.dart';
 | |
| import 'package:solaragent/auth.dart';
 | |
| import 'package:solaragent/router.dart';
 | |
| import 'package:solaragent/widgets/navigation.dart';
 | |
| 
 | |
| void main() async {
 | |
|   WidgetsFlutterBinding.ensureInitialized();
 | |
| 
 | |
|   await authClient.pickClient();
 | |
| 
 | |
|   runApp(const SolarAgent());
 | |
| }
 | |
| 
 | |
| class SolarAgent extends StatelessWidget {
 | |
|   const SolarAgent({super.key});
 | |
| 
 | |
|   @override
 | |
|   Widget build(BuildContext context) {
 | |
|     return MaterialApp.router(
 | |
|       title: 'SolarAgent',
 | |
|       theme: ThemeData(
 | |
|         colorScheme: ColorScheme.fromSwatch(
 | |
|           primarySwatch: Colors.indigo,
 | |
|           accentColor: Colors.indigoAccent,
 | |
|           backgroundColor: Colors.white,
 | |
|           brightness: Brightness.light,
 | |
|         ),
 | |
|         useMaterial3: true,
 | |
|       ),
 | |
|       routerConfig: router,
 | |
|       builder: (context, child) => Overlay(
 | |
|         initialEntries: [
 | |
|           OverlayEntry(
 | |
|             builder: (context) => SafeArea(
 | |
|               child: SafeArea(
 | |
|                 child: Scaffold(
 | |
|                   body: child,
 | |
|                   bottomNavigationBar: const AgentNavigation(),
 | |
|                 ),
 | |
|               ),
 | |
|             ),
 | |
|           )
 | |
|         ],
 | |
|       ),
 | |
|     );
 | |
|   }
 | |
| }
 |