Thank you for aiding me.
What I'm trying to do is cut down on repeat of the code below;
class PeddingRadius extends StatelessWidget {
PeddingRadius(final column);
@override
Widget build(BuildContext context) {
Container(
padding: const EdgeInsets.all(8.0),
child: Material(
borderRadius: BorderRadius.circular(30),
shadowColor: Colors.grey.shade100,
elevation: 5,
child: //my code
),
)
}
}
Is there a way I could make above a function or method and insert the code below?
Image.asset(
'asset/images/HelloWorld.png', height: 100.0, width: 100.0,
),
Text('Hello World, form Dart'),
You can just use a function to return your code as a Widget
then just use
myWidget('asset/images/HelloWorld.png', 'Hello World, form Dart')