Minor improvements on clients fab

This commit is contained in:
Juan Gilsanz Polo 2022-10-07 20:19:02 +02:00
parent 7ce291a34a
commit d115ec1b1a
3 changed files with 10 additions and 5 deletions

View file

@ -218,7 +218,7 @@ class AddedList extends StatelessWidget {
const Positioned( const Positioned(
bottom: 20, bottom: 20,
right: 20, right: 20,
child: ClientsFab(), child: ClientsFab(tab: 1),
), ),
], ],
); );

View file

@ -119,7 +119,7 @@ class BlockedList extends StatelessWidget {
const Positioned( const Positioned(
bottom: 20, bottom: 20,
right: 20, right: 20,
child: ClientsFab(), child: ClientsFab(tab: 2),
), ),
] ]
); );

View file

@ -15,7 +15,12 @@ import 'package:adguard_home_manager/providers/servers_provider.dart';
import 'package:adguard_home_manager/providers/app_config_provider.dart'; import 'package:adguard_home_manager/providers/app_config_provider.dart';
class ClientsFab extends StatelessWidget { class ClientsFab extends StatelessWidget {
const ClientsFab({Key? key}) : super(key: key); final int tab;
const ClientsFab({
Key? key,
required this.tab,
}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -126,13 +131,13 @@ class ClientsFab extends StatelessWidget {
); );
} }
if (appConfigProvider.selectedClientsTab == 1) { if (tab == 1) {
return FloatingActionButton( return FloatingActionButton(
onPressed: () => openAddClient(), onPressed: () => openAddClient(),
child: const Icon(Icons.add), child: const Icon(Icons.add),
); );
} }
else if (appConfigProvider.selectedClientsTab == 2) { else if (tab == 2) {
return FloatingActionButton( return FloatingActionButton(
onPressed: () => openBlockClient(), onPressed: () => openBlockClient(),
child: const Icon(Icons.add), child: const Icon(Icons.add),