Skip to content

Commit

Permalink
feat: app icon
Browse files Browse the repository at this point in the history
  • Loading branch information
sukinosuki committed Sep 9, 2024
1 parent 0a5e785 commit a4cdfa1
Show file tree
Hide file tree
Showing 58 changed files with 212 additions and 295 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flutter-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Build apks
run: |
flutter pub get
flutter build apk --dart-define=GITHUB_HASH=$GITHUB_SHA --release
flutter build apk --dart-define=GITHUB_HASH=$GITHUB_SHA --target-platform android-arm,android-arm64,android-x64 --split-per-abi --release
flutter build apk --dart-define=GITHUB_HASH=$GITHUB_SHA --build-name=${{ github.event.inputs.TAG }} --build-number=1 --release
flutter build apk --dart-define=GITHUB_HASH=$GITHUB_SHA --build-name=${{ github.event.inputs.TAG }} --build-number=1 --target-platform android-arm,android-arm64,android-x64 --split-per-abi --release
mkdir -p releases
mv -f build/app/outputs/flutter-apk/*-release.apk releases
mv -f releases/app-release.apk releases/app-universal-release.apk
Expand Down
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@
- Article list page
- Pack set list page
- Pack set detail page
- Dark mode and theme color
- Data local cache for fast viewing and reduce the api fetching

## Screenshot
| ![home normal](./screenshot/home_normal.jpg) | ![packs](./screenshot/packs.jpg) | ![articles](./screenshot/articles.jpg) |
|----------------------------------------------------| ------- |----------------------------------------|
| ![ban changes](./screenshot/ban_list_changes.jpg) | ![ban cards](./screenshot/ban_cards.jpg) | ![tier list](./screenshot/tier_list.jpg) |
| ![deck type](./screenshot/deck_type_detail.jpg) | ![top decks](./screenshot/top_decks.jpg) | ![deck detail](./screenshot/deck_detail.jpg) |
| ![theme color picker](./screenshot/theme_color.jpg) | ![dark mode](./screenshot/setting_dark_mode.jpg) | ![card view](./screenshot/card_view.jpg) |

## Download 下载

[从github下载](https://github.com/sukinosuki/duel-links-meta-flutter-app/releases)
[Download from github (从github下载)](https://github.com/sukinosuki/duel-links-meta-flutter-app/releases)

## Stars

Expand All @@ -25,8 +33,11 @@ If this project is helpful to you, please consider giving a star for support.

## Data source

The app utilizes the following resources from [Duel Links Meta](https://www.duellinksmeta.com):
The app utilizes the following resources from [Duel Links Meta](https://www.duellinksmeta.com)[Konami]()[deviantart](https://www.deviantart.com/tag/masterduel):

- **APIs**: The app integrates with Duel Links Meta's APIs to fetch deck lists, card details, and other game-related data.
- **Images**: Card images and other graphics used in the app are sourced directly from Duel Links Meta.

- **Images**: Card images and other graphics used in the app are sourced directly from Duel Links Meta、konami、deviantart.

## License

该项目仅供学习交流,请于下载后24小时内删除,使用应遵循当地法律法规,请勿用于违法用途。
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<uses-permission android:name="android.permission.INTERNET"/>

<application
android:label="duel_links_meta"
android:label="Duel Links Meta"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand Down
Binary file modified android/app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/app_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/background-blueflex.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/background-fixed-rb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/background-fixed-tl.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/background-sparks.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 13 additions & 1 deletion assets/json/open_source_licenses.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
{
"name": "json_annotation",
"repos": "https://github.com/google/json_serializable.dart/tree/master/json_annotation",
"repos": "https://github.com/google/json_serializable.dart",
"license_path": "https://github.com/google/json_serializable.dart/blob/master/json_annotation/LICENSE",
"version": "^4.8.1"
},
Expand Down Expand Up @@ -106,5 +106,17 @@
"repos": "https://github.com/isar/hive",
"license_path": "https://github.com/isar/hive/blob/main/LICENSE",
"version": "^2.0.1"
},
{
"name": "package_info_plus",
"repos": "https://github.com/fluttercommunity/plus_plugins/tree/main/packages/package_info_plus/package_info_plus",
"license_path": "https://github.com/fluttercommunity/plus_plugins/blob/main/packages/package_info_plus/package_info_plus/LICENSE",
"version": "8.0.2"
},
{
"name": "url_launcher",
"repos": "https://github.com/flutter/packages/tree/main/packages/url_launcher/url_launcher",
"license_path": "https://github.com/flutter/packages/blob/main/packages/url_launcher/url_launcher/LICENSE",
"version": "6.3.0"
}
]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/api/ArticleApi.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ArticleApi {

Future<Response<List<Article>>> articleList(Map<String, String> params) {
return http.get(
'/api/v1/articles',
'/api/v121/articles',
query: params,
decoder: (data) => (data as List<dynamic>).map(Article.fromJson).toList(),
);
Expand Down
22 changes: 11 additions & 11 deletions lib/components/ListFooter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:duel_links_meta/type/enum/PageStatus.dart';
import 'package:flutter/material.dart';

class ListFooter extends StatefulWidget {
const ListFooter({super.key, required this.loadMoreStatus, required this.hasMore});
const ListFooter({required this.loadMoreStatus, required this.hasMore, super.key});

final PageStatus loadMoreStatus;
final bool hasMore;
Expand All @@ -12,9 +12,9 @@ class ListFooter extends StatefulWidget {
}

class _ListFooterState extends State<ListFooter> {
var loadMoreStatusTextMap = <PageStatus, String>{
Map<PageStatus, String> loadMoreStatusTextMap = <PageStatus, String>{
PageStatus.loading: 'Loading',
PageStatus.fail: 'Fail',
PageStatus.fail: 'Loading Failed',
PageStatus.success: 'Loading',
};

Expand All @@ -34,15 +34,15 @@ class _ListFooterState extends State<ListFooter> {
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(loadMoreStatusText),
const SizedBox(width: 10),
const SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
semanticsLabel: '21',
if (widget.hasMore) const SizedBox(width: 10),
if (widget.hasMore)
const SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
strokeWidth: 2,
),
),
)
],
),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/components/SettingModalView.dart
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class _SettingModalViewState extends State<SettingModalView> {
),
ListTile(
title: const Text('Commit ID'),
trailing: Text(githubHash),
trailing: Text(githubHash.length > 6 ? githubHash.substring(0, 6) : githubHash),
),
Material(
color: Colors.transparent,
Expand Down
25 changes: 25 additions & 0 deletions lib/gen/assets.gen.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions lib/hive/db/DarkModeHiveDb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'package:duel_links_meta/hive/MyHive.dart';
import 'package:flutter/material.dart';

class DarkModeHiveDb {

factory DarkModeHiveDb() {
return _instance;
}
Expand All @@ -11,14 +10,13 @@ class DarkModeHiveDb {

static final DarkModeHiveDb _instance = DarkModeHiveDb._constructor();

final String _key = 'dark_mode';

void set(ThemeMode mode) {
final String _key = 'dark_mode';

void set(ThemeMode mode) {
return MyHive.box.put(_key, mode.name).ignore();
}

Future<ThemeMode> get() async {
Future<ThemeMode> get() async {
final mode = await MyHive.box.get(_key);

if (mode == ThemeMode.dark.name) {
Expand Down
92 changes: 48 additions & 44 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,52 +40,56 @@ class MyApp extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Obx(() => GetMaterialApp(
title: 'Duel Links Meta',
themeMode: ThemeMode.light,
darkTheme: ThemeData.dark(useMaterial3: true).copyWith(
colorScheme: ColorScheme.dark(
primary: appStore.themeColor,
),
navigationBarTheme: NavigationBarTheme.of(context).copyWith(
iconTheme: MaterialStateProperty.resolveWith<IconThemeData?>((Set<MaterialState> states) {
// 这里可以根据不同的状态返回不同的 IconThemeData
// 如果没有特别的状态要求,可以返回一个默认的 IconThemeData
// 例如,在所有状态下使用相同的图标颜色和大小
return const IconThemeData();
}),
),
// tabBarTheme: const TabBarTheme(labelColor: BaColors.theme, indicatorColor: BaColors.theme),
appBarTheme: const AppBarTheme(
elevation: 2,
centerTitle: true,
),
return Obx(
() => GetMaterialApp(
title: 'Duel Links Meta',
themeMode: ThemeMode.light,
darkTheme: ThemeData.dark(useMaterial3: true).copyWith(
colorScheme: ColorScheme.dark(
primary: appStore.themeColor,
),
theme: ThemeData.light(useMaterial3: true).copyWith(
colorScheme: ColorScheme.light(
primary: appStore.themeColor,
),
navigationBarTheme: NavigationBarTheme.of(context).copyWith(
iconTheme: MaterialStateProperty.resolveWith<IconThemeData?>((Set<MaterialState> states) {
// 这里可以根据不同的状态返回不同的 IconThemeData
// 如果没有特别的状态要求,可以返回一个默认的 IconThemeData
// 例如,在所有状态下使用相同的图标颜色和大小
return IconThemeData(
color: states.contains(MaterialState.selected) ? Colors.white : Colors.black54, // 设置为白色,以便在黑色背景上清晰可见
// size: 20, // 设置图标大小
);
}),
),
appBarTheme: const AppBarTheme(
elevation: 2,
centerTitle: true,
),
navigationBarTheme: NavigationBarTheme.of(context).copyWith(
iconTheme: MaterialStateProperty.resolveWith<IconThemeData?>((Set<MaterialState> states) {
// 这里可以根据不同的状态返回不同的 IconThemeData
// 如果没有特别的状态要求,可以返回一个默认的 IconThemeData
// 例如,在所有状态下使用相同的图标颜色和大小
return const IconThemeData();
}),
),
navigatorObservers: [FlutterSmartDialog.observer],
builder: FlutterSmartDialog.init(
toastBuilder: (msg) => ToastWidget(msg: msg),
// tabBarTheme: const TabBarTheme(labelColor: BaColors.theme, indicatorColor: BaColors.theme),
appBarTheme: const AppBarTheme(
elevation: 2,
centerTitle: true,
shadowColor: Colors.black12,
),
home: const SplashPage(),
));
),
theme: ThemeData.light(useMaterial3: true).copyWith(
colorScheme: ColorScheme.light(
primary: appStore.themeColor,
),
navigationBarTheme: NavigationBarTheme.of(context).copyWith(
iconTheme: MaterialStateProperty.resolveWith<IconThemeData?>((Set<MaterialState> states) {
// 这里可以根据不同的状态返回不同的 IconThemeData
// 如果没有特别的状态要求,可以返回一个默认的 IconThemeData
// 例如,在所有状态下使用相同的图标颜色和大小
return IconThemeData(
color: states.contains(MaterialState.selected) ? Colors.white : Colors.black54, // 设置为白色,以便在黑色背景上清晰可见
// size: 20, // 设置图标大小
);
}),
),
appBarTheme: const AppBarTheme(
elevation: 2,
centerTitle: true,
shadowColor: Colors.black12,
),
),
navigatorObservers: [FlutterSmartDialog.observer],
builder: FlutterSmartDialog.init(
toastBuilder: (msg) => ToastWidget(msg: msg),
),
home: const SplashPage(),
),
);
}
}
14 changes: 7 additions & 7 deletions lib/pages/articles/index.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class _ArticlesPageState extends State<ArticlesPage> with AutomaticKeepAliveClie
Navigator.push(context, MaterialPageRoute<void>(builder: (context) => WebviewPage(title: title, url: url)));
}

//
Future<void> fetchData({bool isLoadMore = false}) async {
if (!isLoadMore) {
final list = await ArticleHiveDb().get('');
Expand All @@ -57,16 +56,18 @@ class _ArticlesPageState extends State<ArticlesPage> with AutomaticKeepAliveClie
params[r'hidden[$ne]'] = 'true';
params[r'category[$ne]'] = 'quick-news';

final (err, list) = await ArticleApi().articleList(params).toCatch;
final (err, list) = await ArticleApi().articleList(params).toCatch;
if (err != null || list == null) {
if (isLoadMore) {
setState(() {
_listViewData.loadMoreStatus = PageStatus.fail;
});
} else {
setState(() {
_listViewData.pageStatus = PageStatus.fail;
});
if (_listViewData.data.isEmpty) {
setState(() {
_listViewData.pageStatus = PageStatus.fail;
});
}
}
return;
}
Expand Down Expand Up @@ -106,7 +107,7 @@ class _ArticlesPageState extends State<ArticlesPage> with AutomaticKeepAliveClie
return;
}

if (_listViewData.loadMoreStatus == PageStatus.loading) {
if (_listViewData.loadMoreStatus == PageStatus.loading || _listViewData.loadMoreStatus == PageStatus.fail) {
return;
}

Expand Down Expand Up @@ -180,7 +181,6 @@ class _ArticlesPageState extends State<ArticlesPage> with AutomaticKeepAliveClie
},
),
),

if (_listViewData.pageStatus == PageStatus.fail)
const SingleChildScrollView(
physics: AlwaysScrollableScrollPhysics(),
Expand Down
Loading

0 comments on commit a4cdfa1

Please sign in to comment.