diff --git a/lib/dynamic_menu.dart b/lib/dynamic_menu.dart index 3ea1e23..d975b7d 100644 --- a/lib/dynamic_menu.dart +++ b/lib/dynamic_menu.dart @@ -1,5 +1,6 @@ import 'dart:ui'; +import 'package:app/pages.dart'; import 'package:collection/collection.dart'; import 'package:flutter/material.dart'; @@ -163,6 +164,12 @@ class _MenuItemState extends State { child: ListTile( contentPadding: EdgeInsets.only(left: widget.leftPadding), leading: widget.info.getIcon(), + onTap: () { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => DynamicMenuPage(menuItem: widget.info)), + ); + }, title: Text(widget.info.title, style: TextStyle( fontSize: 25, diff --git a/lib/pages.dart b/lib/pages.dart index fe7b727..36dac3c 100644 --- a/lib/pages.dart +++ b/lib/pages.dart @@ -1,9 +1,11 @@ +import 'package:app/settings.dart'; import 'package:flutter/material.dart'; import 'app_localization.dart'; const tourPageKey = Key("tour_page"); const settingsPageKey = Key("settings_page"); +const dynamicMenuPageKey = Key("dynamic_menu_page"); class TourPage extends StatelessWidget { const TourPage({super.key}); @@ -78,3 +80,37 @@ class SettingsPage extends StatelessWidget { ); } } + +class DynamicMenuPage extends StatelessWidget { + final MenuItemInfo menuItem; + + const DynamicMenuPage({super.key, required this.menuItem}); + + @override + Widget build(BuildContext context) { + return Scaffold( + key: dynamicMenuPageKey, + body: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + menuItem.title, + style: const TextStyle(fontSize: 30), + textAlign: TextAlign.center, + ), + Padding( + padding: const EdgeInsets.only(top: 16.0), + child: ElevatedButton( + onPressed: () { + Navigator.pop(context); + }, + child: const Text('Go back'), + ), + ), + ], + ), + ), + ); + } +}