Skip to content

Commit

Permalink
create navigation extention
Browse files Browse the repository at this point in the history
  • Loading branch information
Hegazy02 committed Nov 23, 2023
1 parent 2f86585 commit 0ce906c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions lib/core/helpers/extentions.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';

extension Navigation on BuildContext {
Future pushNamed(String routeName, {Object? arguments}) {
return Navigator.of(this).pushNamed(routeName, arguments: arguments);
}

Future pushReplacementNamed(String routeName, {Object? arguments}) {
return Navigator.of(this)
.pushReplacementNamed(routeName, arguments: arguments);
}

Future pushNamedAndRemoveUntil(String routeName,
{Object? arguments, required RoutePredicate predicate}) {
return Navigator.of(this)
.pushNamedAndRemoveUntil(routeName, predicate, arguments: arguments);
}

void pop() => Navigator.of(this).pop();
}
2 changes: 1 addition & 1 deletion lib/docdoc_app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class DocDocApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ScreenUtilInit(
designSize: const Size(360, 690),
designSize: const Size(375, 812),
minTextAdapt: true,
child: MaterialApp(
debugShowCheckedModeBanner: false,
Expand Down

0 comments on commit 0ce906c

Please sign in to comment.