4

This question is related to the following StackOverflow issue: bottom sheet with initial height half of screen and if it scroll then height is increase to full screen

It is about a constraint that is set within the Flutter code about bottom sheets, that I do not want to have. I understand the solution mentioned in the link above, but I don't know how to implement it in a nice way.

Right now my 'solution' is to completely copy the bottom_sheet.dart file from the official Flutter codebase and remove just the line 169 with the maxHeight property: https://github.com/flutter/flutter/blob/1ad538e454c77496fbd068b9e8b5f8b61c2f6d96/packages/flutter/lib/src/material/bottom_sheet.dart#L169

Any ideas to do this in a more elegant way?

Thanks!

Menno
  • 135
  • 1
  • 5
  • There are some widgets which are given some initial properties by Flutter team so that they expose similar look and feel. Like a SliverAppBar will always give 72 padding from the left to the title, etc. So, if you want to change that then you have to do it in source code. However many of the widgets have their property too that you can modify but not all the widgets have this advantage – CopsOnRoad Oct 31 '18 at 13:26

1 Answers1

3

You can't. You have to clone the sources if you want to make a change to them.

This is partially voluntary. Flutter is purposefully designed to easily let you copy the sources and make some changes.


If that's too bad of a solution, you can instead fork flutter.

Flutter is very easy to fork, as the installation process is nothing but a simple git clone:

Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432
  • am trying to edit FlexibleSpaceBar when i copy its class and try to run only without edit it it's give me 'you have to wrap it by FlexibleSpaceBar.createrSetting' when i wrap it by this widget it's run but sliver app bar not do its functionality properly – Mohamed Gaber Dec 23 '19 at 08:14
  • yeah this solution is the way to go for now but what if i am trying to make a flutter package ? i then have to ship the entire code with one small change regarding one specific widget. There has to be other ways. – Abhishek Apr 28 '20 at 18:29