0

I want to add bottom padding for showing page in page view like this image.

Bryan
  • 747
  • 1
  • 7
  • 19

1 Answers1

1

Put your page in a Padding element and then set edge insets only for bottom:

new Padding(
    padding: const EdgeInsets.only(bottom: 20),
    child: *Active Page View Here*
),
Bryan
  • 747
  • 1
  • 7
  • 19
  • i want add padding to active page not all page – Mohsen Farshid Jan 10 '20 at 21:14
  • Then in that case, replace child with the component that is active (similar to the image provided in the question). – Bryan Jan 10 '20 at 21:17
  • how to detect active page – Mohsen Farshid Jan 10 '20 at 21:23
  • That will depend on how you've programmed your application and how you manage all these page views. It may be possible to maintain a variable (boolean) for each page view that becomes true when that page becomes active ... and then use conditional code in Flutter to detect and add Padding automatically. – Bryan Jan 10 '20 at 21:25
  • if I add padding to it,all pages will have padding and I just want it on my active page and the left and right pages shouldn't have alternation.I want those to stay in that case that they were. – Mohsen Farshid Jan 10 '20 at 21:37
  • Yeah I understand. To solve this, you should maintain a variable like `isActive` for each page and then only add padding if `isActive` is `true`. This way, only the active page will have padding. – Bryan Jan 10 '20 at 21:40