added splashscreen, login and add hp number pages

This commit is contained in:
kicap
2023-07-15 05:08:31 +08:00
parent eff379e80e
commit 4c5ec4364d
30 changed files with 1674 additions and 111 deletions

View File

@ -0,0 +1,67 @@
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
import './splash_screen_view_model.dart';
class SplashScreenView extends StatelessWidget {
const SplashScreenView({super.key});
@override
Widget build(BuildContext context) {
return ViewModelBuilder<SplashScreenViewModel>.reactive(
viewModelBuilder: () => SplashScreenViewModel(),
onViewModelReady: (SplashScreenViewModel model) async {
await model.init();
},
builder: (
BuildContext context,
SplashScreenViewModel model,
Widget? child,
) {
return Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Expanded(
flex: 1,
child: SizedBox(
height: 20,
),
),
Expanded(
flex: 2,
child: Column(
children: [
Center(
child: Image.asset(
'assets/logo.png',
width: 200,
height: 200,
),
),
const Text(
'Reza Table Reservation \n& Food Order',
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
textAlign: TextAlign.center,
),
],
),
),
const SizedBox(height: 20),
const Text(
'Alamat jalan jendral sudirman',
style: TextStyle(
fontSize: 16,
),
),
const SizedBox(height: 20),
],
),
);
},
);
}
}

View File

@ -0,0 +1,10 @@
import 'package:reza_app/app/app.router.dart';
import 'package:reza_app/app/core/custom_base_view_model.dart';
class SplashScreenViewModel extends CustomBaseViewModel {
Future<void> init() async {
// after 2 second, navigate to login page
await Future.delayed(const Duration(seconds: 2));
await navigationService.navigateToLoginUserView();
}
}