This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
import '../../features/mapflow/presentation/admin_voice_experiences_screen.dart';
|
||||
import '../../features/mapflow/presentation/mapflow_shell.dart';
|
||||
|
||||
class AddExperienceArgs {
|
||||
const AddExperienceArgs({
|
||||
required this.coordinate,
|
||||
required this.hasTelegramAuth,
|
||||
});
|
||||
|
||||
final LatLng? coordinate;
|
||||
final bool hasTelegramAuth;
|
||||
}
|
||||
|
||||
GoRouter createAppRouter() {
|
||||
return GoRouter(
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/',
|
||||
builder: (context, state) => const MapflowShell(),
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: 'experience/new',
|
||||
pageBuilder: (context, state) {
|
||||
final args = state.extra as AddExperienceArgs;
|
||||
return CustomTransitionPage<void>(
|
||||
fullscreenDialog: true,
|
||||
key: state.pageKey,
|
||||
child: AddExperienceFlow(
|
||||
coordinate: args.coordinate,
|
||||
hasTelegramAuth: args.hasTelegramAuth,
|
||||
),
|
||||
transitionsBuilder: (context, animation, _, child) {
|
||||
return SlideTransition(
|
||||
position: Tween<Offset>(
|
||||
begin: const Offset(0, 1),
|
||||
end: Offset.zero,
|
||||
).animate(animation),
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
path: 'admin/reviews',
|
||||
builder: (context, state) => const AdminVoiceExperiencesScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user