multipke widget in if flutter code example
Example 1: how to make reusable widget in flutter
Widget buildListContainer(BuildContext context,Widget list) {
return Container(
height: 300,
child: ,
);
}
Example 2: flutter inhereted widget
class MyInherited extends InheritedWidget {
const MyInherited({
Key key,
@required Widget child,
}) : super(key: key, child: child);
static MyInherited of(BuildContext context) {
return context.dependOnInheritedWidgetOfExactType<MyInherited>();
}
@override
bool updateShouldNotify(MyInherited old) => false;
}