cpd_2022_energy/lib/main.dart

58 lines
1.2 KiB
Dart
Raw Normal View History

2022-11-08 14:26:40 +01:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:cpd_2022_energy/variables.dart';
import 'package:cpd_2022_energy/inputForm.dart';
import 'ergebnis.dart';
void main() {
runApp(const MyApp());
}
// Baut Hauptpage
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Energiebilanz',
theme: ThemeData(
primarySwatch: Colors.green,
),
home: const MyHomePage(title: 'Energiebilanz'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
// Baut Page auf
class _MyHomePageState extends State<MyHomePage> {
void _ergebnisRechner() {
setState(() {});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: ChangeNotifierProvider(
create: (context) => variables(),
child: Center(
child: Column(
children: const [InputForm(), Ergebnis()],
),
)));
}
}