Fab color dynamic based on primary color

This commit is contained in:
Juan Gilsanz Polo 2022-10-26 14:26:31 +02:00
parent ddb9130769
commit 2816448ee2
8 changed files with 32 additions and 8 deletions

View file

@ -24,7 +24,10 @@ class HomeFab extends StatelessWidget {
return serversProvider.serverStatus.loadStatus == 1
? FloatingActionButton(
onPressed: openManagementBottomSheet,
child: const Icon(Icons.shield_rounded),
child: Icon(
Icons.shield_rounded,
color: Theme.of(context).primaryColor.computeLuminance() > 0.5 ? Colors.black : Colors.white,
),
)
: const SizedBox();
}