fbmobile/lib/ui/views/startup_view.dart

32 lines
1.1 KiB
Dart
Raw Normal View History

2021-02-02 14:33:23 +00:00
import 'package:flutter/material.dart';
import 'package:stacked/stacked.dart';
2021-02-02 14:33:23 +00:00
import '../../core/enums/viewstate.dart';
import '../../core/viewmodels/startup_model.dart';
class StartUpView extends StatelessWidget {
static const routeName = '/';
2023-01-04 20:17:54 +00:00
const StartUpView({super.key});
2021-02-02 14:33:23 +00:00
@override
Widget build(BuildContext context) {
return ViewModelBuilder<StartUpViewModel>.reactive(
2021-02-02 14:33:23 +00:00
viewModelBuilder: () => StartUpViewModel(),
2023-01-16 00:49:04 +00:00
onViewModelReady: (model) => model.handleStartUpLogic(),
2021-02-02 14:33:23 +00:00
builder: (context, model, child) => Scaffold(
2023-01-04 20:17:54 +00:00
body: model.state == ViewState.busy
2021-02-02 14:33:23 +00:00
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
2023-01-04 20:17:54 +00:00
const CircularProgressIndicator(),
2023-01-16 00:44:34 +00:00
(model.stateMessage!.isNotEmpty
? Text(model.stateMessage!)
: Container())
2021-02-02 14:33:23 +00:00
]))
: Container()));
}
}