step 6 : slicing vektor atas home screen

This commit is contained in:
sindhu
2025-02-15 13:43:37 +07:00
parent fe3bbdc10e
commit c3d906653a
3 changed files with 117 additions and 9 deletions

View File

@@ -1,10 +1,12 @@
import 'package:flutter/material.dart';
import 'package:scanktpflutter/screen/home_screen.dart';
import '../screen/login_screen.dart';
import '../screen/splash_screen.dart';
const splashRoute = "/splashRoute";
const loginRoute = "/loginRoute";
const homeRoute = "/homeRoute";
class AppRoute {
static Route<dynamic> generateRoute(RouteSettings settings) {
@@ -12,8 +14,8 @@ class AppRoute {
if (settings.name == splashRoute) {
return MaterialPageRoute(builder: (context) {
return MediaQuery(
data: MediaQuery.of(context)
.copyWith(textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
child: SplashScreen(),
);
});
@@ -23,19 +25,31 @@ class AppRoute {
if (settings.name == loginRoute) {
return MaterialPageRoute(builder: (context) {
return MediaQuery(
data: MediaQuery.of(context)
.copyWith(textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
child: LoginScreen(),
);
});
}
// home screen
if (settings.name == homeRoute) {
return MaterialPageRoute(builder: (context) {
return MediaQuery(
data: MediaQuery.of(context).copyWith(
textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
child: HomeScreen(),
);
});
}
return MaterialPageRoute(builder: (context) {
return MediaQuery(
data: MediaQuery.of(context)
.copyWith(padding: const EdgeInsets.all(0), textScaler: TextScaler.linear(1.0)),
data: MediaQuery.of(context).copyWith(
padding: const EdgeInsets.all(0),
textScaler: TextScaler.linear(1.0)),
child: SplashScreen(),
);
});
}
}
}