mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-21 07:41:58 +00:00
bottoast
This commit is contained in:
parent
d4e768f6f7
commit
0ad836994d
3 changed files with 22 additions and 4 deletions
|
|
@ -819,8 +819,12 @@ void Function() botToast(
|
|||
bool hasCloudFlare = false,
|
||||
String? url,
|
||||
int animationDuration = 200,
|
||||
List<DismissDirection> dismissDirections = const [DismissDirection.horizontal, DismissDirection.down],
|
||||
List<DismissDirection> dismissDirections = const [
|
||||
DismissDirection.horizontal,
|
||||
DismissDirection.down,
|
||||
],
|
||||
bool onlyOne = true,
|
||||
bool? themeDark,
|
||||
}) {
|
||||
final context = navigatorKey.currentState?.context;
|
||||
final assets = [
|
||||
|
|
@ -834,7 +838,13 @@ void Function() botToast(
|
|||
duration: Duration(seconds: second),
|
||||
animationDuration: Duration(milliseconds: animationDuration),
|
||||
animationReverseDuration: Duration(milliseconds: animationDuration),
|
||||
leading: (_) => Image.asset((assets..shuffle()).first, height: 25),
|
||||
leading:
|
||||
(_) => Image.asset(
|
||||
(themeDark == null
|
||||
? (assets..shuffle()).first
|
||||
: assets[themeDark ? 0 : 1]),
|
||||
height: 25,
|
||||
),
|
||||
title: (_) => Text(title, style: TextStyle(fontSize: fontSize)),
|
||||
trailing:
|
||||
hasCloudFlare
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import 'package:mangayomi/modules/library/providers/add_torrent.dart';
|
|||
import 'package:mangayomi/modules/library/providers/local_archive.dart';
|
||||
import 'package:mangayomi/modules/manga/detail/providers/update_manga_detail_providers.dart';
|
||||
import 'package:mangayomi/modules/more/categories/providers/isar_providers.dart';
|
||||
import 'package:mangayomi/modules/more/settings/appearance/providers/theme_mode_state_provider.dart';
|
||||
import 'package:mangayomi/modules/more/settings/sync/providers/sync_providers.dart';
|
||||
import 'package:mangayomi/modules/widgets/custom_draggable_tabbar.dart';
|
||||
import 'package:mangayomi/modules/widgets/manga_image_card_widget.dart';
|
||||
|
|
@ -72,11 +73,13 @@ class _LibraryScreenState extends ConsumerState<LibraryScreen>
|
|||
}
|
||||
|
||||
Future<void> _updateLibrary(List<Manga> mangaList) async {
|
||||
bool isDark = ref.read(themeModeStateProvider);
|
||||
botToast(
|
||||
context.l10n.updating_library("0", "0", "0"),
|
||||
fontSize: 13,
|
||||
second: 30,
|
||||
alignY: !context.isTablet ? 0.85 : 1,
|
||||
themeDark: isDark,
|
||||
);
|
||||
int numbers = 0;
|
||||
int failed = 0;
|
||||
|
|
@ -97,7 +100,8 @@ class _LibraryScreenState extends ConsumerState<LibraryScreen>
|
|||
alignY: !context.isTablet ? 0.85 : 1,
|
||||
animationDuration: 0,
|
||||
dismissDirections: [DismissDirection.none],
|
||||
onlyOne: false
|
||||
onlyOne: false,
|
||||
themeDark: isDark,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:bot_toast/bot_toast.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:mangayomi/modules/more/settings/appearance/providers/theme_mode_state_provider.dart';
|
||||
import 'package:mangayomi/modules/widgets/custom_sliver_grouped_list_view.dart';
|
||||
|
||||
import 'package:isar/isar.dart';
|
||||
|
|
@ -37,11 +38,13 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
bool isDark = ref.read(themeModeStateProvider);
|
||||
botToast(
|
||||
context.l10n.updating_library("0", "0", "0"),
|
||||
fontSize: 13,
|
||||
second: 30,
|
||||
alignY: !context.isTablet ? 0.85 : 1,
|
||||
themeDark: isDark,
|
||||
);
|
||||
final mangaList =
|
||||
isar.mangas
|
||||
|
|
@ -83,7 +86,8 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
alignY: !context.isTablet ? 0.85 : 1,
|
||||
animationDuration: 0,
|
||||
dismissDirections: [DismissDirection.none],
|
||||
onlyOne: false
|
||||
onlyOne: false,
|
||||
themeDark: isDark,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue