calorimeter/lib/row_with_spacers_widget.dart

64 lines
1.8 KiB
Dart
Raw Normal View History

2024-06-09 12:42:17 +00:00
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<RowWidgetWithSpacers> createState() => _RowWidgetWithSpacersState();
}
class _RowWidgetWithSpacersState extends State<RowWidgetWithSpacers> {
@override
Widget build(BuildContext context) {
2024-06-10 01:31:06 +00:00
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Expanded(
flex: 5,
child: Padding(
padding: const EdgeInsets.only(
left: 8.0,
right: 2.0,
),
child: widget.widget1 ?? Container(),
)),
Expanded(
flex: 5,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.0),
child: widget.widget2 ?? Container(),
)),
Expanded(
flex: 5,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.0),
child: widget.widget3 ?? Container(),
)),
Expanded(
flex: 5,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.0),
child: widget.widget4 ?? Container(),
)),
Expanded(
flex: 2,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 2.0),
child: widget.widget5 ?? Container(),
)),
],
),
2024-06-09 12:42:17 +00:00
);
}
}