mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-08-11 07:30:17 -04:00
accessibility work
This commit is contained in:
parent
be8014c97a
commit
de691cd778
48 changed files with 862 additions and 551 deletions
36
lib/theme/views/styled_widgets/styled_scaffold.dart
Normal file
36
lib/theme/views/styled_widgets/styled_scaffold.dart
Normal file
|
@ -0,0 +1,36 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../theme.dart';
|
||||
|
||||
class StyledScaffold extends StatelessWidget {
|
||||
const StyledScaffold({required this.appBar, required this.body, super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final scaleScheme = theme.extension<ScaleScheme>()!;
|
||||
final scaleConfig = theme.extension<ScaleConfig>()!;
|
||||
final scale = scaleScheme.scale(ScaleKind.primary);
|
||||
|
||||
const enableBorder = false; //!isMobileSize(context);
|
||||
|
||||
var scaffold = clipBorder(
|
||||
clipEnabled: enableBorder,
|
||||
borderEnabled: scaleConfig.useVisualIndicators,
|
||||
borderRadius: 16 * scaleConfig.borderRadiusScale,
|
||||
borderColor: scale.border,
|
||||
child: Scaffold(appBar: appBar, body: body, key: key));
|
||||
|
||||
if (!scaleConfig.useVisualIndicators) {
|
||||
scaffold = scaffold.withThemedShadow(scaleConfig, scale);
|
||||
}
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () => FocusManager.instance.primaryFocus?.unfocus(),
|
||||
child: scaffold /*.paddingAll(enableBorder ? 32 : 0) */);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
final PreferredSizeWidget? appBar;
|
||||
final Widget? body;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue