step 4 : home screen

This commit is contained in:
sindhu
2024-01-12 14:52:17 +07:00
parent 3ae6622951
commit f323df9f0f
5 changed files with 154 additions and 133 deletions

View File

@@ -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(),
);
});