This commit is contained in:
kodjomoustapha 2023-08-25 21:08:21 +01:00
parent a914f6edaa
commit 2ddbc0b40a
16 changed files with 752 additions and 720 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

View file

@ -5,7 +5,7 @@ import 'package:mangayomi/providers/l10n_providers.dart';
import 'package:mangayomi/providers/storage_provider.dart';
import 'package:mangayomi/modules/browse/extension/extension_screen.dart';
import 'package:mangayomi/modules/browse/sources/sources_screen.dart';
import 'package:mangayomi/modules/library/search_text_form_field.dart';
import 'package:mangayomi/modules/library/widgets/search_text_form_field.dart';
class BrowseScreen extends ConsumerStatefulWidget {
const BrowseScreen({super.key});

View file

@ -15,7 +15,7 @@ import 'package:mangayomi/utils/colors.dart';
import 'package:mangayomi/utils/constant.dart';
import 'package:mangayomi/utils/headers.dart';
import 'package:mangayomi/utils/language.dart';
import 'package:mangayomi/modules/library/search_text_form_field.dart';
import 'package:mangayomi/modules/library/widgets/search_text_form_field.dart';
import 'package:mangayomi/modules/more/settings/browse/providers/browse_state_provider.dart';
import 'package:mangayomi/modules/widgets/bottom_text_widget.dart';
import 'package:mangayomi/modules/widgets/manga_image_card_widget.dart';

View file

@ -14,7 +14,7 @@ import 'package:mangayomi/providers/l10n_providers.dart';
import 'package:mangayomi/utils/cached_network.dart';
import 'package:mangayomi/utils/date.dart';
import 'package:mangayomi/utils/headers.dart';
import 'package:mangayomi/modules/library/search_text_form_field.dart';
import 'package:mangayomi/modules/library/widgets/search_text_form_field.dart';
import 'package:mangayomi/modules/widgets/error_text.dart';
import 'package:mangayomi/modules/widgets/progress_center.dart';

View file

@ -22,7 +22,7 @@ import 'package:mangayomi/utils/colors.dart';
import 'package:mangayomi/utils/media_query.dart';
import 'package:mangayomi/modules/library/providers/isar_providers.dart';
import 'package:mangayomi/modules/library/providers/library_state_provider.dart';
import 'package:mangayomi/modules/library/search_text_form_field.dart';
import 'package:mangayomi/modules/library/widgets/search_text_form_field.dart';
import 'package:mangayomi/modules/library/widgets/library_gridview_widget.dart';
import 'package:mangayomi/modules/library/widgets/library_listview_widget.dart';
import 'package:mangayomi/modules/library/widgets/list_tile_manga_category.dart';

View file

@ -817,6 +817,7 @@ class _MangaDetailViewState extends ConsumerState<MangaDetailView>
levels: [
DraggableMenuLevel.ratio(
ratio: scanlators.$1.isEmpty ? 1 / 3.6 : 1 / 3.3),
DraggableMenuLevel.ratio(ratio: 2 / 3),
],
fastDrag: false,
minimizeBeforeFastDrag: false,

View file

@ -10,7 +10,7 @@ import 'package:mangayomi/services/get_popular_manga.dart';
import 'package:mangayomi/services/search_manga.dart';
import 'package:mangayomi/utils/colors.dart';
import 'package:mangayomi/utils/media_query.dart';
import 'package:mangayomi/modules/library/search_text_form_field.dart';
import 'package:mangayomi/modules/library/widgets/search_text_form_field.dart';
import 'package:mangayomi/modules/manga/home/widget/mangas_card_selector.dart';
import 'package:mangayomi/modules/widgets/gridview_widget.dart';
import 'package:mangayomi/modules/widgets/manga_image_card_widget.dart';

View file

@ -54,21 +54,29 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
appBar: AppBar(
title: Text(l10n!.about),
),
body: Column(
children: [
SizedBox(
height: 150,
// child: Center(
// child: Image.asset(
// "assets/icon.png",
// color: Theme.of(context).brightness == Brightness.light
// ? Colors.black
// : Colors.white,
// ))
),
Flexible(
flex: 3,
child: Column(
body: SingleChildScrollView(
child: Column(
children: [
// Center(
// child: ClipOval(
// child: Image.asset(
// Theme.of(context).brightness == Brightness.light
// ? "assets/app_icons/icon-black.png"
// : "assets/app_icons/icon-red.png",
// height: 100,
// ),
// )),
const SizedBox(
height: 150,
// child: Center(
// child: Image.asset(
// "assets/icon.png",
// color: Theme.of(context).brightness == Brightness.light
// ? Colors.black
// : Colors.white,
// ))
),
Column(
children: [
const Divider(
color: Colors.grey,
@ -113,8 +121,8 @@ class _AboutScreenState extends ConsumerState<AboutScreen> {
)
],
),
),
],
],
),
),
);
}

View file

@ -14,6 +14,17 @@ class MoreScreen extends StatelessWidget {
body: SingleChildScrollView(
child: Column(
children: [
// Padding(
// padding: const EdgeInsets.symmetric(vertical: 20),
// child: ClipOval(
// child: Image.asset(
// Theme.of(context).brightness == Brightness.light
// ? "assets/app_icons/icon-black.png"
// : "assets/app_icons/icon-red.png",
// height: 150,
// ),
// ),
// ),
SizedBox(
height: 200,
// child: Center(

View file

@ -23,183 +23,185 @@ class AppearanceScreen extends ConsumerWidget {
appBar: AppBar(
title: Text(l10n!.appearance),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.theme,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
body: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.theme,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
),
const DarkModeButton(),
const ThemeSelector(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: SwitchListTile(
title: Text(l10n.pure_black_dark_mode),
value: pureBlackDarkMode,
onChanged: (value) {
ref
.read(pureBlackDarkModeStateProvider.notifier)
.set(value);
}),
),
if (!pureBlackDarkMode) const BlendLevelSlider()
],
const DarkModeButton(),
const ThemeSelector(),
Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: SwitchListTile(
title: Text(l10n.pure_black_dark_mode),
value: pureBlackDarkMode,
onChanged: (value) {
ref
.read(pureBlackDarkModeStateProvider.notifier)
.set(value);
}),
),
if (!pureBlackDarkMode) const BlendLevelSlider()
],
),
),
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.timestamp,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.timestamp,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.relative_timestamp,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount:
relativeTimestampsList(context).length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: index,
groupValue: relativeTimestamps,
onChanged: (value) {
ref
.read(
relativeTimesTampsStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(relativeTimestampsList(
context)[index])
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style: TextStyle(
color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.relative_timestamp),
subtitle: Text(
relativeTimestampsList(context)[relativeTimestamps],
style:
TextStyle(fontSize: 11, color: secondaryColor(context)),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.relative_timestamp,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount:
relativeTimestampsList(context).length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: index,
groupValue: relativeTimestamps,
onChanged: (value) {
ref
.read(
relativeTimesTampsStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(relativeTimestampsList(
context)[index])
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style: TextStyle(
color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.relative_timestamp),
subtitle: Text(
relativeTimestampsList(context)[relativeTimestamps],
style:
TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.date_format,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: dateFormatsList.length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: dateFormatsList[index],
groupValue: dateFormatState,
onChanged: (value) {
ref
.read(dateFormatStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(
"${dateFormatsList[index]} (${dateFormat(context: context, DateTime.now().millisecondsSinceEpoch.toString(), useRelativeTimesTamps: false, dateFormat: dateFormatsList[index], ref: ref)})")
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style: TextStyle(
color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.date_format),
subtitle: Text(
"$dateFormatState (${dateFormat(context: context, DateTime.now().millisecondsSinceEpoch.toString(), useRelativeTimesTamps: false, dateFormat: dateFormatState, ref: ref)})",
style:
TextStyle(fontSize: 11, color: secondaryColor(context)),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.date_format,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: dateFormatsList.length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: dateFormatsList[index],
groupValue: dateFormatState,
onChanged: (value) {
ref
.read(dateFormatStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(
"${dateFormatsList[index]} (${dateFormat(context: context, DateTime.now().millisecondsSinceEpoch.toString(), useRelativeTimesTamps: false, dateFormat: dateFormatsList[index], ref: ref)})")
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style: TextStyle(
color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.date_format),
subtitle: Text(
"$dateFormatState (${dateFormat(context: context, DateTime.now().millisecondsSinceEpoch.toString(), useRelativeTimesTamps: false, dateFormat: dateFormatState, ref: ref)})",
style:
TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
],
],
),
),
),
],
],
),
),
);
}

View file

@ -20,111 +20,113 @@ class BrowseSScreen extends ConsumerWidget {
appBar: AppBar(
title: Text(l10n!.browse),
),
body: Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 30, top: 20),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.extensions,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
SwitchListTile(
value: checkForExtensionUpdates,
title: Text(l10n.check_for_extension_updates),
onChanged: (value) {
ref
.read(checkForExtensionsUpdateStateProvider.notifier)
.set(value);
}),
if (checkForExtensionUpdates)
SwitchListTile(
value: autoUpdateExtensions,
title: Text(l10n.auto_extensions_updates),
subtitle: Text(
l10n.auto_extensions_updates_subtitle,
style: TextStyle(
fontSize: 11, color: secondaryColor(context))),
onChanged: (value) {
ref
.read(autoUpdateExtensionsStateProvider.notifier)
.set(value);
}),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.global_search,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
SwitchListTile(
value: onlyIncludePinnedSource,
title: Text(l10n.only_include_pinned_sources),
onChanged: (value) {
ref
.read(onlyIncludePinnedSourceStateProvider.notifier)
.set(value);
}),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.nsfw_sources,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
SwitchListTile(
value: showNSFWS,
title: Text(l10n.nsfw_sources_show),
onChanged: (value) {
ref.read(showNSFWStateProvider.notifier).set(value);
}),
ListTile(
title: Padding(
padding: const EdgeInsets.only(bottom: 8),
body: SingleChildScrollView(
child: Column(
children: [
Padding(
padding: const EdgeInsets.only(bottom: 30, top: 20),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Icon(
Icons.info_outline_rounded,
color: secondaryColor(context),
),
Text(l10n.extensions,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
subtitle: Text(l10n.nsfw_sources_info,
style: TextStyle(
fontSize: 11, color: secondaryColor(context))),
)
],
SwitchListTile(
value: checkForExtensionUpdates,
title: Text(l10n.check_for_extension_updates),
onChanged: (value) {
ref
.read(checkForExtensionsUpdateStateProvider.notifier)
.set(value);
}),
if (checkForExtensionUpdates)
SwitchListTile(
value: autoUpdateExtensions,
title: Text(l10n.auto_extensions_updates),
subtitle: Text(
l10n.auto_extensions_updates_subtitle,
style: TextStyle(
fontSize: 11, color: secondaryColor(context))),
onChanged: (value) {
ref
.read(autoUpdateExtensionsStateProvider.notifier)
.set(value);
}),
],
),
),
),
],
Padding(
padding: const EdgeInsets.only(bottom: 30),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.global_search,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
SwitchListTile(
value: onlyIncludePinnedSource,
title: Text(l10n.only_include_pinned_sources),
onChanged: (value) {
ref
.read(onlyIncludePinnedSourceStateProvider.notifier)
.set(value);
}),
],
),
),
Padding(
padding: const EdgeInsets.only(bottom: 10),
child: Column(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 15),
child: Row(
children: [
Text(l10n.nsfw_sources,
style: TextStyle(
fontSize: 13, color: primaryColor(context))),
],
),
),
SwitchListTile(
value: showNSFWS,
title: Text(l10n.nsfw_sources_show),
onChanged: (value) {
ref.read(showNSFWStateProvider.notifier).set(value);
}),
ListTile(
title: Padding(
padding: const EdgeInsets.only(bottom: 8),
child: Row(
children: [
Icon(
Icons.info_outline_rounded,
color: secondaryColor(context),
),
],
),
),
subtitle: Text(l10n.nsfw_sources_info,
style: TextStyle(
fontSize: 11, color: secondaryColor(context))),
)
],
),
),
],
),
),
);
}

View file

@ -27,100 +27,102 @@ class _DownloadsScreenState extends ConsumerState<DownloadsScreen> {
appBar: AppBar(
title: Text(l10n!.downloads),
),
body: Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.download_location,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView(
shrinkWrap: true,
children: [
RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: downloadLocationState.$2.isEmpty
? downloadLocationState.$1
: downloadLocationState.$2,
groupValue: downloadLocationState.$1,
onChanged: (value) {
ref
.read(downloadLocationStateProvider
.notifier)
.set("");
Navigator.pop(context);
},
title: Text(downloadLocationState.$1)),
RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: downloadLocationState.$2.isEmpty
? downloadLocationState.$1
: downloadLocationState.$2,
groupValue: downloadLocationState.$2,
onChanged: (value) async {
String? result = await FilePicker.platform
.getDirectoryPath();
if (result != null) {
body: SingleChildScrollView(
child: Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.download_location,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView(
shrinkWrap: true,
children: [
RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: downloadLocationState.$2.isEmpty
? downloadLocationState.$1
: downloadLocationState.$2,
groupValue: downloadLocationState.$1,
onChanged: (value) {
ref
.read(downloadLocationStateProvider
.notifier)
.set(result);
} else {}
if (!mounted) return;
.set("");
Navigator.pop(context);
},
title: Text(downloadLocationState.$1)),
RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: downloadLocationState.$2.isEmpty
? downloadLocationState.$1
: downloadLocationState.$2,
groupValue: downloadLocationState.$2,
onChanged: (value) async {
String? result = await FilePicker.platform
.getDirectoryPath();
if (result != null) {
ref
.read(downloadLocationStateProvider
.notifier)
.set(result);
} else {}
if (!mounted) return;
Navigator.pop(context);
},
title: Text(l10n.custom_location)),
],
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
title: Text(l10n.custom_location)),
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.download_location),
subtitle: Text(
downloadLocationState.$2.isEmpty
? downloadLocationState.$1
: downloadLocationState.$2,
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
)
],
);
});
},
title: Text(l10n.download_location),
subtitle: Text(
downloadLocationState.$2.isEmpty
? downloadLocationState.$1
: downloadLocationState.$2,
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
SwitchListTile(
value: onlyOnWifiState,
title: Text(l10n.only_on_wifi),
onChanged: (value) {
ref.read(onlyOnWifiStateProvider.notifier).set(value);
}),
SwitchListTile(
value: saveAsCBZArchiveState,
title: Text(l10n.save_as_cbz_archive),
onChanged: (value) {
ref.read(saveAsCBZArchiveStateProvider.notifier).set(value);
}),
],
SwitchListTile(
value: onlyOnWifiState,
title: Text(l10n.only_on_wifi),
onChanged: (value) {
ref.read(onlyOnWifiStateProvider.notifier).set(value);
}),
SwitchListTile(
value: saveAsCBZArchiveState,
title: Text(l10n.save_as_cbz_archive),
onChanged: (value) {
ref.read(saveAsCBZArchiveStateProvider.notifier).set(value);
}),
],
),
),
);
}

View file

@ -17,67 +17,69 @@ class GeneralScreen extends ConsumerWidget {
appBar: AppBar(
title: Text(l10n!.general),
),
body: Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.app_language,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: AppLocalizations.supportedLocales.length,
itemBuilder: (context, index) {
final locale =
AppLocalizations.supportedLocales[index];
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: locale,
groupValue: l10nLocale,
onChanged: (value) {
ref
.read(l10nLocaleStateProvider.notifier)
.setLocale(locale);
Navigator.pop(context);
},
title: Text(completeLanguageName(
locale.toLanguageTag())),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.app_language),
subtitle: Text(
completeLanguageName(l10nLocale.toLanguageTag()),
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
body: SingleChildScrollView(
child: Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.app_language,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: AppLocalizations.supportedLocales.length,
itemBuilder: (context, index) {
final locale =
AppLocalizations.supportedLocales[index];
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: locale,
groupValue: l10nLocale,
onChanged: (value) {
ref
.read(l10nLocaleStateProvider.notifier)
.setLocale(locale);
Navigator.pop(context);
},
title: Text(completeLanguageName(
locale.toLanguageTag())),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.app_language),
subtitle: Text(
completeLanguageName(l10nLocale.toLanguageTag()),
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
],
],
),
),
);
}

View file

@ -24,261 +24,263 @@ class ReaderScreen extends ConsumerWidget {
appBar: AppBar(
title: Text(l10n!.reader),
),
body: Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(l10n.default_reading_mode),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: ReaderMode.values.length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: ReaderMode.values[index],
groupValue: defaultReadingMode,
onChanged: (value) {
ref
.read(defaultReadingModeStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(getReaderModeName(
ReaderMode.values[index], context))
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.default_reading_mode),
subtitle: Text(
getReaderModeName(defaultReadingMode, context),
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
body: SingleChildScrollView(
child: Column(
children: [
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(l10n.default_reading_mode),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: ReaderMode.values.length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: ReaderMode.values[index],
groupValue: defaultReadingMode,
onChanged: (value) {
ref
.read(defaultReadingModeStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(getReaderModeName(
ReaderMode.values[index], context))
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.default_reading_mode),
subtitle: Text(
getReaderModeName(defaultReadingMode, context),
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.double_tap_animation_speed,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: 3,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: index,
groupValue: doubleTapAnimationSpeed,
onChanged: (value) {
ref
.read(doubleTapAnimationSpeedStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(getAnimationSpeedName(index, context))
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.double_tap_animation_speed),
subtitle: Text(
getAnimationSpeedName(doubleTapAnimationSpeed, context),
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.double_tap_animation_speed,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: 3,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: index,
groupValue: doubleTapAnimationSpeed,
onChanged: (value) {
ref
.read(doubleTapAnimationSpeedStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [
Text(getAnimationSpeedName(index, context))
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.double_tap_animation_speed),
subtitle: Text(
getAnimationSpeedName(doubleTapAnimationSpeed, context),
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
ListTile(
onTap: () {
List<int> numbers = [4, 6, 8, 10, 12, 14, 16, 18, 20];
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.page_preload_amount,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: numbers.length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: numbers[index],
groupValue: pagePreloadAmount,
onChanged: (value) {
ref
.read(pagePreloadAmountStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [Text(numbers[index].toString())],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.page_preload_amount),
subtitle: Text(
l10n.page_preload_amount_subtitle,
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
ListTile(
onTap: () {
List<int> numbers = [4, 6, 8, 10, 12, 14, 16, 18, 20];
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.page_preload_amount,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: numbers.length,
itemBuilder: (context, index) {
return RadioListTile(
dense: true,
contentPadding: const EdgeInsets.all(0),
value: numbers[index],
groupValue: pagePreloadAmount,
onChanged: (value) {
ref
.read(pagePreloadAmountStateProvider
.notifier)
.set(value!);
Navigator.pop(context);
},
title: Row(
children: [Text(numbers[index].toString())],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.page_preload_amount),
subtitle: Text(
l10n.page_preload_amount_subtitle,
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.scale_type,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: getScaleTypeNames(context).length,
itemBuilder: (context, index) {
return RadioListTile(
// dense: true,
contentPadding: const EdgeInsets.all(0),
value: index,
groupValue: scaleType.index,
onChanged: (value) {
ref
.read(scaleTypeStateProvider.notifier)
.set(ScaleType.values[value!]);
Navigator.pop(context);
},
title: Row(
children: [
Text(getScaleTypeNames(context)[index]
.toString())
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.scale_type),
subtitle: Text(
getScaleTypeNames(context)[scaleType.index],
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
ListTile(
onTap: () {
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: Text(
l10n.scale_type,
),
content: SizedBox(
width: mediaWidth(context, 0.8),
child: ListView.builder(
shrinkWrap: true,
itemCount: getScaleTypeNames(context).length,
itemBuilder: (context, index) {
return RadioListTile(
// dense: true,
contentPadding: const EdgeInsets.all(0),
value: index,
groupValue: scaleType.index,
onChanged: (value) {
ref
.read(scaleTypeStateProvider.notifier)
.set(ScaleType.values[value!]);
Navigator.pop(context);
},
title: Row(
children: [
Text(getScaleTypeNames(context)[index]
.toString())
],
),
);
},
)),
actions: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
TextButton(
onPressed: () async {
Navigator.pop(context);
},
child: Text(
l10n.cancel,
style:
TextStyle(color: primaryColor(context)),
)),
],
)
],
);
});
},
title: Text(l10n.scale_type),
subtitle: Text(
getScaleTypeNames(context)[scaleType.index],
style: TextStyle(fontSize: 11, color: secondaryColor(context)),
),
),
),
SwitchListTile(
value: animatePageTransitions,
title: Text(l10n.animate_page_transitions),
onChanged: (value) {
ref
.read(animatePageTransitionsStateProvider.notifier)
.set(value);
}),
SwitchListTile(
value: cropBorders,
title: Text(l10n.crop_borders),
onChanged: (value) {
ref.read(cropBordersStateProvider.notifier).set(value);
}),
],
SwitchListTile(
value: animatePageTransitions,
title: Text(l10n.animate_page_transitions),
onChanged: (value) {
ref
.read(animatePageTransitionsStateProvider.notifier)
.set(value);
}),
SwitchListTile(
value: cropBorders,
title: Text(l10n.crop_borders),
onChanged: (value) {
ref.read(cropBordersStateProvider.notifier).set(value);
}),
],
),
),
);
}

View file

@ -17,36 +17,38 @@ class TrackScreen extends ConsumerWidget {
appBar: AppBar(
title: Text(l10nLocalizations(context)!.tracking),
),
body: StreamBuilder(
stream: isar.trackPreferences
.filter()
.syncIdIsNotNull()
.watch(fireImmediately: true),
builder: (context, snapshot) {
List<TrackPreference>? entries =
snapshot.hasData ? snapshot.data : [];
return Column(
children: [
TrackListile(
onTap: () async {
await ref
.read(myAnimeListProvider(syncId: 1, isManga: null)
.notifier)
.login();
},
id: 1,
entries: entries!),
TrackListile(
onTap: () async {
await ref
.read(anilistProvider(syncId: 2).notifier)
.login();
},
id: 2,
entries: entries)
],
);
}),
body: SingleChildScrollView(
child: StreamBuilder(
stream: isar.trackPreferences
.filter()
.syncIdIsNotNull()
.watch(fireImmediately: true),
builder: (context, snapshot) {
List<TrackPreference>? entries =
snapshot.hasData ? snapshot.data : [];
return Column(
children: [
TrackListile(
onTap: () async {
await ref
.read(myAnimeListProvider(syncId: 1, isManga: null)
.notifier)
.login();
},
id: 1,
entries: entries!),
TrackListile(
onTap: () async {
await ref
.read(anilistProvider(syncId: 2).notifier)
.login();
},
id: 2,
entries: entries)
],
);
}),
),
);
}
}