In the flutter, I have a very complex widget and its working fine. but for the different part of the app, I want to slightly modify the widget,
To achieve that I have to copy the entire widget with a different name and add the modification,
instead of copying, can we create a new widget with inheriting the widget and overriding widget in flutter?
ex:- consider I have this widget:
class ParentWidget extends StatefulWidget {
@override
_ParentWidgetState createState() => _ParentWidgetState();
}
class _ParentWidgetState extends State<ParentWidget> {
@override
Widget build(BuildContext context) {
return Container(
);
}
}
and I want to create child widget ex:-
class ChildWidget extends ParentWidget {
}
where I should we able to modify all the aspects of the parent widget.