implemented comprehensive accessibility (A11y) support across the app
This commit is contained in:
@@ -1,24 +1,43 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'a11y/a11y_labels.dart';
|
||||
|
||||
class AppProgressIndicator extends StatelessWidget {
|
||||
final double size;
|
||||
final double strokeWidth;
|
||||
final Color? color;
|
||||
final String semanticsLabel;
|
||||
|
||||
const AppProgressIndicator._({
|
||||
required this.size,
|
||||
required this.strokeWidth,
|
||||
this.color,
|
||||
this.semanticsLabel = A11yLabels.loading,
|
||||
});
|
||||
|
||||
const AppProgressIndicator.small({Color? color})
|
||||
: this._(size: 16, strokeWidth: 2, color: color);
|
||||
const AppProgressIndicator.small({Color? color, String? semanticsLabel})
|
||||
: this._(
|
||||
size: 16,
|
||||
strokeWidth: 2,
|
||||
color: color,
|
||||
semanticsLabel: semanticsLabel ?? A11yLabels.loading,
|
||||
);
|
||||
|
||||
const AppProgressIndicator.medium({Color? color})
|
||||
: this._(size: 24, strokeWidth: 2.5, color: color);
|
||||
const AppProgressIndicator.medium({Color? color, String? semanticsLabel})
|
||||
: this._(
|
||||
size: 24,
|
||||
strokeWidth: 2.5,
|
||||
color: color,
|
||||
semanticsLabel: semanticsLabel ?? A11yLabels.loading,
|
||||
);
|
||||
|
||||
const AppProgressIndicator.large({Color? color})
|
||||
: this._(size: 40, strokeWidth: 3, color: color);
|
||||
const AppProgressIndicator.large({Color? color, String? semanticsLabel})
|
||||
: this._(
|
||||
size: 40,
|
||||
strokeWidth: 3,
|
||||
color: color,
|
||||
semanticsLabel: semanticsLabel ?? A11yLabels.loading,
|
||||
);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -29,6 +48,7 @@ class AppProgressIndicator extends StatelessWidget {
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: strokeWidth,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(resolved),
|
||||
semanticsLabel: semanticsLabel,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user