2023-02-05 21:46:05 +01:00
|
|
|
import 'package:cpd_2022_energy/provider/energy_model.dart';
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
class OutputCardWidget extends StatelessWidget {
|
|
|
|
const OutputCardWidget({super.key});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Consumer<EnergyModel>(
|
|
|
|
builder: (context, model, child) => Card(
|
2023-02-06 03:12:39 +01:00
|
|
|
child: Column(children: <Widget>[
|
|
|
|
Text("Energy in Kilo Joule: ${model.totalEnergy.toStringAsFixed(2)}"),
|
|
|
|
Text('Water in Liter: ${model.boilingWaterAmount.toStringAsFixed(2)}'),
|
|
|
|
Text('Iron in Kilogram: ${model.annealingIronAmount.toStringAsFixed(2)}'),
|
2023-02-05 21:46:05 +01:00
|
|
|
])));
|
|
|
|
}
|
|
|
|
}
|