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 createState() => _MyHomePageState(); } // Baut Page auf class _MyHomePageState extends State { 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()], ), ))); } }