cpd_2022_energy/lib/energy_app.dart

47 lines
1.1 KiB
Dart

import 'package:cpd_2022_energy/widgets/input_widget.dart';
import 'package:cpd_2022_energy/widgets/output_card_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:cpd_2022_energy/provider/energy_model.dart';
void main() {
runApp(const EnergyCalculationApp());
}
class EnergyCalculationApp extends StatelessWidget {
const EnergyCalculationApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Energy Calculation App',
theme: ThemeData(
brightness: Brightness.dark,
),
home: const EnergyCalculation(),
);
}
}
class EnergyCalculation extends StatelessWidget {
const EnergyCalculation({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('Energy Calculation App'),
),
body: ChangeNotifierProvider(
create: (context) => EnergyModel(),
child: Column(
children: const [
InputWidget(),
OutputCardWidget(),
],
),
),
);
}
}