calorimeter/lib/utils/row_with_spacers_widget.dart
Marco 2509c1721c Overhaul ui and remove BackButtonListener
1. Make EnterFoodWidget animated
2. Fix exception when reading quantity for a food.

Introduce first integration test
2025-01-05 17:25:34 +01:00

68 lines
1.9 KiB
Dart

/* SPDX-License-Identifier: GPL-3.0-or-later */
/* Copyright (C) 2024 Marco Groß <mgross@sw-gross.de> */
import 'package:flutter/material.dart';
class RowWidget extends StatelessWidget {
final Widget? widget1;
final Widget? widget2;
final Widget? widget3;
final Widget? widget4;
final bool showDividers;
const RowWidget(this.widget1, this.widget2, this.widget3, this.widget4,
{super.key, required this.showDividers});
@override
Widget build(BuildContext context) {
return IntrinsicHeight(
child: ConstrainedBox(
constraints: BoxConstraints(minHeight: 48),
child: Row(
children: [
Expanded(
flex: 10,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: widget1 ?? Container(),
),
),
Opacity(
opacity: showDividers ? 1.0 : 0.0,
child: VerticalDivider(),
),
Expanded(
flex: 6,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: widget2 ?? Container(),
),
),
Opacity(
opacity: showDividers ? 1.0 : 0.0,
child: VerticalDivider(),
),
Expanded(
flex: 6,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: widget3 ?? Container(),
),
),
Opacity(
opacity: showDividers ? 1.0 : 0.0,
child: VerticalDivider(),
),
Expanded(
flex: 6,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 4.0),
child: widget4 ?? Container(),
),
),
],
),
),
);
}
}