Added route and bloc
This commit is contained in:
parent
93ad62fe27
commit
58a104b772
1 changed files with 18 additions and 0 deletions
|
|
@ -2,8 +2,10 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
import 'package:ocbo_esign_mobile/blocs/application/application_bloc.dart';
|
||||||
import 'package:ocbo_esign_mobile/blocs/qr/qr_bloc.dart';
|
import 'package:ocbo_esign_mobile/blocs/qr/qr_bloc.dart';
|
||||||
import 'package:ocbo_esign_mobile/blocs/user/user_bloc.dart';
|
import 'package:ocbo_esign_mobile/blocs/user/user_bloc.dart';
|
||||||
|
import 'package:ocbo_esign_mobile/pages/application_info_page.dart';
|
||||||
import 'package:ocbo_esign_mobile/pages/approval_page.dart';
|
import 'package:ocbo_esign_mobile/pages/approval_page.dart';
|
||||||
import 'package:ocbo_esign_mobile/pages/index_page.dart';
|
import 'package:ocbo_esign_mobile/pages/index_page.dart';
|
||||||
import 'package:ocbo_esign_mobile/pages/login_page.dart';
|
import 'package:ocbo_esign_mobile/pages/login_page.dart';
|
||||||
|
|
@ -67,6 +69,21 @@ final _router = GoRouter(
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
GoRoute(
|
||||||
|
name: 'info',
|
||||||
|
path: '/info',
|
||||||
|
builder: (context, state) => const ApplicationInfoPage(),
|
||||||
|
pageBuilder: (BuildContext context, GoRouterState state) => CustomTransitionPage<void>(
|
||||||
|
key: state.pageKey,
|
||||||
|
child: const ApplicationInfoPage(),
|
||||||
|
transitionsBuilder: (context, animation, secondaryAnimation, child) {
|
||||||
|
return SlideTransition(
|
||||||
|
position: Tween<Offset>(begin: Offset(0.0, -1.0), end: Offset.zero).animate(animation),
|
||||||
|
child: child,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -79,6 +96,7 @@ class MyApp extends StatelessWidget {
|
||||||
providers: [
|
providers: [
|
||||||
BlocProvider(create: (context) => UserBloc()),
|
BlocProvider(create: (context) => UserBloc()),
|
||||||
BlocProvider(create: (context) => QrBloc()),
|
BlocProvider(create: (context) => QrBloc()),
|
||||||
|
BlocProvider(create: (context) => ApplicationBloc()),
|
||||||
],
|
],
|
||||||
child: MaterialApp.router(
|
child: MaterialApp.router(
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue