Icon changes and other improvements

This commit is contained in:
Juan Gilsanz Polo 2023-11-19 04:22:59 +01:00
parent 0e4f4c8eff
commit ea8b35a0a2
6 changed files with 54 additions and 62 deletions

View file

@ -77,7 +77,7 @@ class _FiltersTabsViewState extends State<FiltersTabsView> with TickerProviderSt
children: [
const Icon(Icons.verified_user_rounded),
const SizedBox(width: 8),
Text(AppLocalizations.of(context)!.whitelists,)
Text(AppLocalizations.of(context)!.whitelists)
],
),
),

View file

@ -26,11 +26,11 @@ class ListOptionsMenu extends StatelessWidget {
final String listType;
const ListOptionsMenu({
Key? key,
super.key,
required this.list,
required this.child,
required this.listType,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -29,7 +29,7 @@ class _EnableDisableSelectionModalState extends State<EnableDisableSelectionModa
title: Column(
children: [
Icon(
Icons.shield_rounded,
Icons.remove_moderator_rounded,
size: 24,
color: Theme.of(context).listTileTheme.iconColor
),

View file

@ -11,11 +11,11 @@ class SelectionResultModal extends StatelessWidget {
final SelectionResultMode mode;
const SelectionResultModal({
Key? key,
super.key,
required this.results,
required this.onClose,
required this.mode,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {
@ -27,7 +27,7 @@ class SelectionResultModal extends StatelessWidget {
Icon(
mode == SelectionResultMode.delete
? Icons.delete_rounded
: Icons.shield_rounded,
: Icons.remove_moderator_rounded,
size: 24,
color: Theme.of(context).listTileTheme.iconColor
),

View file

@ -17,9 +17,9 @@ class SelectionScreen extends StatefulWidget {
final bool isModal;
const SelectionScreen({
Key? key,
super.key,
required this.isModal
}) : super(key: key);
});
@override
State<SelectionScreen> createState() => _SelectionScreenState();
@ -168,13 +168,17 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
Row(
children: [
IconButton(
onPressed: enableDisableSelected,
icon: const Icon(Icons.shield_rounded),
onPressed: somethingSelected == true
? () => enableDisableSelected()
: null,
icon: const Icon(Icons.remove_moderator_rounded),
tooltip: AppLocalizations.of(context)!.enableDisableSelected,
),
const SizedBox(width: 8),
IconButton(
onPressed: deleteSelected,
onPressed: somethingSelected == true
? () => deleteSelected()
: null,
icon: const Icon(Icons.delete_rounded),
tooltip: AppLocalizations.of(context)!.deleteSelectedLists,
),
@ -270,7 +274,24 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
quantity: _selectedBlacklists.length
),
]
)
),
actions: [
IconButton(
onPressed: somethingSelected == true
? () => enableDisableSelected()
: null,
icon: const Icon(Icons.remove_moderator_rounded),
tooltip: AppLocalizations.of(context)!.enableDisableSelected,
),
IconButton(
onPressed: somethingSelected == true
? () => deleteSelected()
: null,
icon: const Icon(Icons.delete_rounded),
tooltip: AppLocalizations.of(context)!.deleteSelectedLists,
),
const SizedBox(width: 8),
],
),
)
];
@ -296,41 +317,7 @@ class _SelectionScreenState extends State<SelectionScreen> with TickerProviderSt
)
)
),
AnimatedPositioned(
duration: const Duration(milliseconds: 200),
curve: Curves.ease,
right: 16,
bottom: _isScrolled ? -150 : 16,
child: Column(
children: [
FloatingActionButton.small(
onPressed: somethingSelected == true
? () => enableDisableSelected()
: null,
tooltip: AppLocalizations.of(context)!.enableDisableSelected,
child: Icon(
Icons.shield_rounded,
color: somethingSelected == true
? Theme.of(context).colorScheme.onPrimaryContainer
: Theme.of(context).colorScheme.onPrimaryContainer.withOpacity(0.5),
),
),
const SizedBox(height: 16),
FloatingActionButton.small(
onPressed: somethingSelected == true
? () => deleteSelected()
: null,
tooltip: AppLocalizations.of(context)!.deleteSelected,
child: Icon(
Icons.delete_rounded,
color: somethingSelected == true
? Theme.of(context).colorScheme.onPrimaryContainer
: Theme.of(context).colorScheme.onPrimaryContainer.withOpacity(0.5),
),
),
],
),
)
],
),
);
@ -344,11 +331,10 @@ class _Tab extends StatelessWidget {
final int quantity;
const _Tab({
Key? key,
required this.icon,
required this.text,
required this.quantity
}) : super(key: key);
});
@override
Widget build(BuildContext context) {

View file

@ -8,9 +8,9 @@ class OptionsModal extends StatelessWidget {
final List<MenuOption> options;
const OptionsModal({
Key? key,
super.key,
required this.options,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {
@ -32,16 +32,22 @@ class OptionsModal extends StatelessWidget {
)
],
),
content: Column(
mainAxisSize: MainAxisSize.min,
children: options.map((opt) => CustomListTileDialog(
title: opt.title,
icon: opt.icon,
onTap: () {
Navigator.pop(context);
opt.action();
},
)).toList()
content: ConstrainedBox(
constraints: const BoxConstraints(
maxWidth: 400
),
child: SingleChildScrollView(
child: Wrap(
children: options.map((opt) => CustomListTileDialog(
title: opt.title,
icon: opt.icon,
onTap: () {
Navigator.pop(context);
opt.action();
},
)).toList()
),
),
),
actions: [
Row(