From 037ca5629f7ed013dba0951cbb618ef06296ea90 Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Thu, 10 Feb 2022 11:35:09 -0500 Subject: [PATCH] Tweak block/report buttons --- .../channel/chat/widgets/chat_user_modal.dart | 2 +- lib/screens/home/widgets/stream_card.dart | 16 +++++++--------- lib/screens/settings/widgets/profile_card.dart | 2 -- lib/widgets/block_button.dart | 5 +++-- lib/widgets/block_report_modal.dart | 9 ++++++++- lib/widgets/report_button.dart | 5 +++-- 6 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lib/screens/channel/chat/widgets/chat_user_modal.dart b/lib/screens/channel/chat/widgets/chat_user_modal.dart index c219cb81..d43705c9 100644 --- a/lib/screens/channel/chat/widgets/chat_user_modal.dart +++ b/lib/screens/channel/chat/widgets/chat_user_modal.dart @@ -53,7 +53,7 @@ class ChatUserModal extends StatelessWidget { userId: userId, ), ), - icon: const Icon(Icons.report), + icon: Icon(Icons.adaptive.more), ), ], ), diff --git a/lib/screens/home/widgets/stream_card.dart b/lib/screens/home/widgets/stream_card.dart index 69e93b8b..f06b35a9 100644 --- a/lib/screens/home/widgets/stream_card.dart +++ b/lib/screens/home/widgets/stream_card.dart @@ -99,15 +99,13 @@ class StreamCard extends StatelessWidget { radius: 10.0, ), const SizedBox(width: 5.0), - Expanded( - child: Tooltip( - message: streamerName, - preferBelow: false, - child: Text( - streamerName, - style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), - overflow: TextOverflow.ellipsis, - ), + Tooltip( + message: streamerName, + preferBelow: false, + child: Text( + streamerName, + style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + overflow: TextOverflow.ellipsis, ), ), ], diff --git a/lib/screens/settings/widgets/profile_card.dart b/lib/screens/settings/widgets/profile_card.dart index cbe8af5f..489a8333 100644 --- a/lib/screens/settings/widgets/profile_card.dart +++ b/lib/screens/settings/widgets/profile_card.dart @@ -2,7 +2,6 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:frosty/core/auth/auth_store.dart'; -import 'package:intl/intl.dart'; class ProfileCard extends StatelessWidget { final AuthStore authStore; @@ -95,7 +94,6 @@ class ProfileCard extends StatelessWidget { foregroundImage: CachedNetworkImageProvider(authStore.user.details!.profileImageUrl), ), title: Text(authStore.user.details!.displayName), - subtitle: Text('Joined on ${DateFormat.yMMMd().format(DateTime.parse(authStore.user.details!.createdAt))}'), trailing: OutlinedButton( onPressed: () => _showLogoutDialog(context), child: const Text('Log Out'), diff --git a/lib/widgets/block_button.dart b/lib/widgets/block_button.dart index 8f12c688..aa83265d 100644 --- a/lib/widgets/block_button.dart +++ b/lib/widgets/block_button.dart @@ -60,8 +60,9 @@ class BlockButton extends StatelessWidget { builder: (context) { final isBlocked = authStore.user.blockedUsers.where((blockedUser) => blockedUser.userId == targetUserId).isNotEmpty; - return OutlinedButton( - child: isBlocked ? Text(simple ? 'Unblock' : 'Unblock $targetUser') : Text(simple ? 'Block' : 'Block $targetUser'), + return OutlinedButton.icon( + icon: const Icon(Icons.block), + label: isBlocked ? Text(simple ? 'Unblock' : 'Unblock $targetUser') : Text(simple ? 'Block' : 'Block $targetUser'), onPressed: () => _showDialog( context, isBlocked: isBlocked, diff --git a/lib/widgets/block_report_modal.dart b/lib/widgets/block_report_modal.dart index 91dfd7c9..9b4b02cf 100644 --- a/lib/widgets/block_report_modal.dart +++ b/lib/widgets/block_report_modal.dart @@ -1,4 +1,4 @@ -import 'package:flutter/widgets.dart'; +import 'package:flutter/material.dart'; import 'package:frosty/core/auth/auth_store.dart'; import 'package:frosty/widgets/block_button.dart'; import 'package:frosty/widgets/report_button.dart'; @@ -23,6 +23,13 @@ class BlockReportModal extends StatelessWidget { child: Column( mainAxisSize: MainAxisSize.min, children: [ + const SizedBox( + width: 50.0, + child: Divider( + height: 25.0, + thickness: 3.0, + ), + ), Container( padding: const EdgeInsets.symmetric(horizontal: 10.0), width: double.infinity, diff --git a/lib/widgets/report_button.dart b/lib/widgets/report_button.dart index b2d34aee..6d503b77 100644 --- a/lib/widgets/report_button.dart +++ b/lib/widgets/report_button.dart @@ -13,9 +13,10 @@ class ReportButton extends StatelessWidget { @override Widget build(BuildContext context) { - return OutlinedButton( + return OutlinedButton.icon( + icon: const Icon(Icons.report), onPressed: () => launch('https://www.twitch.tv/$userLogin/report'), - child: Text(name == null ? 'Report' : 'Report $name'), + label: Text(name == null ? 'Report' : 'Report $name'), style: OutlinedButton.styleFrom(primary: Colors.red), ); }