21 lines
634 B
Dart
21 lines
634 B
Dart
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)),
|
|
],
|
|
);
|
|
}
|
|
}
|