cpd_2022_zi/lib/widgets/workout_form.dart

37 lines
1.1 KiB
Dart
Raw Normal View History

2023-03-03 13:44:17 +01:00
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
2023-03-04 12:14:29 +01:00
import 'package:smoke_cess_app/providers/audio_provider.dart';
import '../providers/timer_provider.dart';
import '../providers/workout_provider.dart';
2023-03-03 13:44:17 +01:00
import 'mute_button.dart';
import 'workout_timer_widget.dart';
class WorkoutForm extends StatelessWidget {
2023-03-04 12:14:29 +01:00
WorkoutForm({super.key});
final TimerProvider timerProvider = TimerProvider();
final AudioProvider audioProvider = AudioProvider();
2023-03-03 13:44:17 +01:00
@override
Widget build(BuildContext context) {
return MultiProvider(
providers: [
ChangeNotifierProvider(create: (context) => timerProvider),
2023-03-04 12:14:29 +01:00
ChangeNotifierProvider(create: (context) => audioProvider),
ChangeNotifierProvider(
2023-03-04 12:14:29 +01:00
create: (context) =>
WorkoutProvider(timerProvider, audioProvider)),
],
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const [
Align(
alignment: Alignment.topLeft,
child: MuteButton(),
),
WorkoutTimerWidget()
],
));
2023-03-03 13:44:17 +01:00
}
}