fbmobile/lib/ui/views/startup_view.dart
2021-02-02 15:33:23 +01:00

28 lines
1.1 KiB
Dart

import 'package:flutter/material.dart';
import 'package:provider_architecture/provider_architecture.dart';
import '../../core/enums/viewstate.dart';
import '../../core/viewmodels/startup_model.dart';
class StartUpView extends StatelessWidget {
static const routeName = '/';
@override
Widget build(BuildContext context) {
return ViewModelProvider<StartUpViewModel>.withConsumer(
viewModelBuilder: () => StartUpViewModel(),
onModelReady: (model) => model.handleStartUpLogic(),
builder: (context, model, child) => Scaffold(
backgroundColor: Colors.white,
body: model.state == ViewState.Busy
? Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
CircularProgressIndicator(),
(model.stateMessage.isNotEmpty ? Text(model.stateMessage) : Container())
]))
: Container()));
}
}