nicer action buttons on user popover
This commit is contained in:
parent
5daa861a31
commit
e5b7512e79
1 changed files with 20 additions and 3 deletions
|
|
@ -79,6 +79,15 @@ class UserPopover extends ConsumerWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
final actionButton = ButtonStyle(
|
||||||
|
padding: WidgetStatePropertyAll(
|
||||||
|
EdgeInsets.symmetric(horizontal: 24, vertical: 18),
|
||||||
|
),
|
||||||
|
shape: WidgetStatePropertyAll(
|
||||||
|
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
spacing: 16,
|
spacing: 16,
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
|
@ -152,10 +161,16 @@ class UserPopover extends ConsumerWidget {
|
||||||
if (userId != ref.watch(ClientStateController.provider)?.userId &&
|
if (userId != ref.watch(ClientStateController.provider)?.userId &&
|
||||||
roomId != null)
|
roomId != null)
|
||||||
Wrap(
|
Wrap(
|
||||||
|
alignment: WrapAlignment.center,
|
||||||
spacing: 8,
|
spacing: 8,
|
||||||
runSpacing: 8,
|
runSpacing: 8,
|
||||||
children: [
|
children: [
|
||||||
FilledButton.icon(onPressed: null, label: Text("Message")),
|
FilledButton.icon(
|
||||||
|
onPressed: null,
|
||||||
|
label: Text("Message"),
|
||||||
|
icon: Icon(Icons.message),
|
||||||
|
style: actionButton,
|
||||||
|
),
|
||||||
|
|
||||||
if (ref.watch(
|
if (ref.watch(
|
||||||
PowerLevelController.provider(
|
PowerLevelController.provider(
|
||||||
|
|
@ -171,7 +186,7 @@ class UserPopover extends ConsumerWidget {
|
||||||
FilledButton.icon(
|
FilledButton.icon(
|
||||||
onPressed: () => showMembershipDialog(MembershipAction.kick),
|
onPressed: () => showMembershipDialog(MembershipAction.kick),
|
||||||
label: Text("Kick"),
|
label: Text("Kick"),
|
||||||
style: ButtonStyle(
|
style: actionButton.copyWith(
|
||||||
backgroundColor: WidgetStatePropertyAll(
|
backgroundColor: WidgetStatePropertyAll(
|
||||||
theme.colorScheme.error,
|
theme.colorScheme.error,
|
||||||
),
|
),
|
||||||
|
|
@ -179,6 +194,7 @@ class UserPopover extends ConsumerWidget {
|
||||||
theme.colorScheme.onError,
|
theme.colorScheme.onError,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
icon: Icon(Icons.sports_martial_arts),
|
||||||
),
|
),
|
||||||
if (ref.watch(
|
if (ref.watch(
|
||||||
PowerLevelController.provider(
|
PowerLevelController.provider(
|
||||||
|
|
@ -195,10 +211,11 @@ class UserPopover extends ConsumerWidget {
|
||||||
? MembershipAction.unban
|
? MembershipAction.unban
|
||||||
: MembershipAction.ban,
|
: MembershipAction.ban,
|
||||||
),
|
),
|
||||||
|
icon: Icon(Icons.gavel),
|
||||||
label: Text(
|
label: Text(
|
||||||
member.status == MembershipStatus.ban ? "Unban" : "Ban",
|
member.status == MembershipStatus.ban ? "Unban" : "Ban",
|
||||||
),
|
),
|
||||||
style: ButtonStyle(
|
style: actionButton.copyWith(
|
||||||
backgroundColor: WidgetStatePropertyAll(
|
backgroundColor: WidgetStatePropertyAll(
|
||||||
theme.colorScheme.errorContainer,
|
theme.colorScheme.errorContainer,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue