cpd_2022_energy/lib/main.dart

38 lines
1.2 KiB
Dart

import 'package:energy_bilance/models/EnergyBilanceModel.dart';
import 'package:energy_bilance/models/MyInputModel.dart';
import 'package:energy_bilance/widgets/MyCustomForm.dart';
import 'package:energy_bilance/widgets/MyInputWidget.dart';
import 'package:energy_bilance/widgets/MyTest.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
void main() {
runApp(
MaterialApp(
title: 'My App',
home: Scaffold(
body: ChangeNotifierProvider(
create: (context) => EnergyBilanceModel(),
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Expanded(child: MyInputWidget()),
Expanded(
child: Consumer<EnergyBilanceModel>(
builder: (context, model, child){
return Text('Generierte Ekin: ${model.kineticEnergy}');
}
))
],
)
),
),
)
)
);
}