Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
shirne committed Oct 29, 2023
1 parent 4850d3e commit 53b6590
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ Recommanded usage
// Or use Mydialog.navigatorKey with MaterialApp
// and set theme for dialog
MaterialApp(
//...
MaterialApp(
// ...
navigatorKey: MyDialog.navigatorKey,
localizationsDelegates:[
ShirneDialogLocalizations.delegate,
Expand All @@ -61,8 +61,23 @@ Recommanded usage
GlobalCupertinoLocalizations.delegate,
],
theme: ThemeData.light().copyWith(extensions: [const ShirneDialogTheme()]);
//...
);
// ...
);
// Use with MaterialApp.router
MaterialApp.router(
routerDelegate: AppRouterDelegate(),
);
class AppRouterDelegate<T> extends RouterDelegate<T> with PopNavigatorRouterDelegateMixin{
@override
GlobalKey<NavigatorState>? get navigatorKey => MyDialog.navigatorKey;
// ...
}
// Use with Getx
MyDialog.navigatorKey = Get.key;
// call in anywhere
Expand Down

0 comments on commit 53b6590

Please sign in to comment.