cpd_2022_energy/lib/energy_app.dart

47 lines
1.1 KiB
Dart
Raw Permalink Normal View History

2023-02-06 03:12:39 +01:00
import 'package:cpd_2022_energy/widgets/input_widget.dart';
2023-02-05 21:46:05 +01:00
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 [
2023-02-06 03:12:39 +01:00
InputWidget(),
2023-02-05 21:46:05 +01:00
OutputCardWidget(),
],
),
),
);
}
}