Files
Prisma/lib/shared/widgets/adaptive_scaffold.dart
T
RarDog d5916e01b5
Build and Release / Build Windows x64 (push) Has been cancelled
Build and Release / Build macOS (push) Has been cancelled
fix(artists): resolve double keyboard inset and white square bug during search (v3.5.2)
2026-09-05 13:16:00 +03:00

48 lines
1.3 KiB
Dart

import 'package:flutter/material.dart';
import '../../app/responsive.dart';
class AdaptiveScaffold extends StatelessWidget {
const AdaptiveScaffold({
required this.title,
required this.body,
this.titleWidget,
this.actions = const [],
this.floatingActionButton,
this.resizeToAvoidBottomInset = false,
super.key,
});
final String title;
final Widget? titleWidget;
final Widget body;
final List<Widget> actions;
final Widget? floatingActionButton;
final bool resizeToAvoidBottomInset;
@override
Widget build(BuildContext context) {
if (Responsive.isMobile(context)) {
return Scaffold(
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
appBar: AppBar(
title: titleWidget ?? Text(title),
actions: actions,
toolbarHeight: 52,
titleTextStyle: Theme.of(context).textTheme.titleLarge?.copyWith(
fontWeight: FontWeight.w700,
),
),
body: SafeArea(top: false, bottom: false, child: body),
floatingActionButton: floatingActionButton,
);
}
return Scaffold(
resizeToAvoidBottomInset: resizeToAvoidBottomInset,
appBar: AppBar(title: titleWidget ?? Text(title), actions: actions),
body: body,
floatingActionButton: floatingActionButton,
);
}
}