51 lines
1.3 KiB
Dart
51 lines
1.3 KiB
Dart
|
import 'package:dietary_guard/screens/query.dart';
|
||
|
import 'package:dietary_guard/screens/settings.dart';
|
||
|
import 'package:dietary_guard/shells/nav_shell.dart';
|
||
|
import 'package:flutter/material.dart';
|
||
|
import 'package:get/get.dart';
|
||
|
import 'package:go_router/go_router.dart';
|
||
|
|
||
|
void main() {
|
||
|
runApp(const MyApp());
|
||
|
}
|
||
|
|
||
|
final router = GoRouter(routes: [
|
||
|
ShellRoute(
|
||
|
builder: (context, state, child) => NavShell(child: child),
|
||
|
routes: [
|
||
|
GoRoute(
|
||
|
path: "/",
|
||
|
name: "query",
|
||
|
builder: (context, state) => const QueryScreen(),
|
||
|
),
|
||
|
GoRoute(
|
||
|
path: "/settings",
|
||
|
name: "settings",
|
||
|
builder: (context, state) => const SettingsScreen(),
|
||
|
),
|
||
|
],
|
||
|
),
|
||
|
]);
|
||
|
|
||
|
class MyApp extends StatelessWidget {
|
||
|
const MyApp({super.key});
|
||
|
|
||
|
@override
|
||
|
Widget build(BuildContext context) {
|
||
|
return GetMaterialApp.router(
|
||
|
title: 'DietaryGuard',
|
||
|
routerDelegate: router.routerDelegate,
|
||
|
routeInformationParser: router.routeInformationParser,
|
||
|
routeInformationProvider: router.routeInformationProvider,
|
||
|
backButtonDispatcher: router.backButtonDispatcher,
|
||
|
locale: Get.deviceLocale,
|
||
|
theme: ThemeData(
|
||
|
colorScheme: ColorScheme.fromSeed(
|
||
|
seedColor: Colors.green,
|
||
|
),
|
||
|
useMaterial3: true,
|
||
|
),
|
||
|
);
|
||
|
}
|
||
|
}
|