60 lines
1.6 KiB
Dart
60 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:solaragent/auth.dart';
|
|
import 'package:solaragent/router.dart';
|
|
import 'package:solaragent/widgets/navigation.dart';
|
|
import 'package:sentry_flutter/sentry_flutter.dart';
|
|
|
|
Future<void> main() async {
|
|
await SentryFlutter.init(
|
|
(options) {
|
|
options.dsn =
|
|
'https://a629d9164a60a28ac855c52f4f543722@o4506965897117696.ingest.us.sentry.io/4506965900001280';
|
|
options.tracesSampleRate = 1.0;
|
|
},
|
|
appRunner: () 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) => Container(
|
|
color: Colors.white,
|
|
child: SafeArea(
|
|
bottom: false,
|
|
child: Scaffold(
|
|
body: child,
|
|
bottomNavigationBar: const AgentNavigation(),
|
|
),
|
|
),
|
|
),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|