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

59 lines
1.5 KiB
Dart
Raw Normal View History

2024-02-07 17:25:58 +00:00
import 'package:flutter/material.dart';
import 'package:solaragent/auth.dart';
import 'package:solaragent/router.dart';
import 'package:solaragent/widgets/navigation.dart';
2024-02-07 17:25:58 +00:00
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await authClient.pickClient();
2024-02-07 17:25:58 +00:00
runApp(const SolarAgent());
2024-02-07 17:25:58 +00:00
}
class SolarAgent extends StatelessWidget {
const SolarAgent({super.key});
2024-02-07 17:25:58 +00:00
@override
Widget build(BuildContext context) {
return MaterialApp.router(
title: 'SolarAgent',
2024-02-08 12:30:19 +00:00
theme: ThemeData(
2024-02-10 12:08:25 +00:00
brightness: Brightness.light,
colorScheme: ColorScheme.fromSwatch(
primarySwatch: Colors.indigo,
accentColor: Colors.indigoAccent,
backgroundColor: Colors.white,
brightness: Brightness.light,
2024-02-10 13:09:15 +00:00
),
2024-02-10 12:08:25 +00:00
useMaterial3: true,
),
darkTheme: ThemeData(
brightness: Brightness.dark,
colorScheme: ColorScheme.fromSwatch(
primarySwatch: Colors.indigo,
accentColor: Colors.indigoAccent,
backgroundColor: Colors.black,
brightness: Brightness.dark,
2024-02-10 13:09:15 +00:00
),
2024-02-08 12:30:19 +00:00
useMaterial3: true,
),
routerConfig: router,
builder: (context, child) => Overlay(
initialEntries: [
OverlayEntry(
builder: (context) => SafeArea(
2024-03-23 15:05:04 +00:00
child: SafeArea(
child: Scaffold(
body: child,
bottomNavigationBar: const AgentNavigation(),
),
),
),
)
],
),
2024-02-07 17:25:58 +00:00
);
}
}