mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-13 13:07:38 +02:00
feat: Improve experience of rooted patched app installations (#59)
This commit is contained in:
36
lib/ui/widgets/shared/custom_popup_menu.dart
Normal file
36
lib/ui/widgets/shared/custom_popup_menu.dart
Normal file
@ -0,0 +1,36 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class CustomPopupMenu extends StatelessWidget {
|
||||
final Function(dynamic) onSelected;
|
||||
final Map<int, Widget> children;
|
||||
|
||||
const CustomPopupMenu({
|
||||
Key? key,
|
||||
required this.onSelected,
|
||||
required this.children,
|
||||
}) : super(key: key);
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Theme(
|
||||
data: Theme.of(context).copyWith(useMaterial3: false),
|
||||
child: PopupMenuButton<int>(
|
||||
onSelected: onSelected,
|
||||
itemBuilder: (context) => children.entries
|
||||
.map(
|
||||
(entry) => PopupMenuItem<int>(
|
||||
padding: const EdgeInsets.all(16.0).copyWith(right: 20),
|
||||
value: entry.key,
|
||||
child: entry.value,
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(24),
|
||||
),
|
||||
color: Theme.of(context).colorScheme.secondaryContainer,
|
||||
position: PopupMenuPosition.under,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -2,11 +2,13 @@ import 'package:flutter/material.dart';
|
||||
|
||||
class CustomSliverAppBar extends StatelessWidget {
|
||||
final Widget title;
|
||||
final List<Widget>? actions;
|
||||
final PreferredSizeWidget? bottom;
|
||||
|
||||
const CustomSliverAppBar({
|
||||
Key? key,
|
||||
required this.title,
|
||||
this.actions,
|
||||
this.bottom,
|
||||
}) : super(key: key);
|
||||
|
||||
@ -30,6 +32,7 @@ class CustomSliverAppBar extends StatelessWidget {
|
||||
),
|
||||
title: title,
|
||||
),
|
||||
actions: actions,
|
||||
bottom: bottom,
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user