step 4 : home screen
This commit is contained in:
@@ -1,17 +1,49 @@
|
||||
import 'package:app_petty_cash/screen/home/home_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../screen/login/login_screen.dart';
|
||||
import '../screen/splash/splash_screen.dart';
|
||||
|
||||
const loginRoute = "/loginRoute";
|
||||
const menuRoute = "/menuRoute";
|
||||
const splashScreen = "/splashScreen";
|
||||
const homeRoute = "/homeRoute";
|
||||
|
||||
class AppRoute {
|
||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||
// splash screen
|
||||
if (settings.name == splashScreen) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0,
|
||||
padding: EdgeInsets.all(0),
|
||||
),
|
||||
child: SplashScreen(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// home screen
|
||||
if (settings.name == homeRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0,
|
||||
padding: EdgeInsets.all(0),
|
||||
),
|
||||
child: HomeScreen(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// default
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaleFactor: 1.0, padding: const EdgeInsets.all(0)),
|
||||
data: MediaQuery.of(context).copyWith(
|
||||
textScaleFactor: 1.0,
|
||||
padding: const EdgeInsets.all(0),
|
||||
),
|
||||
child: const LoginScreen(),
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user