Adaptive app bar leading

This commit is contained in:
2024-07-12 22:37:58 +08:00
parent a2db9a7ae4
commit 156e6f1075
14 changed files with 19 additions and 13 deletions

View File

@@ -4,6 +4,12 @@ import 'package:solian/shells/root_shell.dart';
class AppBarLeadingButton extends StatelessWidget {
const AppBarLeadingButton({super.key});
static Widget? adaptive(BuildContext context) {
final hasContent =
Navigator.canPop(context) || rootScaffoldKey.currentState!.hasDrawer;
return hasContent ? const AppBarLeadingButton() : null;
}
@override
Widget build(BuildContext context) {
if (Navigator.canPop(context)) {