I have a ui.dart file and UIBuilder.class in it:
class UI {
static Widget buildButton(String text, VoidCallback onPressed, {double width, ...}) {
return SizedBox(
width: width,
child: RaisedButton(
...
onPressed: onPressed));
}
...
static Widget buildOtherWidget(...)
....
}
Then just call it in a lot of Screen/Page:
var btn = UI.buildButton(..);
Is it a bad pattern in flutter/dart? If yes, how can I change it?