diff --git a/lib/api/twitch_api.dart b/lib/api/twitch_api.dart index d9888365..a72a8d52 100644 --- a/lib/api/twitch_api.dart +++ b/lib/api/twitch_api.dart @@ -264,7 +264,7 @@ class TwitchApi { if (userData.isNotEmpty) { return UserTwitch.fromJson(userData.first); } else { - return Future.error('User does not exist'); + return Future.error('User does not exist!'); } } else { return Future.error('Failed to get user: ${decoded['message']}'); @@ -422,7 +422,7 @@ class TwitchApi { return []; } } else { - return Future.error('User does not exist'); + return Future.error('User does not exist!'); } } diff --git a/lib/main.dart b/lib/main.dart index 6fd9dd73..9e4935b9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -89,7 +89,7 @@ class MyApp extends StatelessWidget { titleTextStyle: TextStyle( fontFamily: 'Inter', fontSize: 24, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w800, color: Colors.black, ), iconTheme: IconThemeData(color: Colors.black), @@ -116,7 +116,7 @@ class MyApp extends StatelessWidget { titleTextStyle: const TextStyle( fontFamily: 'Inter', fontSize: 24, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w800, ), ), colorScheme: ColorScheme.fromSwatch( @@ -138,7 +138,7 @@ class MyApp extends StatelessWidget { titleTextStyle: TextStyle( fontFamily: 'Inter', fontSize: 24, - fontWeight: FontWeight.bold, + fontWeight: FontWeight.w800, ), ), colorScheme: ColorScheme.fromSwatch( diff --git a/lib/screens/channel/video_chat.dart b/lib/screens/channel/video_chat.dart index 6adc4ba3..7c12646f 100644 --- a/lib/screens/channel/video_chat.dart +++ b/lib/screens/channel/video_chat.dart @@ -125,7 +125,7 @@ class _VideoChatState extends State { final appBar = AppBar( title: Text( regexEnglish.hasMatch(_chatStore.displayName) ? _chatStore.displayName : _chatStore.displayName + ' (${_chatStore.channelName})', - style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + style: const TextStyle(fontSize: 20), ), actions: [ IconButton( diff --git a/lib/screens/home/home.dart b/lib/screens/home/home.dart index d8b5a237..db0eaf3f 100644 --- a/lib/screens/home/home.dart +++ b/lib/screens/home/home.dart @@ -37,12 +37,7 @@ class _HomeState extends State { 'Search', ]; - return Text( - titles[_homeStore.selectedIndex], - style: const TextStyle( - fontWeight: FontWeight.w800, - ), - ); + return Text(titles[_homeStore.selectedIndex]); }, ), actions: [ diff --git a/lib/screens/home/search/search.dart b/lib/screens/home/search/search.dart index 455ae646..c88a9098 100644 --- a/lib/screens/home/search/search.dart +++ b/lib/screens/home/search/search.dart @@ -37,7 +37,7 @@ class _SearchState extends State { autocorrect: false, decoration: InputDecoration( isDense: true, - hintText: 'Search for a channel or category', + hintText: 'Find a channel or category', contentPadding: const EdgeInsets.all(10.0), border: const OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(15.0)), @@ -64,12 +64,10 @@ class _SearchState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ if (_searchStore.searchHistory.isNotEmpty) - const Padding( - padding: EdgeInsets.all(15.0), - child: Text( - 'HISTORY', - style: TextStyle(fontWeight: FontWeight.bold), - ), + const SectionHeader( + 'History', + padding: headerPadding, + fontWeight: FontWeight.bold, ), Expanded( child: ListView( @@ -105,6 +103,7 @@ class _SearchState extends State { child: SectionHeader( 'Channels', padding: headerPadding, + fontWeight: FontWeight.bold, ), ), SearchResultsChannels( @@ -115,6 +114,7 @@ class _SearchState extends State { child: SectionHeader( 'Categories', padding: headerPadding, + fontWeight: FontWeight.bold, ), ), SearchResultsCategories(searchStore: _searchStore), diff --git a/lib/screens/home/top/category_streams.dart b/lib/screens/home/top/category_streams.dart index 5bc4d42c..6ff0f976 100644 --- a/lib/screens/home/top/category_streams.dart +++ b/lib/screens/home/top/category_streams.dart @@ -63,7 +63,7 @@ class CategoryStreams extends StatelessWidget { centerTitle: true, title: Text( listStore.categoryInfo!.name, - style: Theme.of(context).textTheme.headline6?.copyWith(fontWeight: FontWeight.bold), + style: Theme.of(context).textTheme.headline6?.copyWith(fontWeight: FontWeight.w800), maxLines: 1, overflow: TextOverflow.ellipsis, ), diff --git a/lib/screens/settings/sections/account_settings.dart b/lib/screens/settings/sections/account_settings.dart index 1d0f5f88..a96ef206 100644 --- a/lib/screens/settings/sections/account_settings.dart +++ b/lib/screens/settings/sections/account_settings.dart @@ -1,9 +1,11 @@ import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:frosty/constants/constants.dart'; import 'package:frosty/core/auth/auth_store.dart'; import 'package:frosty/screens/settings/stores/settings_store.dart'; -import 'package:frosty/screens/settings/widgets/blocked_users.dart'; +import 'package:frosty/widgets/block_button.dart'; import 'package:webview_flutter/webview_flutter.dart'; class AccountSettings extends StatelessWidget { @@ -178,7 +180,10 @@ class ProfileCard extends StatelessWidget { leading: CircleAvatar( foregroundImage: CachedNetworkImageProvider(authStore.user.details!.profileImageUrl), ), - title: Text(authStore.user.details!.displayName), + title: Text( + authStore.user.details!.displayName, + style: const TextStyle(fontWeight: FontWeight.w600), + ), trailing: OutlinedButton.icon( onPressed: () => _showLogoutDialog(context), icon: const Icon(Icons.logout_outlined), @@ -206,3 +211,51 @@ class ProfileCard extends StatelessWidget { ); } } + +class BlockedUsers extends StatelessWidget { + final AuthStore authStore; + + const BlockedUsers({ + Key? key, + required this.authStore, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: const Text('Blocked Users'), + ), + body: RefreshIndicator( + onRefresh: () async { + HapticFeedback.lightImpact(); + await authStore.user.refreshBlockedUsers(headers: authStore.headersTwitch); + }, + child: Observer( + builder: (context) { + if (authStore.user.blockedUsers.isEmpty) { + return const Center( + child: Text('You don\'t have any blocked users.'), + ); + } + return ListView( + children: authStore.user.blockedUsers.map( + (user) { + final displayName = regexEnglish.hasMatch(user.displayName) ? user.displayName : user.displayName + ' (${user.userLogin})'; + return ListTile( + title: Text(displayName), + trailing: BlockButton( + authStore: authStore, + targetUser: displayName, + targetUserId: user.userId, + ), + ); + }, + ).toList(), + ); + }, + ), + ), + ); + } +} diff --git a/lib/screens/settings/sections/chat_settings.dart b/lib/screens/settings/sections/chat_settings.dart index 262d9591..540b81e9 100644 --- a/lib/screens/settings/sections/chat_settings.dart +++ b/lib/screens/settings/sections/chat_settings.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:frosty/constants/constants.dart'; import 'package:frosty/screens/settings/stores/settings_store.dart'; +import 'package:frosty/widgets/section_header.dart'; class ChatSettings extends StatefulWidget { final SettingsStore settingsStore; @@ -83,13 +84,7 @@ class _ChatSettingsState extends State { ), ), const SizedBox(height: 10.0), - const Padding( - padding: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 5.0), - child: Text( - 'Message Appearance', - style: TextStyle(fontWeight: FontWeight.w600, fontSize: 18.0), - ), - ), + const SectionHeader('Message Appearance'), ExpansionTile( title: const Text( 'Preview', diff --git a/lib/screens/settings/settings.dart b/lib/screens/settings/settings.dart index 860fbe22..cb595322 100644 --- a/lib/screens/settings/settings.dart +++ b/lib/screens/settings/settings.dart @@ -21,10 +21,7 @@ class Settings extends StatelessWidget { Widget build(BuildContext context) { return Scaffold( appBar: AppBar( - title: const Text( - 'Settings', - style: TextStyle(fontWeight: FontWeight.w800), - ), + title: const Text('Settings'), actions: [ if (Platform.isAndroid) IconButton( diff --git a/lib/screens/settings/widgets/blocked_users.dart b/lib/screens/settings/widgets/blocked_users.dart deleted file mode 100644 index 27d09db8..00000000 --- a/lib/screens/settings/widgets/blocked_users.dart +++ /dev/null @@ -1,54 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:flutter_mobx/flutter_mobx.dart'; -import 'package:frosty/constants/constants.dart'; -import 'package:frosty/core/auth/auth_store.dart'; -import 'package:frosty/widgets/block_button.dart'; - -class BlockedUsers extends StatelessWidget { - final AuthStore authStore; - - const BlockedUsers({ - Key? key, - required this.authStore, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: const Text('Blocked Users'), - ), - body: RefreshIndicator( - onRefresh: () async { - HapticFeedback.lightImpact(); - await authStore.user.refreshBlockedUsers(headers: authStore.headersTwitch); - }, - child: Observer( - builder: (context) { - if (authStore.user.blockedUsers.isEmpty) { - return const Center( - child: Text('You don\'t have any blocked users.'), - ); - } - return ListView( - children: authStore.user.blockedUsers.map( - (user) { - final displayName = regexEnglish.hasMatch(user.displayName) ? user.displayName : user.displayName + ' (${user.userLogin})'; - return ListTile( - title: Text(displayName), - trailing: BlockButton( - authStore: authStore, - targetUser: displayName, - targetUserId: user.userId, - ), - ); - }, - ).toList(), - ); - }, - ), - ), - ); - } -} diff --git a/lib/widgets/section_header.dart b/lib/widgets/section_header.dart index 8c407653..34e76224 100644 --- a/lib/widgets/section_header.dart +++ b/lib/widgets/section_header.dart @@ -4,12 +4,14 @@ class SectionHeader extends StatelessWidget { final String text; final EdgeInsets padding; final double fontSize; + final FontWeight fontWeight; const SectionHeader( this.text, { Key? key, this.padding = const EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 5.0), this.fontSize = 18.0, + this.fontWeight = FontWeight.w600, }) : super(key: key); @override @@ -20,7 +22,7 @@ class SectionHeader extends StatelessWidget { text, style: TextStyle( fontSize: fontSize, - fontWeight: FontWeight.bold, + fontWeight: fontWeight, ), ), );