diff options
| -rw-r--r-- | lib/data.dart | 5 | ||||
| -rw-r--r-- | lib/ui.dart | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lib/data.dart b/lib/data.dart index 31e48b1..5e90b0e 100644 --- a/lib/data.dart +++ b/lib/data.dart @@ -123,4 +123,9 @@ class AppState with ChangeNotifier { return null; } } + + void togglePage() { + onConnectionPage = !onConnectionPage; + notifyListeners(); + } } diff --git a/lib/ui.dart b/lib/ui.dart index 20df8f5..73e532a 100644 --- a/lib/ui.dart +++ b/lib/ui.dart @@ -112,7 +112,20 @@ class ConnectionStatus extends StatelessWidget { text = const Text('Disconnected'); } - return ListTile(leading: icon, title: text); + return Row( + children: <Widget>[ + Expanded( + child: ListTile( + leading: icon, + title: text, + trailing: ElevatedButton( + onPressed: state.togglePage, + child: const Text('switch view'), + ), + ), + ), + ], + ); }, ), ); |
