Files
umbrix/lib/features/common/custom_app_bar.dart

25 lines
608 B
Dart
Raw Normal View History

2023-07-06 17:18:41 +03:30
import 'package:flutter/material.dart';
abstract class RootScaffold {
static final stateKey = GlobalKey<ScaffoldState>();
}
class NestedTabAppBar extends SliverAppBar {
NestedTabAppBar({
super.key,
super.title,
super.actions,
super.pinned = true,
super.forceElevated,
super.bottom,
}) : super(
leading: RootScaffold.stateKey.currentState?.hasDrawer ?? false
? DrawerButton(
onPressed: () {
RootScaffold.stateKey.currentState?.openDrawer();
},
)
: null,
);
}