import 'package:flutter/material.dart'; class RowWidgetWithSpacers extends StatefulWidget { final Widget? widget1; final Widget? widget2; final Widget? widget3; final Widget? widget4; final Widget? widget5; const RowWidgetWithSpacers( this.widget1, this.widget2, this.widget3, this.widget4, this.widget5, {super.key}); @override State createState() => _RowWidgetWithSpacersState(); } class _RowWidgetWithSpacersState extends State { @override Widget build(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( flex: 5, child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), child: widget.widget1 ?? Container(), )), Expanded( flex: 5, child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), child: widget.widget2 ?? Container(), )), Expanded( flex: 5, child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), child: widget.widget3 ?? Container(), )), Expanded( flex: 5, child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), child: widget.widget4 ?? Container(), )), Expanded( flex: 5, child: Padding( padding: const EdgeInsets.symmetric(vertical: 2.0, horizontal: 2.0), child: widget.widget5 ?? Container(), )), ], ); } }