mirror of
https://github.com/supanadit/geo-smart-app.git
synced 2024-11-10 10:02:20 +00:00
3ead80b465
Update some Dependencies Logo Added Start and Stop Tracking Button Optimize Code Stable Version
65 lines
1.4 KiB
Dart
65 lines
1.4 KiB
Dart
import 'package:flutter/cupertino.dart';
|
|
import 'package:flutter/material.dart';
|
|
import 'package:geo_app/bloc/setting.dart';
|
|
import 'package:geo_app/component/loader.dart';
|
|
import 'package:geo_app/page/map.dart';
|
|
import 'package:geo_app/page/setting.dart';
|
|
|
|
class Startup extends StatefulWidget {
|
|
@override
|
|
State createState() {
|
|
return new _StartupState();
|
|
}
|
|
}
|
|
|
|
class _StartupState extends State<Startup> {
|
|
SettingBloc _settingBloc;
|
|
|
|
@override
|
|
void initState() {
|
|
_settingBloc = new SettingBloc();
|
|
|
|
_settingBloc.getSetting();
|
|
|
|
_settingBloc.subject.listen((settingModel) {
|
|
if (settingModel.isNullHost() && settingModel.isNullId()) {
|
|
Navigator.of(context).pushReplacement(new MaterialPageRoute(
|
|
builder: (BuildContext context) => Setting(),
|
|
));
|
|
} else {
|
|
Navigator.of(context).pushReplacement(new MaterialPageRoute(
|
|
builder: (BuildContext context) => Map(),
|
|
));
|
|
}
|
|
});
|
|
|
|
super.initState();
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
body: Center(
|
|
child: Container(
|
|
child: Column(
|
|
children: <Widget>[
|
|
Loader(),
|
|
SizedBox(
|
|
height: 20.0,
|
|
),
|
|
Text("Preparing System")
|
|
],
|
|
),
|
|
height: 50,
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
_settingBloc.dispose();
|
|
super.dispose();
|
|
}
|
|
}
|