Skip to content

Commit 708a15c

Browse files
committed
feat: devs/Helpers
1 parent b9b4657 commit 708a15c

File tree

8 files changed

+211
-14
lines changed

8 files changed

+211
-14
lines changed

lib/Api/Anilist/AnilistMutations/DeleteFromList.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ part of '../AnilistMutations.dart';
22

33
extension on AnilistMutations {
44
Future<void> _deleteFromList(Media media) async {
5-
65
if (media.userListId == null) {
76
var id = await getMediaListId(media);
87
if (id == null) {
@@ -20,6 +19,7 @@ extension on AnilistMutations {
2019
'''.trim();
2120
var variables = '{''"id": ${media.userListId}''}';
2221
await executeQuery<Map<String, dynamic>>(query, variables: variables);
22+
snackString('Removed ${media.mainName()} from your list');
2323
}
2424
Future<int?> getMediaListId(Media media) async {
2525
var query = '''{Media(id:${media.id}){id,mediaListEntry{id}}}''';

lib/Api/Anilist/AnilistMutations/SetProgress.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ part of '../AnilistMutations.dart';
44
extension on AnilistMutations {
55
Future<void> _setProgress(Media media, String episode) async {
66
if (Anilist.userid == null) return;
7+
8+
if (media.userProgress == episode.toDouble().toInt()) return;
9+
710
media.userProgress = episode.toDouble().toInt();
811
media.status = media.status == "REPEATING" ? "REPEATING" : "CURRENT";
912
if (media.startDate == null) {

lib/Screens/Anime/Player/Player.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ class MediaPlayerState extends State<MediaPlayer>
322322
}
323323

324324
Widget _buildSubtitle() {
325-
if (videoPlayerController.subtitle.isEmpty) {
325+
if (videoPlayerController.subtitle.isEmpty || !settings.showSubtitle) {
326326
return const SizedBox();
327327
}
328328
return Obx(

lib/Screens/Settings/Developer.dart

Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
import 'package:cached_network_image/cached_network_image.dart';
2+
import 'package:dartotsu/Functions/Function.dart';
3+
import 'package:flutter/material.dart';
4+
5+
import '../../Widgets/CachedNetworkImage.dart';
6+
7+
class Developers {
8+
static List<Developer> get getDevelopersList {
9+
return [
10+
Developer(
11+
name: 'aayush262',
12+
pfp: 'https://s4.anilist.co/file/anilistcdn/user/avatar/large/b5144645-vGCFGixZUVSY.png',
13+
banner: 'https://s4.anilist.co/file/anilistcdn/user/banner/b5144645-aRu1A0QFBin4.jpg',
14+
uri: "https://github.com/aayush2622",
15+
role: "Lead Developer",
16+
),
17+
Developer(
18+
name: "Rintaro",
19+
pfp: "https://i.ibb.co/MxWNVHvN/rintaro.jpg",
20+
banner:
21+
"https://i.ibb.co/s9J0GSNK/torii-gate-autumn-trees-moewalls-com-7018934.png",
22+
uri: "https://github.com/grayankit",
23+
role: "Developer",
24+
),
25+
Developer(
26+
name: "itsmechinmoy",
27+
pfp: "https://avatars.githubusercontent.com/u/167056923?v=4",
28+
banner: "https://files.catbox.moe/gp3m17.gif",
29+
uri: "https://www.youtube.com/watch?v=dQw4w9WgXcQ",
30+
role: "Marketer & Discord Moderator",
31+
),
32+
Developer(
33+
name: "Sheby",
34+
pfp: "https://s4.anilist.co/file/anilistcdn/user/avatar/large/b5724017-EKLuuBbOkt8Z.png",
35+
banner:
36+
"https://s4.anilist.co/file/anilistcdn/user/banner/b5724017-owslY4fmWD6L.jpg",
37+
uri: "https://anilist.co/user/ASheby/",
38+
role: "Discord Moderator",
39+
),
40+
Developer(
41+
name: "SunglassJerry",
42+
pfp: "https://i.ibb.co/5hKgrZnx/9b2983d1dd5c4a6d8988c0ba24ddd6da.png",
43+
banner: "https://i.ibb.co/Z64w3Pdy/image.png",
44+
uri: "https://youtu.be/SfT4FMkh1-w",
45+
role: "Discord Moderator",
46+
),
47+
Developer(
48+
name: "Xerus",
49+
pfp: "https://i.ibb.co/gF6HSFqZ/20250517-100044.png",
50+
banner: "https://i.ibb.co/zhy5G1Tv/Walpaper-1.png",
51+
uri: "https://sxenon.carrd.co/",
52+
role: "Designer",
53+
),
54+
Developer(
55+
name: "Th3 A6add0n1",
56+
pfp: "https://i.postimg.cc/hG9LcwnT/b2c6de2bef5542189c004789112b21c9-Comfy-UI-116902-transformed.png",
57+
banner: "https://i.postimg.cc/qM09rVdX/Abaddon.jpg",
58+
uri: "https://github.com/Th3-A6add0n",
59+
role: "Donor",
60+
),
61+
62+
];
63+
}
64+
65+
static List<Widget> getDevelopersWidget(BuildContext context) {
66+
return getDevelopersList.map((dev) {
67+
return InkWell(
68+
onTap: () async => openLinkInBrowser(dev.uri),
69+
child: Card(
70+
shape: RoundedRectangleBorder(
71+
borderRadius: BorderRadius.circular(16),
72+
),
73+
clipBehavior: Clip.antiAlias,
74+
child: Stack(
75+
clipBehavior: Clip.antiAlias,
76+
children: [
77+
if (dev.banner != null)
78+
cachedNetworkImage(
79+
imageUrl: dev.banner,
80+
fit: BoxFit.cover,
81+
width: double.infinity,
82+
height: 86,
83+
),
84+
Container(
85+
width: double.infinity,
86+
height: 86,
87+
color: Colors.black.withOpacity(0.5),
88+
),
89+
SizedBox(
90+
height: 86,
91+
width: double.infinity,
92+
child: Center(
93+
child: Padding(
94+
padding: const EdgeInsets.symmetric(horizontal: 16),
95+
child: Row(
96+
crossAxisAlignment: CrossAxisAlignment.center,
97+
children: [
98+
CircleAvatar(
99+
radius: 28,
100+
backgroundImage: dev.pfp.isNotEmpty
101+
? CachedNetworkImageProvider(dev.pfp)
102+
: null,
103+
backgroundColor: Colors.transparent,
104+
child: dev.pfp.isEmpty
105+
? Icon(
106+
Icons.person,
107+
size: 28,
108+
color:
109+
Theme.of(context).colorScheme.onSurface,
110+
)
111+
: null,
112+
),
113+
const SizedBox(width: 12),
114+
Expanded(
115+
child: Column(
116+
mainAxisSize: MainAxisSize.min,
117+
crossAxisAlignment: CrossAxisAlignment.start,
118+
children: [
119+
Text(
120+
dev.name,
121+
style: const TextStyle(
122+
fontFamily: 'Poppins',
123+
fontSize: 16,
124+
fontWeight: FontWeight.bold,
125+
color: Colors.white,
126+
),
127+
maxLines: 1,
128+
overflow: TextOverflow.ellipsis,
129+
),
130+
Text(
131+
dev.role,
132+
style: const TextStyle(
133+
fontFamily: 'Poppins',
134+
fontSize: 14,
135+
color: Colors.white70,
136+
),
137+
maxLines: 1,
138+
overflow: TextOverflow.ellipsis,
139+
),
140+
],
141+
),
142+
),
143+
],
144+
),
145+
),
146+
),
147+
),
148+
],
149+
),
150+
),
151+
);
152+
}).toList();
153+
}
154+
}
155+
156+
class Developer {
157+
final String name;
158+
final String pfp;
159+
final String? banner;
160+
final String uri;
161+
final String role;
162+
163+
Developer({
164+
required this.name,
165+
required this.pfp,
166+
this.banner,
167+
required this.uri,
168+
required this.role,
169+
});
170+
}

lib/Screens/Settings/SettingsAboutScreen.dart

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'dart:io';
22

33
import 'package:dartotsu/Theme/LanguageSwitcher.dart';
4+
import 'package:dartotsu/Widgets/CustomBottomDialog.dart';
45
import 'package:flutter/material.dart';
56

67
import '../../Adaptor/Settings/SettingsAdaptor.dart';
@@ -9,6 +10,7 @@ import '../../Functions/Function.dart';
910
import '../../Preferences/PrefManager.dart';
1011
import '../../StorageProvider.dart';
1112
import 'BaseSettingsScreen.dart';
13+
import 'Developer.dart';
1214

1315
class SettingsAboutScreen extends StatefulWidget {
1416
const SettingsAboutScreen({super.key});
@@ -33,32 +35,53 @@ class SettingsAboutScreenState extends BaseSettingsScreen {
3335

3436
@override
3537
List<Widget> get settingsList {
36-
return [
37-
SettingsAdaptor(
38-
settings: _buildSettings(context),
39-
),
40-
];
38+
return [SettingsAdaptor(settings: _buildSettings(context))];
4139
}
4240

4341
List<Setting> _buildSettings(BuildContext context) {
4442
return [
43+
Setting(
44+
type: SettingType.normal,
45+
name: 'Developers/Helpers',
46+
description: 'Dartotsu\'s unpaid labours',
47+
icon: Icons.info_outline,
48+
onClick: () {
49+
showCustomBottomDialog(
50+
context,
51+
CustomBottomDialog(
52+
title: "Developers/Helpers",
53+
viewList: [
54+
Padding(
55+
padding: const EdgeInsets.symmetric(
56+
horizontal: 24.0,
57+
vertical: 8.0,
58+
),
59+
child: Column(
60+
crossAxisAlignment: CrossAxisAlignment.start,
61+
children: Developers.getDevelopersWidget(context),
62+
),
63+
),
64+
],
65+
),
66+
);
67+
},
68+
),
4569
Setting(
4670
type: SettingType.normal,
4771
name: getString.logFile,
4872
description: getString.logFileDescription,
4973
icon: Icons.share,
5074
onClick: () async {
51-
var p = (await StorageProvider.getDirectory(
75+
var p = await StorageProvider.getDirectory(
5276
useCustomPath: true,
5377
customPath: loadData(PrefName.customPath),
54-
));
78+
);
5579

5680
var path = p?.path ?? "";
5781
if (Platform.isLinux) {
5882
copyToClipboard("$path\\appLogs.txt".fixSeparator);
5983
return;
6084
}
61-
6285
shareFile("$path\\appLogs.txt".fixSeparator, "LogFile");
6386
},
6487
),

lib/Theme/Themes/fromCode.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ ThemeData getCustomDarkTheme(int color) {
4242
primaryLightRef: schemeColor.primary,
4343
),
4444
primary: schemeColor.primary,
45+
primaryLightRef: schemeColor.primary,
4546
blendLevel: 18,
4647
);
4748

lib/l10n/app_localizations_pt.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class AppLocalizationsPt extends AppLocalizations {
5050
String get manhua => 'Manhua';
5151

5252
@override
53-
String get home => 'Tela Inicial';
53+
String get home => 'Início';
5454

5555
@override
5656
String get novel => 'Novel';

lib/l10n/app_localizations_uk.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class AppLocalizationsUk extends AppLocalizations {
5151
String get manhua => 'Манхуа';
5252

5353
@override
54-
String get home => 'додому';
54+
String get home => 'Додому';
5555

5656
@override
5757
String get novel => 'Роман';
@@ -671,7 +671,7 @@ class AppLocalizationsUk extends AppLocalizations {
671671
String get readStatus => 'Читати';
672672

673673
@override
674-
String get watchStatus => 'подивився';
674+
String get watchStatus => 'Подивився';
675675

676676
@override
677677
String get outOf => 'з';
@@ -705,7 +705,7 @@ class AppLocalizationsUk extends AppLocalizations {
705705
String get selected => 'Вибрані';
706706

707707
@override
708-
String get found => 'знайдено';
708+
String get found => 'Знайдено';
709709

710710
@override
711711
String get webView => 'Веб-камера';

0 commit comments

Comments
 (0)