progress on home page
This commit is contained in:
@@ -2,13 +2,18 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'providers/transaction_provider.dart';
|
||||
import 'screens/home_screen.dart';
|
||||
import 'screens/home/home_screen.dart';
|
||||
import 'screens/make_payment_screen.dart';
|
||||
import 'screens/history_screen.dart';
|
||||
import 'screens/profile_screen.dart';
|
||||
import 'theme/app_theme.dart';
|
||||
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||
|
||||
void main() {
|
||||
const String testEnv = "assets/.env";
|
||||
const String liveEnv = "assets/.env";
|
||||
|
||||
void main() async {
|
||||
await dotenv.load(fileName: testEnv);
|
||||
runApp(const MyApp());
|
||||
}
|
||||
|
||||
@@ -17,49 +22,43 @@ class MyApp extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChangeNotifierProvider(
|
||||
create: (_) => TransactionProvider(),
|
||||
child: MaterialApp.router(
|
||||
title: 'QPay',
|
||||
theme: AppTheme.lightTheme,
|
||||
routerConfig: GoRouter(
|
||||
initialLocation: '/',
|
||||
routes: [
|
||||
ShellRoute(
|
||||
builder: (context, state, child) {
|
||||
return ScaffoldWithNavBar(child: child);
|
||||
},
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/',
|
||||
builder: (context, state) => const HomeScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/make-payment',
|
||||
builder: (context, state) => const MakePaymentScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/history',
|
||||
builder: (context, state) => const HistoryScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/profile',
|
||||
builder: (context, state) => const ProfileScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
return MaterialApp.router(
|
||||
title: 'QPay',
|
||||
theme: AppTheme.lightTheme,
|
||||
routerConfig: GoRouter(
|
||||
initialLocation: '/',
|
||||
routes: [
|
||||
ShellRoute(
|
||||
builder: (context, state, child) {
|
||||
return ScaffoldWithNavBar(child: child);
|
||||
},
|
||||
routes: [
|
||||
GoRoute(
|
||||
path: '/',
|
||||
builder: (context, state) => const HomeScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/make-payment',
|
||||
builder: (context, state) => const MakePaymentScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/history',
|
||||
builder: (context, state) => const HistoryScreen(),
|
||||
),
|
||||
GoRoute(
|
||||
path: '/profile',
|
||||
builder: (context, state) => const ProfileScreen(),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class ScaffoldWithNavBar extends StatelessWidget {
|
||||
const ScaffoldWithNavBar({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
const ScaffoldWithNavBar({super.key, required this.child});
|
||||
|
||||
final Widget child;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user