cpd_2022_energy/lib/main.dart

55 lines
1.2 KiB
Dart

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> {
@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()],
),
)));
}
}