Skip to content

Commit

Permalink
add: showModal method
Browse files Browse the repository at this point in the history
  • Loading branch information
LanceGin committed Sep 23, 2018
1 parent 9b381f2 commit 3332eb8
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,40 @@ class RandomWordsState extends State<RandomWords> {
return new Scaffold(
appBar: new AppBar(
title: new Text('MinaOTP'),
actions: <Widget>[
new IconButton(
icon: new Icon(Icons.add),
onPressed: _showModal,
)
],
),
body: _buildSuggestions(),
);
}

void _showModal() {
showModalBottomSheet(
context: context,
builder: (BuildContext context) {
return new Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
new ListTile(
leading: new Icon(Icons.camera_alt),
title: new Text('Scan'),
onTap: () => {},
),
new ListTile(
leading: new Icon(Icons.create),
title: new Text('Mannual'),
onTap: _pushSaved,
),
]
);
}
);
}

void _pushSaved() {
Navigator.of(context).push(
new MaterialPageRoute(
Expand Down Expand Up @@ -148,6 +177,6 @@ class RandomWordsState extends State<RandomWords> {
}

void _updateToken() {

}
}

0 comments on commit 3332eb8

Please sign in to comment.