Add logout button to init screen
This commit is contained in:
parent
dbaa8b3540
commit
f6ca0b199f
|
|
@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
|
|||
|
||||
// Package imports:
|
||||
import 'package:flutter_redux/flutter_redux.dart';
|
||||
import 'package:invoiceninja_flutter/utils/localization.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
||||
// Project imports:
|
||||
|
|
@ -12,6 +13,8 @@ import 'package:invoiceninja_flutter/redux/auth/auth_actions.dart';
|
|||
class InitScreen extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final localization = AppLocalization.of(context)!;
|
||||
|
||||
return StoreBuilder(
|
||||
onInit: (Store<AppState> store) =>
|
||||
store.dispatch(LoadStateRequest(context)),
|
||||
|
|
@ -21,9 +24,32 @@ class InitScreen extends StatelessWidget {
|
|||
child: Column(
|
||||
mainAxisSize: MainAxisSize.max,
|
||||
children: <Widget>[
|
||||
Expanded(child: SizedBox()),
|
||||
Expanded(
|
||||
child: Center(child: Image.asset('assets/images/icon.png')),
|
||||
),
|
||||
Expanded(
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 50,
|
||||
width: 100,
|
||||
child: Material(
|
||||
child: ElevatedButton(
|
||||
child: Text(
|
||||
localization.logout.toUpperCase(),
|
||||
style: TextStyle(color: Colors.white),
|
||||
),
|
||||
onPressed: () {
|
||||
store.dispatch(UserLogout());
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4.0,
|
||||
child: LinearProgressIndicator(),
|
||||
|
|
|
|||
Loading…
Reference in New Issue