diff --git a/lib/galleries.dart b/lib/galleries.dart index 6a9f444..f406048 100644 --- a/lib/galleries.dart +++ b/lib/galleries.dart @@ -105,10 +105,7 @@ class _GalleriesPage extends State queryParameters: queryParameters); } }, - label: Text(i18n.sortByGid, - style: MediaQuery.of(context).size.width > 810 - ? Theme.of(context).textTheme.labelMedium - : Theme.of(context).textTheme.labelLarge), + label: Text(i18n.sortByGid), dropdownMenuEntries: [ DropdownMenuEntry(value: SortByGid.none, label: i18n.none), DropdownMenuEntry(value: SortByGid.asc, label: i18n.asc), @@ -137,14 +134,10 @@ class _GalleriesPage extends State ), title: Text(title), actions: [ - MediaQuery.of(context).size.width > 810 - ? Padding( - padding: const EdgeInsets.only(top: 4.0), - child: sortByGidMenu) - : PopupMenuButton( - icon: const Icon(Icons.sort), - itemBuilder: (context) => - [PopupMenuItem(child: sortByGidMenu)]), + PopupMenuButton( + icon: const Icon(Icons.sort), + itemBuilder: (context) => + [PopupMenuItem(child: sortByGidMenu)]), buildThemeModeIcon(context), buildMoreVertSettingsButon(context), ]), diff --git a/lib/globals.dart b/lib/globals.dart index a9424fb..e105345 100644 --- a/lib/globals.dart +++ b/lib/globals.dart @@ -183,7 +183,11 @@ List> buildMoreVertSettings( onChanged: (value) { if (value != null) { prefs.setBool("showNsfw", value); - listener.emit("showNsfwChanged", null); + try { + listener.emit("showNsfwChanged", null); + } catch (e) { + // Do nothing. + } setState(() { showNsfw = value; }); @@ -201,7 +205,11 @@ List> buildMoreVertSettings( onChanged: (value) { if (value != null) { prefs.setBool("displayAd", value); - listener.emit("displayAdChanged", null); + try { + listener.emit("displayAdChanged", null); + } catch (e) { + // Do nothing. + } setState(() { displayAd = value; }); diff --git a/lib/home.dart b/lib/home.dart index 7b5e40a..1498442 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -17,6 +17,7 @@ class HomePage extends HookWidget { Widget build(BuildContext context) { tryInitApi(context); var mode = useState(MainApp.of(context).themeMode); + mode.value = MainApp.of(context).themeMode; setCurrentTitle("", Theme.of(context).primaryColor.value, usePrefix: true); return Scaffold( appBar: AppBar(