orgs dialog button disables/enables properly
This commit is contained in:
parent
ebf09413fd
commit
68102ea628
3 changed files with 19 additions and 19 deletions
|
@ -6,13 +6,13 @@ PODS:
|
|||
- Flutter
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `.symlinks/flutter/ios-profile`)
|
||||
- Flutter (from `.symlinks/flutter/ios`)
|
||||
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
|
||||
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
|
||||
|
||||
EXTERNAL SOURCES:
|
||||
Flutter:
|
||||
:path: ".symlinks/flutter/ios-profile"
|
||||
:path: ".symlinks/flutter/ios"
|
||||
shared_preferences:
|
||||
:path: ".symlinks/plugins/shared_preferences/ios"
|
||||
url_launcher:
|
||||
|
|
|
@ -281,7 +281,7 @@
|
|||
);
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
|
||||
"${PODS_ROOT}/../.symlinks/flutter/ios-profile/Flutter.framework",
|
||||
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
|
||||
);
|
||||
name = "[CP] Embed Pods Frameworks";
|
||||
outputPaths = (
|
||||
|
|
|
@ -82,6 +82,8 @@ class FindOrganisations {
|
|||
}
|
||||
|
||||
Future<Organisation> dialog(context) {
|
||||
var focusNode = new FocusNode();
|
||||
|
||||
bool _searchEnabled = false;
|
||||
bool _orgsFetched = false;
|
||||
TextEditingController searchBarText = new TextEditingController();
|
||||
|
@ -104,6 +106,8 @@ class FindOrganisations {
|
|||
barrierDismissible: true,
|
||||
|
||||
builder: (BuildContext context) {
|
||||
FocusScope.of(context).requestFocus(focusNode);
|
||||
|
||||
return StatefulBuilder(
|
||||
builder: (context, setState) {
|
||||
return
|
||||
|
@ -122,6 +126,7 @@ class FindOrganisations {
|
|||
width: 150,
|
||||
height: 50,
|
||||
child: TextField(
|
||||
focusNode: focusNode,
|
||||
controller: searchBarText,
|
||||
decoration: InputDecoration(
|
||||
hintText: "Payee Name",
|
||||
|
@ -134,8 +139,7 @@ class FindOrganisations {
|
|||
}
|
||||
setState(() => {_searchEnabled});
|
||||
},
|
||||
onSubmitted: ((_) {
|
||||
if (_searchEnabled) {
|
||||
onSubmitted: _searchEnabled ? ((_) {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
var result = _submitSearch(searchBarText.text);
|
||||
result.then((_) {
|
||||
|
@ -143,8 +147,7 @@ class FindOrganisations {
|
|||
_orgsFetched = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
}) : null,
|
||||
),
|
||||
),
|
||||
|
||||
|
@ -153,8 +156,7 @@ class FindOrganisations {
|
|||
padding: EdgeInsets.fromLTRB(20, 0, 0, 0),
|
||||
|
||||
child: RaisedButton(
|
||||
onPressed: (() {
|
||||
if (_searchEnabled) {
|
||||
onPressed: _searchEnabled ? (() {
|
||||
SystemChannels.textInput.invokeMethod('TextInput.hide');
|
||||
var result = _submitSearch(searchBarText.text);
|
||||
result.then((_) {
|
||||
|
@ -162,12 +164,10 @@ class FindOrganisations {
|
|||
_orgsFetched = true;
|
||||
});
|
||||
});
|
||||
}
|
||||
}),
|
||||
}) : null,
|
||||
|
||||
child: Icon(Icons.search, color: Colors.white),
|
||||
color: _searchEnabled ? Colors.blue : Colors.blue[200],
|
||||
// make inactive when search in progress as activity indicator
|
||||
color : Colors.blue,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
|
Reference in a new issue