mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-04-22 08:09:22 -04:00
37 lines
1.2 KiB
Dart
37 lines
1.2 KiB
Dart
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;
|
|
}
|