Skip to content

Commit

Permalink
added ability to reset the stopwatch
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Zhdanov committed Dec 26, 2024
1 parent 81fcbbe commit d572dcd
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
3 changes: 3 additions & 0 deletions lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@

"titleSelectFile": "Select Google Sheet File",

"textReset": "Reset",
"textSave": "Save",

"hintSelectFile": "tap to select a file"
}
35 changes: 9 additions & 26 deletions lib/measurement/widget/stop_watch_widget.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dart:async';

import 'package:chrono_sheet/generated/app_localizations.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

Expand Down Expand Up @@ -77,34 +78,16 @@ class StopWatchState extends ConsumerState<StopWatchWidget> {
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
ElevatedButton(
onPressed: () => {},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.green,
padding: EdgeInsets.symmetric(horizontal: 40, vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
child: Text(
"Start",
style: TextStyle(fontSize: 20),
),
ElevatedButton.icon(
onPressed: measurement != Duration.zero ? _reset : null,
icon: Icon(Icons.refresh),
label: Text(AppLocalizations.of(context).textReset),
),
SizedBox(width: 20),
ElevatedButton(
onPressed: () => {},
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey,
padding: EdgeInsets.symmetric(horizontal: 40, vertical: 15),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30),
),
),
child: Text(
"Reset",
style: TextStyle(fontSize: 20),
),
ElevatedButton.icon(
onPressed: () {},
icon: Icon(Icons.save),
label: Text(AppLocalizations.of(context).textSave)
),
],
)
Expand Down

0 comments on commit d572dcd

Please sign in to comment.