mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 20:57:36 +02:00
fix: Add back button on app bars of secondary views
This commit is contained in:
@ -4,12 +4,14 @@ class CustomSliverAppBar extends StatelessWidget {
|
||||
final Widget title;
|
||||
final List<Widget>? actions;
|
||||
final PreferredSizeWidget? bottom;
|
||||
final bool isMainView;
|
||||
|
||||
const CustomSliverAppBar({
|
||||
Key? key,
|
||||
required this.title,
|
||||
this.actions,
|
||||
this.bottom,
|
||||
this.isMainView = false,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
@ -19,16 +21,28 @@ class CustomSliverAppBar extends StatelessWidget {
|
||||
snap: false,
|
||||
floating: false,
|
||||
expandedHeight: 100.0,
|
||||
automaticallyImplyLeading: false,
|
||||
automaticallyImplyLeading: !isMainView,
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
titlePadding: EdgeInsets.only(
|
||||
bottom: 14.0,
|
||||
left: isMainView ? 20.0 : 55.0,
|
||||
),
|
||||
title: title,
|
||||
),
|
||||
leading: isMainView
|
||||
? null
|
||||
: IconButton(
|
||||
icon: Icon(
|
||||
Icons.arrow_back,
|
||||
color: Theme.of(context).textTheme.headline6!.color,
|
||||
),
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
),
|
||||
backgroundColor: MaterialStateColor.resolveWith(
|
||||
(states) => states.contains(MaterialState.scrolledUnder)
|
||||
? Theme.of(context).colorScheme.surface
|
||||
: Theme.of(context).canvasColor,
|
||||
),
|
||||
flexibleSpace: FlexibleSpaceBar(
|
||||
titlePadding: const EdgeInsets.only(bottom: 16.0, left: 20.0),
|
||||
title: title,
|
||||
),
|
||||
actions: actions,
|
||||
bottom: bottom,
|
||||
);
|
||||
|
Reference in New Issue
Block a user