69 lines
2.0 KiB
Dart
69 lines
2.0 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../screen/rekaman/rekam_screen.dart';
|
|
|
|
import '../screen/home/home_screen.dart';
|
|
import '../screen/login/login_screen.dart';
|
|
import '../screen/splash/splash_screen.dart';
|
|
|
|
const splashRoute = "/splashRoute";
|
|
const loginRoute = "/loginRoute";
|
|
const homeRoute = "/homeRoute";
|
|
const rekamRoute = "/rekamRoute";
|
|
|
|
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(),
|
|
);
|
|
});
|
|
}
|
|
|
|
// login screen
|
|
if (settings.name == loginRoute) {
|
|
return MaterialPageRoute(builder: (context) {
|
|
return MediaQuery(
|
|
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(),
|
|
);
|
|
});
|
|
}
|
|
|
|
// rekam screen
|
|
if (settings.name == rekamRoute) {
|
|
return MaterialPageRoute(builder: (context) {
|
|
return MediaQuery(
|
|
data: MediaQuery.of(context).copyWith(
|
|
textScaler: TextScaler.linear(1.0), padding: EdgeInsets.all(0)),
|
|
child: RekamScreen(),
|
|
);
|
|
});
|
|
}
|
|
|
|
return MaterialPageRoute(builder: (context) {
|
|
return MediaQuery(
|
|
data: MediaQuery.of(context).copyWith(
|
|
padding: const EdgeInsets.all(0),
|
|
textScaler: TextScaler.linear(1.0)),
|
|
child: SplashScreen(),
|
|
);
|
|
});
|
|
}
|
|
}
|