51 lines
1.0 KiB
Dart
51 lines
1.0 KiB
Dart
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:go_router/go_router.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../widgets/map/flutterMap.dart';
|
|
import 'gt.dart';
|
|
|
|
final _router = GoRouter(
|
|
routes: [
|
|
GoRoute(
|
|
path: '/',
|
|
builder: (context, state) => const MyApp(),
|
|
routes: [
|
|
GoRoute(
|
|
path: 'map2',
|
|
builder: (context, state) => const MyMAP(),
|
|
)
|
|
]
|
|
),
|
|
GoRoute(
|
|
path: '/map',
|
|
builder: (context, state) => const MyMAP(),
|
|
),
|
|
],
|
|
);
|
|
|
|
|
|
class GoRouterMain extends StatelessWidget {
|
|
const GoRouterMain({super.key});
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp.router(
|
|
routerConfig: _router,
|
|
);
|
|
}
|
|
}
|
|
|
|
void main() {
|
|
runApp(
|
|
// For widgets to be able to read providers, we need to wrap the entire
|
|
// application in a "ProviderScope" widget.
|
|
// This is where the state of our providers will be stored.
|
|
const ProviderScope(
|
|
child: GoRouterMain(),
|
|
),
|
|
);
|
|
}
|
|
|
|
|