Initial commit

This commit is contained in:
kicap
2024-03-02 08:48:26 +08:00
commit 758f5f3d8f
181 changed files with 9753 additions and 0 deletions

View File

@ -0,0 +1,61 @@
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 Scaffold(
// backgroundColor: mainColor,
body: Column(
children: [
const SizedBox(),
Expanded(
child: Center(
// show the logo.png
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Image(
image: AssetImage("assets/logo.png"),
width: 200,
height: 200,
),
const SizedBox(height: 10),
Text(
"Sistem Retribusi Pasar Enrekang",
style: boldTextStyle.copyWith(
fontSize: 20,
),
)
],
),
),
),
const Text(
"Jln Panti Asuhan No. 3 Ujung Lare, Kec. Soreang, Kota Parepare, Sulawesi Selatan 91133",
textAlign: TextAlign.center,
style: regularTextStyle,
),
const SizedBox(height: 15),
],
),
);
},
);
}
}

View File

@ -0,0 +1,18 @@
import 'package:rfid_app/app/core/custom_base_view_model.dart';
import '../../../app/app.logger.dart';
import '../../../app/app.router.dart';
class SplashScreenViewModel extends CustomBaseViewModel {
final log = getLogger('SplashScreenViewModel');
Future<void> init() async {
await Future.delayed(const Duration(seconds: 2));
// navigate to login page
// ignore: use_build_context_synchronously
socketIoClient.init();
socketIoClient.on('coba', (data) {
log.i('data : $data');
});
navigationService.replaceWith(Routes.loginScreenView);
}
}