cpd_2022_zi/lib/widgets/timer_widget.dart

21 lines
634 B
Dart
Raw Permalink Normal View History

import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:smoke_cess_app/providers/timer_provider.dart';
import 'package:smoke_cess_app/utils/timer_util.dart';
class TimerWidget extends StatelessWidget {
final Duration duration;
const TimerWidget({super.key, required this.duration});
@override
Widget build(BuildContext context) {
TimerProvider timerProvider = context.watch<TimerProvider>();
return Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(formatTime(duration.inSeconds - timerProvider.elapsedSeconds)),
],
);
}
}