Thank you for reading. What I want to do is to navigate to a new Cupertino half Modal BottomSheet from the Cupertino half Modal BottomSheet.
This is the package I am using to create Cupertino modal. modal_bottom_sheet 3.0.0-pre
My goal is to create a smooth transition inside the modal sheet like this but half modal.
Version Flutter 3.16.0
I tried some thing like this, but it wouldn't work as I expected. It creates a full page AddProductView() not a bottom modal.
What I tried (1) in the main view.
showCupertinoModalBottomSheet(
expand: false,
context: context,
backgroundColor: Colors.transparent,
builder: (context) {
return Navigator(
onGenerateRoute: (context) => MaterialPageRoute(
builder: (context) => ShowMordal(),
),
);
},
);
What I tried (2)
Navigator.push(context, MaterialPageRoute(builder: (context) {
return ShowMordal();
}));
Also, this is my Myapp function
Widget build(BuildContext context) {
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
initialRoute: MainView.routeName,
onGenerateRoute: (RouteSettings settings) {
switch (settings.name) {
case MainView.routeName:
return MaterialWithModalsPageRoute(
builder: (context) => const MainView(),
settings: settings,
);
}
},
);
}
If anyone can help, Thank you .
hello try this one,
Here, you should use Navigator Widget for inside navigation;