first commit
This commit is contained in:
94
lib/ui/views/splash_screen/splash_screen_view.dart
Normal file
94
lib/ui/views/splash_screen/splash_screen_view.dart
Normal file
@ -0,0 +1,94 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
import '../../../app/themes/app_text.dart';
|
||||
import './splash_screen_view_model.dart';
|
||||
|
||||
class SplashScreenView extends StatelessWidget {
|
||||
const SplashScreenView({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder<SplashScreenViewModel>.nonReactive(
|
||||
viewModelBuilder: () => SplashScreenViewModel(),
|
||||
onViewModelReady: (SplashScreenViewModel model) async {
|
||||
await model.init();
|
||||
},
|
||||
builder: (
|
||||
BuildContext context,
|
||||
SplashScreenViewModel model,
|
||||
Widget? child,
|
||||
) {
|
||||
return WillPopScope(
|
||||
onWillPop: () async => false,
|
||||
child: Scaffold(
|
||||
// backgroundColor: warningColor,
|
||||
body: SafeArea(
|
||||
child: Center(
|
||||
child: Column(
|
||||
children: [
|
||||
const Expanded(
|
||||
flex: 1,
|
||||
child: SizedBox(
|
||||
height: 100,
|
||||
),
|
||||
),
|
||||
Image.asset(
|
||||
'assets/logo.png',
|
||||
width: 200,
|
||||
height: 200,
|
||||
),
|
||||
const SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Text(
|
||||
'KAMUS MEDIS DAN KESEHATAN',
|
||||
style: boldTextStyle.copyWith(
|
||||
// color: backgroundColor,
|
||||
fontSize: 20,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
// Text(
|
||||
// '(Survei App)',
|
||||
// style: boldTextStyle.copyWith(
|
||||
// // color: backgroundColor,
|
||||
// fontStyle: FontStyle.italic,
|
||||
// ),
|
||||
// textAlign: TextAlign.center,
|
||||
// ),
|
||||
const Expanded(child: SizedBox()),
|
||||
Text(
|
||||
'Created By',
|
||||
style: regularTextStyle.copyWith(
|
||||
fontSize: 12,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
'Kicap Karan',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 13,
|
||||
fontStyle: FontStyle.italic,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
Text(
|
||||
'www.kicap-karan.com',
|
||||
style: boldTextStyle.copyWith(
|
||||
fontSize: 13,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 20,
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
16
lib/ui/views/splash_screen/splash_screen_view_model.dart
Normal file
16
lib/ui/views/splash_screen/splash_screen_view_model.dart
Normal file
@ -0,0 +1,16 @@
|
||||
import '../../../app/app.locator.dart';
|
||||
import '../../../app/app.logger.dart';
|
||||
import '../../../app/app.router.dart';
|
||||
import '../../../app/core/custom_base_view_model.dart';
|
||||
import '../../../services/my_tts.dart';
|
||||
|
||||
class SplashScreenViewModel extends CustomBaseViewModel {
|
||||
final log = getLogger('SplashScreenViewModel');
|
||||
final myTts = locator<MyTts>();
|
||||
Future<void> init() async {
|
||||
await myTts.init();
|
||||
// await 3 seconds then go to login
|
||||
// await Future.delayed(const Duration(seconds: 3));
|
||||
await navigationService.navigateTo(Routes.userTrackingIndexView);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user