showing multiple portrait view screens in one single screen in landscape view in flutter

Viewed 129

I am making a restaurant app foe mobile and tablet in flutter. The problem I am facing is in mobile view I have these screens(burger,sandwich,...category screen LHS), (the product screen in MIDDLE), and (the cart screen in RHS). But in Tablet screen I have the these screens as one screen. so how can i show all these screens in one screen in landscape view (for tablet).

Any help or guidance is appreciated!!! Thank you

enter image description here

1 Answers

Wrap the parent widget with OrientationBuilder This gives you access to set conditions base on the screen Orientation.

OrientationBuilder(
   builder: (context, orientation) {
    return GridView.count(
     crossAxisCount: orientation == Orientation.portrait ? 2 : 3,
   );
  },
);
Related