Absolutely. Flutter’s widget system was designed to be easily customizable.
Rather than having each widget provide a large number of parameters, Flutter embraces composition. Widgets are built out of smaller widgets that you can reuse and combine in novel ways to make custom widgets. For example, rather than subclassing a generic button widget,ElevatedButtoncombines a Material widget with aGestureDetectorwidget. The Material widget provides the visual design and theGestureDetectorwidget provides the interaction design.
To create a button with a custom visual design, you can combine widgets that implement your visual design with aGestureDetector, which provides the interaction design. For example,CupertinoButtonfollows this approach and combines aGestureDetectorwith several other widgets that implement its visual design.
Composition gives you maximum control over the visual and interaction design of your widgets while also allowing a large amount of code reuse. In the framework, we’ve decomposed complex widgets to pieces that separately implement the visual, interaction, and motion design. You can remix these widgets however you like to make your own custom widgets that have full range of expression.
4. 결론
위 글들의 결론은 플러터에서 이미 만들어진 위젯(StatelessWidget 또는 StatefulWidget위젯을 이미 상속받은 위젯)의 기능을 추가하기 위해 위젯을 상속 받는것이 불가능한것은 아니지만 상속이 아닌 구성을 추천한다는 것이다.
이 방법이 익숙치는 않지만 mixin키워드와 같은 키워드와 더불어 원하는 위젯을 만드는데 어려움은 없어보인다