mirror of
https://github.com/wgh136/pixes.git
synced 2025-09-27 12:57:24 +00:00
24 lines
621 B
Dart
24 lines
621 B
Dart
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);
|
|
}
|
|
|
|
Size get size => MediaQuery.of(this).size;
|
|
|
|
EdgeInsets get padding => MediaQuery.of(this).padding;
|
|
}
|