step 3 : buat screen splash screen
This commit is contained in:
28
lib/app/route.dart
Normal file
28
lib/app/route.dart
Normal file
@@ -0,0 +1,28 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../screen/splash_screen.dart';
|
||||
|
||||
const splashRoute = "/splashRoute";
|
||||
|
||||
class AppRoute {
|
||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||
// splash screen
|
||||
if (settings.name == splashRoute) {
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
|
||||
child: SplashScreen(),
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
return MaterialPageRoute(builder: (context) {
|
||||
return MediaQuery(
|
||||
data: MediaQuery.of(context)
|
||||
.copyWith(padding: const EdgeInsets.all(0), textScaler: TextScaler.linear(1.0)),
|
||||
child: SplashScreen(),
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user