2021-02-02 14:33:23 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2021-05-07 17:45:08 +00:00
|
|
|
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 = '/';
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2021-05-07 17:45:08 +00:00
|
|
|
return ViewModelBuilder<StartUpViewModel>.reactive(
|
2021-02-02 14:33:23 +00:00
|
|
|
viewModelBuilder: () => StartUpViewModel(),
|
|
|
|
onModelReady: (model) => model.handleStartUpLogic(),
|
|
|
|
builder: (context, model, child) => Scaffold(
|
|
|
|
body: model.state == ViewState.Busy
|
|
|
|
? Center(
|
|
|
|
child: Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
children: [
|
|
|
|
CircularProgressIndicator(),
|
2021-11-29 23:44:22 +00:00
|
|
|
(model.stateMessage!.isNotEmpty ? Text(model.stateMessage!) : Container())
|
2021-02-02 14:33:23 +00:00
|
|
|
]))
|
|
|
|
: Container()));
|
|
|
|
}
|
|
|
|
}
|