From 4f3dc05667e5397715dfb28f5e7e3bc91d3ec0b0 Mon Sep 17 00:00:00 2001
From: xkeyC <3334969096@qq.com>
Date: Sat, 17 Feb 2024 11:30:01 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=AE=AF=E6=B5=81=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=20logo?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
assets/tieba.svg | 1 +
lib/api/analytics.dart | 3 +-
lib/common/conf/url_conf.dart | 2 +-
lib/ui/home/home_ui.dart | 78 ++++++++++++++++++++++++++---------
4 files changed, 62 insertions(+), 22 deletions(-)
create mode 100644 assets/tieba.svg
diff --git a/assets/tieba.svg b/assets/tieba.svg
new file mode 100644
index 0000000..fe99cde
--- /dev/null
+++ b/assets/tieba.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/lib/api/analytics.dart b/lib/api/analytics.dart
index 0d5fa71..4fd074f 100644
--- a/lib/api/analytics.dart
+++ b/lib/api/analytics.dart
@@ -9,7 +9,8 @@ class AnalyticsApi {
if (kDebugMode) return;
dPrint("AnalyticsApi.touch === $key start");
try {
- final r = await RSHttp.postData("${URLConf.xkeycApiHome}/analytics/$key",
+ final r = await RSHttp.postData(
+ "${URLConf.analyticsApiHome}/analytics/$key",
data: null);
dPrint("AnalyticsApi.touch === $key over statusCode == ${r.statusCode}");
} catch (e) {
diff --git a/lib/common/conf/url_conf.dart b/lib/common/conf/url_conf.dart
index cc5a758..7889ec2 100644
--- a/lib/common/conf/url_conf.dart
+++ b/lib/common/conf/url_conf.dart
@@ -6,7 +6,7 @@ class URLConf {
/// HOME API
static String gitApiHome = "https://git.sctoolbox.sccsgo.com";
static String rssApiHome = "https://rss.sctoolbox.sccsgo.com";
- static const String xkeycApiHome = "https://sctoolbox.xkeyc.com";
+ static const String analyticsApiHome = "https://scbox.org";
static bool isUrlCheckPass = false;
diff --git a/lib/ui/home/home_ui.dart b/lib/ui/home/home_ui.dart
index 6561391..a960e38 100644
--- a/lib/ui/home/home_ui.dart
+++ b/lib/ui/home/home_ui.dart
@@ -1,4 +1,6 @@
import 'package:card_swiper/card_swiper.dart';
+import 'package:fluent_ui/fluent_ui.dart';
+import 'package:flutter/cupertino.dart';
import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:flutter_tilt/flutter_tilt.dart';
@@ -374,7 +376,8 @@ class HomeUI extends BaseUI {
left: 12, right: 12, top: 4, bottom: 4),
child: Row(
children: [
- const Text("· "),
+ getRssIcon(item.link ?? ""),
+ const SizedBox(width: 6),
Expanded(
child: Text(
"${model.handleTitle(item.title)}",
@@ -398,6 +401,22 @@ class HomeUI extends BaseUI {
);
}
+ Widget getRssIcon(String url) {
+ if (url.startsWith("https://tieba.baidu.com")) {
+ return SvgPicture.asset("assets/tieba.svg", width: 14, height: 14);
+ }
+
+ if (url.startsWith("https://www.bilibili.com")) {
+ return const FaIcon(
+ FontAwesomeIcons.bilibili,
+ size: 14,
+ color: Color.fromRGBO(0, 161, 214, 1),
+ );
+ }
+
+ return const FaIcon(FontAwesomeIcons.rss, size: 14);
+ }
+
Widget makeIndexActionLists(BuildContext context, HomeUIModel model) {
final items = [
_HomeItemData("auto_check", "一键诊断", "一键诊断星际公民常见问题",
@@ -514,27 +533,40 @@ class HomeUI extends BaseUI {
),
child: Padding(
padding: const EdgeInsets.all(8.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
+ child: Row(
children: [
- Row(
- children: [
- icon,
- Text(
- name,
- style: const TextStyle(fontSize: 14),
- ),
- ],
+ Expanded(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Row(
+ children: [
+ icon,
+ Text(
+ name,
+ style: const TextStyle(fontSize: 14),
+ ),
+ ],
+ ),
+ if (info != null)
+ Padding(
+ padding: const EdgeInsets.only(top: 4),
+ child: Text(
+ info,
+ style: TextStyle(
+ fontSize: 12,
+ color: Colors.white.withOpacity(.6)),
+ ),
+ )
+ ],
+ ),
),
- if (info != null)
- Padding(
- padding: const EdgeInsets.only(top: 4),
- child: Text(
- info,
- style: TextStyle(
- fontSize: 12, color: Colors.white.withOpacity(.6)),
- ),
- )
+ const SizedBox(width: 12),
+ Icon(
+ FluentIcons.chevron_right,
+ size: 14,
+ color: Colors.white.withOpacity(.6),
+ )
],
),
),
@@ -658,6 +690,12 @@ class HomeUI extends BaseUI {
),
],
),
+ const SizedBox(width: 12),
+ Icon(
+ FluentIcons.chevron_right,
+ size: 14,
+ color: Colors.white.withOpacity(.6),
+ )
],
);
},