mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-04-05 22:09:38 +00:00
refactor(accessibility): simplify label handling
This commit is contained in:
parent
53f58aeb8b
commit
72333b7794
2 changed files with 31 additions and 11 deletions
|
|
@ -15,6 +15,8 @@ import 'package:vaani/shared/extensions/duration_format.dart';
|
|||
class SleepTimerButton extends HookConsumerWidget {
|
||||
const SleepTimerButton({super.key});
|
||||
|
||||
static const _sleepTimerLabel = 'Sleep timer';
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final sleepTimer = ref.watch(sleepTimerProvider);
|
||||
|
|
@ -23,10 +25,10 @@ class SleepTimerButton extends HookConsumerWidget {
|
|||
// if sleep timer is not active, show the button with the sleep timer icon
|
||||
// if the sleep timer is active, show the remaining time in a pill shaped container
|
||||
return Tooltip(
|
||||
message: 'Sleep Timer',
|
||||
message: _sleepTimerLabel,
|
||||
child: Semantics(
|
||||
button: true,
|
||||
label: 'Sleep timer',
|
||||
label: _sleepTimerLabel,
|
||||
child: InkWell(
|
||||
onTap: () async {
|
||||
appLogger.fine('Sleep Timer button pressed');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue