calorimeter/lib/row_with_spacers_widget.dart
2024-06-10 03:31:06 +02:00

64 lines
1.8 KiB
Dart

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) {
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(),
)),
],
),
);
}
}