mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 04:57:23 +00:00
Initial commit
This commit is contained in:
19
lib/foundation/navigation.dart
Normal file
19
lib/foundation/navigation.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:fluent_ui/fluent_ui.dart';
|
||||
|
||||
import '../components/message.dart' as overlay;
|
||||
import '../components/page_route.dart';
|
||||
|
||||
extension Navigation on BuildContext {
|
||||
void pop<T>([T? result]) {
|
||||
Navigator.of(this).pop(result);
|
||||
}
|
||||
|
||||
Future<T?> to<T>(Widget Function() builder) {
|
||||
return Navigator.of(this)
|
||||
.push<T>(AppPageRoute(builder: (context) => builder()));
|
||||
}
|
||||
|
||||
void showToast({required String message, IconData? icon}) {
|
||||
overlay.showToast(this, message: message, icon: icon);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user