Commit 0b3a5888 authored by Dirk Steinkopf's avatar Dirk Steinkopf

add activity indicator + bugfix in init (not configured shown too early)

parent 730e281d
......@@ -59,6 +59,7 @@ class _TueraufHomePageState extends State<TueraufHomePage> with WidgetsBindingOb
// _pinEntryEnabled is currently without function
bool _pinEntryEnabled = true; // ignore: unused_field
bool _isConfiguredAndRegistered = false;
bool _inProgress = false;
String _fullVersion;
......@@ -82,12 +83,12 @@ class _TueraufHomePageState extends State<TueraufHomePage> with WidgetsBindingOb
_focusNodePinEntry = new FocusNode();
UserRegistration.getInstance().then((UserRegistration userRegistration) {
_userRegistration = userRegistration;
_enablePinEntry(true);
_initLocationTracking();
_initVersion();
_updateResultLabelText("");
});
WidgetsBinding.instance.addObserver(this);
_enablePinEntry(true);
_initLocationTracking();
_updateResultLabelText("");
_initVersion();
}
@override
......@@ -208,7 +209,17 @@ class _TueraufHomePageState extends State<TueraufHomePage> with WidgetsBindingOb
new Container(
alignment: Alignment.topRight,
padding: new EdgeInsets.fromLTRB(10.0, statusBarHeight + 10.0, 10.0, 10.0),
child: new Text(_fullVersion ?? "", textAlign: TextAlign.right),
child: new Column(
crossAxisAlignment: CrossAxisAlignment.end,
children: <Widget>[
new Text(_fullVersion ?? "", textAlign: TextAlign.right),
_inProgress
? new CircularProgressIndicator(
valueColor: new AlwaysStoppedAnimation<Color>(Colors.black),
)
: new Text("")
],
),
),
],
),
......@@ -216,6 +227,7 @@ class _TueraufHomePageState extends State<TueraufHomePage> with WidgetsBindingOb
}
void _updateResultLabelText(final String text) {
debugPrint("_userRegistration=${_userRegistration }");
setState(() {
if (_userRegistration == null || !_userRegistration.isConfigured()) {
_resultLabelText =
......@@ -270,11 +282,7 @@ class _TueraufHomePageState extends State<TueraufHomePage> with WidgetsBindingOb
}
void activityHandler(final bool isRunning) {
if (isRunning) {
_updateResultLabelText("running...");
} else {
_updateResultLabelText("");
}
setState(() => _inProgress = isRunning);
}
void openNow() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment