diff --git a/lib/pages/settings_page.dart b/lib/pages/settings_page.dart index 8efabc6..09fdb14 100644 --- a/lib/pages/settings_page.dart +++ b/lib/pages/settings_page.dart @@ -1,25 +1,61 @@ import "package:flutter/material.dart"; import "package:flutter_riverpod/flutter_riverpod.dart"; +import "package:navigation_rail_m3e/navigation_rail_m3e.dart"; class SettingsPage extends ConsumerWidget { const SettingsPage({super.key}); @override - Widget build(BuildContext context, WidgetRef ref) => Scaffold( - appBar: AppBar( - title: Text("Settings"), - actionsPadding: .symmetric(horizontal: 12), - actions: [ - SearchAnchor( - builder: (context, controller) => IconButton( - icon: const Icon(Icons.search), - onPressed: controller.openView, - ), - suggestionsBuilder: (context, controller) { - return []; - }, + Widget build(BuildContext context, WidgetRef ref) => Dialog( + constraints: .loose(Size(900, 600)), + child: ClipRRect( + borderRadius: BorderRadiusGeometry.circular(12), + child: Scaffold( + appBar: AppBar( + title: Text("Settings"), + actionsPadding: .symmetric(horizontal: 12), + actions: [ + SearchAnchor( + builder: (_, controller) => IconButton( + icon: const Icon(Icons.search), + onPressed: controller.openView, + ), + suggestionsBuilder: (context, controller) { + return []; + }, + ), + ], ), - ], + body: Padding( + padding: .symmetric(vertical: 8), + child: Row( + children: [ + Padding( + padding: .symmetric(vertical: 4), + child: NavigationRailM3E( + type: .alwaysExpand, + sections: [ + .new( + destinations: [ + .new(icon: Icon(Icons.abc), label: "Account"), + .new(icon: Icon(Icons.abc), label: "Account"), + .new(icon: Icon(Icons.abc), label: "Account"), + .new(icon: Icon(Icons.abc), label: "Account"), + .new(icon: Icon(Icons.abc), label: "Account"), + .new(icon: Icon(Icons.abc), label: "Account"), + .new(icon: Icon(Icons.abc), label: "Account"), + ], + ), + ], + selectedIndex: 0, + onDestinationSelected: (value) {}, + ), + ), + VerticalDivider(), + ], + ), + ), + ), ), ); } diff --git a/lib/widgets/sidebar.dart b/lib/widgets/sidebar.dart index 7a03fc9..f382b97 100644 --- a/lib/widgets/sidebar.dart +++ b/lib/widgets/sidebar.dart @@ -182,8 +182,9 @@ class Sidebar extends HookConsumerWidget { ), IconButton( tooltip: "Open settings", - onPressed: () => Navigator.of(context).push( - MaterialPageRoute(builder: (_) => SettingsPage()), + onPressed: () => showDialog( + context: context, + builder: (_) => SettingsPage(), ), icon: Icon(Icons.settings), ),