Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to go back to main page using arrow icon? #29

Open
JoeCapo87 opened this issue Mar 4, 2020 · 2 comments
Open

How to go back to main page using arrow icon? #29

JoeCapo87 opened this issue Mar 4, 2020 · 2 comments

Comments

@JoeCapo87
Copy link

Hi @RafaelBarbosatec, the use case scenario is similar to the one on the official guide: https://flutter.dev/docs/cookbook/navigation/navigation-basics#interactive-example

If inside Page1 i can navigate to pageX, how can i go back to Page1 using the button in the appbar? The drawer icon should became the back button (arrow icon instead 3 lines icon), but it isn't so. Also i need the appbar on every screen, so I can't use the gestures to navigate back.

@EbrahimMosaaed
Copy link

Hi @RafaelBarbosatec, the use case scenario is similar to the one on the official guide: https://flutter.dev/docs/cookbook/navigation/navigation-basics#interactive-example

If inside Page1 i can navigate to pageX, how can i go back to Page1 using the button in the appbar? The drawer icon should became the back button (arrow icon instead 3 lines icon), but it isn't so. Also i need the appbar on every screen, so I can't use the gestures to navigate back.

Hi
Did you find any solution ?

@SamiraAriaeifar
Copy link

SimpleHiddenDrawer(
menu: Menu(),
typeOpen: TypeOpen.FROM_RIGHT,
// isDraggable: false,
initPositionSelected: 2,
screenSelectedBuilder: (position, controller) {
Widget screenCurrent;
switch (position) {
case 11:
screenCurrent = ScreenLogin();
break;
case 12:
screenCurrent = ScreenProfile();
break;
case 2:
screenCurrent = ScreenHome();
break;
case 3:
screenCurrent = ScreenAddresses();
break;
case 4:
screenCurrent = ScreenOrders();
break;
case 6:
screenCurrent = ScreenFavorite();
break;
}
return Scaffold(
backgroundColor: Colors.white,
appBar: !(position == 11 ||
position == 12 ||
position == 3 ||
position == 4 ||
position == 6)
? AppBar(
backgroundColor: Colors.grey[100],
centerTitle: true,
elevation: 0.0,
title: Text(
''
style: TextStyle(
color: Color(0xff008a7d), fontWeight: FontWeight.bold),
),
actions: [
GestureDetector(
onTap: () async {
// Navigator.pushNamed(context, "/scan_barcode");
if (!_isLoading) scan();
},
child: Container(
margin: EdgeInsets.only(top:8,left: 8),
child: SvgPicture.asset(
'assets/images/ic_barcode.svg',
width: 50,
color: Color(0xff008a7d),
)),
),

              ],
              
            )
          : null,
      body: screenCurrent,
    );

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants