calorimeter/lib/row_with_spacers_widget.dart

33 lines
933 B
Dart
Raw Normal View History

2024-06-09 12:42:17 +00:00
import 'package:flutter/material.dart';
class RowWidget extends StatefulWidget {
2024-06-09 12:42:17 +00:00
final Widget? widget1;
final Widget? widget2;
final Widget? widget3;
final Widget? widget4;
final Widget? widget5;
const RowWidget(
2024-06-09 12:42:17 +00:00
this.widget1, this.widget2, this.widget3, this.widget4, this.widget5,
{super.key});
@override
State<RowWidget> createState() => _RowWidgetState();
2024-06-09 12:42:17 +00:00
}
class _RowWidgetState extends State<RowWidget> {
2024-06-09 12:42:17 +00:00
@override
Widget build(BuildContext context) {
return Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(flex: 10, child: widget.widget1 ?? Container()),
Expanded(flex: 6, child: widget.widget2 ?? Container()),
Expanded(flex: 6, child: widget.widget3 ?? Container()),
Expanded(flex: 8, child: widget.widget4 ?? Container()),
Expanded(flex: 3, child: widget.widget5 ?? Container()),
],
2024-06-09 12:42:17 +00:00
);
}
}