Fix home re-render when logging in and out, tweaks

[skip ci]
This commit is contained in:
tommyxchow 2021-11-12 16:50:02 -05:00
parent 881eebbb17
commit aff92651a0
3 changed files with 9 additions and 12 deletions

View file

@ -29,22 +29,21 @@ class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
final titles = [
if (context.read<AuthStore>().isLoggedIn) 'Followed Streams',
'Top Streams',
'Categories',
'Search',
];
debugPrint('build home');
return Scaffold(
appBar: AppBar(
centerTitle: false,
title: Observer(
builder: (_) {
final titles = [
if (context.read<AuthStore>().isLoggedIn) 'Followed Streams',
'Top Streams',
'Categories',
'Search',
];
return Text(
titles[widget.homeStore.selectedIndex],
style: GoogleFonts.inter(fontSize: 24, fontWeight: FontWeight.bold),
style: GoogleFonts.inter(fontSize: 30, fontWeight: FontWeight.bold),
);
},
),
@ -55,7 +54,6 @@ class _HomeState extends State<Home> {
Navigator.push(
context,
MaterialPageRoute(
fullscreenDialog: true,
builder: (context) {
return Settings(settingsStore: context.read<SettingsStore>());
},

View file

@ -15,10 +15,9 @@ class Settings extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text(
'Settings',
style: GoogleFonts.inter(fontSize: 24, fontWeight: FontWeight.bold),
style: GoogleFonts.inter(fontWeight: FontWeight.bold),
),
),
body: Observer(

View file

@ -13,7 +13,7 @@ abstract class _VideoStoreBase with Store {
late Timer timer;
_VideoStoreBase() {
timer = Timer(const Duration(seconds: 5), () => menuVisible = false);
timer = Timer(const Duration(seconds: 3), () => menuVisible = false);
}
@observable