diff --git a/lib/screens/home.dart b/lib/screens/home.dart index d69ca509..6ffd0f64 100644 --- a/lib/screens/home.dart +++ b/lib/screens/home.dart @@ -41,6 +41,9 @@ class _HomeState extends State { controller: _textController, autocorrect: false, autofocus: true, + decoration: const InputDecoration( + hintText: 'Search for a channel', + ), onSubmitted: (string) async { if (await Twitch.getUser(userLogin: string, headers: context.read().headersTwitch) != null) { Navigator.push( diff --git a/lib/screens/video_chat.dart b/lib/screens/video_chat.dart index 07dbf4bc..dbd55df2 100644 --- a/lib/screens/video_chat.dart +++ b/lib/screens/video_chat.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/widgets.dart'; +import 'package:flutter_mobx/flutter_mobx.dart'; import 'package:frosty/stores/auth_store.dart'; import 'package:frosty/stores/chat_store.dart'; import 'package:frosty/stores/settings_store.dart'; @@ -18,12 +19,16 @@ class VideoChat extends StatelessWidget { body: SafeArea( child: Column( children: [ - Visibility( - visible: context.read().videoEnabled, - child: AspectRatio( - aspectRatio: 16 / 9, - child: Video(channelName: userLogin), - ), + Observer( + builder: (_) { + return Visibility( + visible: context.read().videoEnabled, + child: AspectRatio( + aspectRatio: 16 / 9, + child: Video(channelName: userLogin), + ), + ); + }, ), Expanded( child: Chat(chatStore: ChatStore(auth: context.read(), channelName: userLogin)), diff --git a/lib/widgets/chat.dart b/lib/widgets/chat.dart index 57c958d0..c08c2136 100644 --- a/lib/widgets/chat.dart +++ b/lib/widgets/chat.dart @@ -1,7 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_mobx/flutter_mobx.dart'; +import 'package:frosty/screens/settings.dart'; import 'package:frosty/stores/auth_store.dart'; import 'package:frosty/stores/chat_store.dart'; +import 'package:frosty/widgets/chat_stats.dart'; import 'package:provider/provider.dart'; class Chat extends StatefulWidget { @@ -56,22 +58,52 @@ class _ChatState extends State { ], ), ), - if (context.read().isLoggedIn) - Padding( - padding: const EdgeInsets.all(5.0), - child: TextField( - decoration: const InputDecoration( - isDense: true, - contentPadding: EdgeInsets.all(8.0), - border: OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(5.0)), - ), - hintText: 'Send a message', - ), - controller: widget.chatStore.textController, - onSubmitted: (string) => widget.chatStore.sendMessage(string), + Row( + children: [ + IconButton( + icon: const Icon(Icons.settings), + onPressed: () { + showModalBottomSheet( + context: context, + builder: (context) { + return const Settings(); + }, + ); + }, ), - ), + IconButton( + icon: const Icon(Icons.stacked_bar_chart), + onPressed: () { + showModalBottomSheet( + context: context, + builder: (context) { + return ChatStats( + chatStore: widget.chatStore, + ); + }, + ); + }, + ), + if (context.read().isLoggedIn) + Expanded( + child: Padding( + padding: const EdgeInsets.all(8.0), + child: TextField( + decoration: const InputDecoration( + isDense: true, + contentPadding: EdgeInsets.all(8.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(5.0)), + ), + hintText: 'Send a message', + ), + controller: widget.chatStore.textController, + onSubmitted: (string) => widget.chatStore.sendMessage(string), + ), + ), + ), + ], + ) ], ); }