Fix missing haptics on refresh & typos

This commit is contained in:
tommyxchow 2022-01-09 12:53:40 -05:00
parent 138697ab36
commit 91e07ef2e8
5 changed files with 17 additions and 7 deletions

View file

@ -18,11 +18,11 @@ import 'package:shared_preferences/shared_preferences.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
// Create and initialize the authenticatino store
// Create and initialize the authentication store
final authStore = AuthStore();
await authStore.init();
// Get the shared pereferences instance and obtain the existing user settings if it exists.
// Get the shared preferences instance and obtain the existing user settings if it exists.
// If default settings don't exist, use an empty JSON string to use the default values.
final preferences = await SharedPreferences.getInstance();
final userSettings = preferences.getString('settings') ?? '{}';
@ -30,7 +30,7 @@ Future<void> main() async {
// Initialize a settings store from the settings JSON string.
final settingsStore = SettingsStore.fromJson(jsonDecode(userSettings));
// Create a MobX reaction that will save the settings on disk everytime they are changed.
// Create a MobX reaction that will save the settings on disk every time they are changed.
autorun((_) => preferences.setString('settings', jsonEncode(settingsStore)));
await SentryFlutter.init(
@ -77,6 +77,7 @@ class MyApp extends StatelessWidget {
accentColor: Colors.deepPurpleAccent,
),
dialogBackgroundColor: Colors.grey.shade900,
toggleableActiveColor: Colors.deepPurpleAccent,
);
final oledTheme = ThemeData(
@ -98,6 +99,7 @@ class MyApp extends StatelessWidget {
accentColor: Colors.deepPurpleAccent,
),
dialogBackgroundColor: Colors.black,
toggleableActiveColor: Colors.deepPurpleAccent,
);
return Observer(

View file

@ -1,5 +1,6 @@
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:frosty/screens/channel/stores/chat_details_store.dart';
import 'package:frosty/widgets/loading_indicator.dart';
@ -84,7 +85,10 @@ class _ChattersListState extends State<ChattersList> {
),
Expanded(
child: RefreshIndicator(
onRefresh: () => chatDetailStore.updateChatters(widget.userLogin),
onRefresh: () async {
HapticFeedback.lightImpact();
await chatDetailStore.updateChatters(widget.userLogin);
},
child: Stack(
alignment: AlignmentDirectional.bottomCenter,
children: [

View file

@ -48,7 +48,7 @@ abstract class _ChatStoreBase with Store {
/// The assets store responsible for badges, emotes, and the emote menu.
final assetsStore = ChatAssetsStore();
/// Requested message to be sent by the user. Will only be sent on receival of a USERNOTICE command.
/// Requested message to be sent by the user. Will only be sent on receipt of a USERNOTICE command.
IRCMessage? toSend;
/// The list of chat messages to render and display.

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:frosty/core/auth/auth_store.dart';
import 'package:frosty/widgets/block_button.dart';
@ -17,7 +18,10 @@ class BlockedUsers extends StatelessWidget {
title: const Text('Blocked Users'),
),
body: RefreshIndicator(
onRefresh: () => authStore.user.refreshBlockedUsers(headers: authStore.headersTwitch),
onRefresh: () async {
HapticFeedback.lightImpact();
await authStore.user.refreshBlockedUsers(headers: authStore.headersTwitch);
},
child: Observer(
builder: (context) {
if (authStore.user.blockedUsers.isEmpty) {

View file

@ -93,7 +93,7 @@ class ProfileCard extends StatelessWidget {
size: 40,
),
title: const Text('Anonymous User'),
subtitle: const Text('Log in with to view your followed streams, send chat messages, and more.'),
subtitle: const Text('Log in to view your followed streams, send chat messages, and more.'),
trailing: OutlinedButton(
onPressed: () => _showLoginDialog(context),
child: const Text('Log In'),