fbmobile/lib/ui/views/startup_view.dart

30 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';
import '../shared/app_colors.dart';
2021-02-02 14:33:23 +00:00
class StartUpView extends StatelessWidget {
static const routeName = '/';
@override
Widget build(BuildContext context) {
return ViewModelBuilder<StartUpViewModel>.reactive(
2021-02-02 14:33:23 +00:00
viewModelBuilder: () => StartUpViewModel(),
onModelReady: (model) => model.handleStartUpLogic(),
builder: (context, model, child) => Scaffold(
backgroundColor: whiteColor,
2021-02-02 14:33:23 +00:00
body: model.state == ViewState.Busy
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircularProgressIndicator(),
(model.stateMessage!.isNotEmpty ? Text(model.stateMessage!) : Container())
2021-02-02 14:33:23 +00:00
]))
: Container()));
}
}