Skip to content

Commit

Permalink
unfocusing stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
iqfareez committed Aug 17, 2020
1 parent 8ae3f01 commit 35524aa
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 32 deletions.
5 changes: 4 additions & 1 deletion lib/AppBody.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ class _AppBodyState extends State<AppBody> {
filled: true),
keyboardType: TextInputType.number,
inputFormatters: [_amountValidator],
textInputAction: TextInputAction.done,
textInputAction: TextInputAction.next,
onSubmitted: (_) =>
FocusScope.of(context).nextFocus(),
),
),
),
Expand All @@ -123,6 +125,7 @@ class _AppBodyState extends State<AppBody> {
keyboardType: TextInputType.number,
inputFormatters: [_amountValidator],
textInputAction: TextInputAction.done,
onSubmitted: (_) => FocusScope.of(context).unfocus(),
),
),
)
Expand Down
67 changes: 36 additions & 31 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,43 @@ class MyApp extends StatelessWidget {
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepOrange.shade600,
elevation: 0.0,
actions: [
IconButton(
icon: Icon(Icons.share),
onPressed: () {
print('Pressed');
Share.share('Not implemented yet :")');
},
tooltip: 'Share your current BMI',
),
IconButton(
icon: Icon(Icons.info),
onPressed: () {
print('Info');
showAboutDialog(
context: context,
applicationName: 'BMI Calculator Lite',
applicationVersion: '1.0.0-pre+1',
applicationIcon: Image.network(
'https://firebasestorage.googleapis.com/v0/b/bmi-flutter-2e776.appspot.com/o/logounnamed%20(Custom).png?alt=media&token=b22b53f7-bfc6-4a9b-89f3-92e681d1fe6c',
width: 50,
),
applicationLegalese: '© maplerr aka fareez');
},
tooltip: 'View some info',
)
],
return GestureDetector(
onTap: () {
FocusScope.of(context).unfocus();
},
child: Scaffold(
appBar: AppBar(
backgroundColor: Colors.deepOrange.shade600,
elevation: 0.0,
actions: [
IconButton(
icon: Icon(Icons.share),
onPressed: () {
print('Pressed');
Share.share('Not implemented yet :")');
},
tooltip: 'Share your current BMI',
),
IconButton(
icon: Icon(Icons.info),
onPressed: () {
print('Info');
showAboutDialog(
context: context,
applicationName: 'BMI Calculator Lite',
applicationVersion: '1.0.0-pre+1',
applicationIcon: Image.network(
'https://firebasestorage.googleapis.com/v0/b/bmi-flutter-2e776.appspot.com/o/logounnamed%20(Custom).png?alt=media&token=b22b53f7-bfc6-4a9b-89f3-92e681d1fe6c',
width: 50,
),
applicationLegalese: '© maplerr aka fareez');
},
tooltip: 'View some info',
)
],
),
body: AppBody(),
),
body: AppBody(),
);
}
}

0 comments on commit 35524aa

Please sign in to comment.