Refactor
This commit is contained in:
parent
fa03b8a3af
commit
ca66333019
|
|
@ -20,7 +20,6 @@ class ClientView extends StatefulWidget {
|
||||||
|
|
||||||
class _ClientViewState extends State<ClientView>
|
class _ClientViewState extends State<ClientView>
|
||||||
with SingleTickerProviderStateMixin {
|
with SingleTickerProviderStateMixin {
|
||||||
|
|
||||||
TabController _controller;
|
TabController _controller;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -41,7 +40,8 @@ class _ClientViewState extends State<ClientView>
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(widget.viewModel.client.displayName), // Text(localizations.clientDetails),
|
title: Text(widget.viewModel.client
|
||||||
|
.displayName), // Text(localizations.clientDetails),
|
||||||
bottom: TabBar(
|
bottom: TabBar(
|
||||||
controller: _controller,
|
controller: _controller,
|
||||||
//isScrollable: true,
|
//isScrollable: true,
|
||||||
|
|
@ -102,58 +102,6 @@ class _ClientViewState extends State<ClientView>
|
||||||
child: Icon(Icons.add),
|
child: Icon(Icons.add),
|
||||||
tooltip: localization.create,
|
tooltip: localization.create,
|
||||||
),
|
),
|
||||||
/*
|
|
||||||
body:
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
body: Padding(
|
|
||||||
padding: EdgeInsets.all(16.0),
|
|
||||||
child: ListView(children: [
|
|
||||||
Card(
|
|
||||||
elevation: 2.0,
|
|
||||||
margin: EdgeInsets.all(0.0),
|
|
||||||
child: Form(
|
|
||||||
key: _formKey,
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
TextFormField(
|
|
||||||
autocorrect: false,
|
|
||||||
key: _nameKey,
|
|
||||||
initialValue: viewModel.client.name,
|
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: AppLocalization.of(context).name,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
new Builder(builder: (BuildContext context) {
|
|
||||||
return viewModel.client.isDeleted == true
|
|
||||||
? Container()
|
|
||||||
: ProgressButton(
|
|
||||||
label: AppLocalization.of(context).save.toUpperCase(),
|
|
||||||
isLoading: viewModel.isLoading,
|
|
||||||
isDirty: viewModel.isDirty,
|
|
||||||
onPressed: () {
|
|
||||||
if (!_formKey.currentState.validate()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
viewModel.onSaveClicked(context,
|
|
||||||
viewModel.client.rebuild((b) => b
|
|
||||||
..name = _nameKey.currentState.value)
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
*/
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ class ClientViewBuilder extends StatelessWidget {
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return StoreConnector<AppState, ClientViewVM>(
|
return StoreConnector<AppState, ClientViewVM>(
|
||||||
//ignoreChange: (state) => clientSelector(state.client().list, id).isNotPresent,
|
|
||||||
converter: (Store<AppState> store) {
|
converter: (Store<AppState> store) {
|
||||||
return ClientViewVM.fromStore(store);
|
return ClientViewVM.fromStore(store);
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue