Skip to content

Commit

Permalink
优化数据拉取
Browse files Browse the repository at this point in the history
优化阅读页面
修复阅读记录显示异常
  • Loading branch information
gstory0404 committed Oct 20, 2022
1 parent 9c35768 commit ce3f1d4
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 16 deletions.
3 changes: 1 addition & 2 deletions lib/manager/my_connect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ class MyConnect extends GetConnect {
List<String?> contents =
XPath.html(html).query(rule.chapterContent?.content ?? "").attrs;
for (var element in contents) {
print(element);
content = "$content\n$element";
content = "$content$element";
}
content = content.replaceAll("  ", "\n  ");
content =
Expand Down
53 changes: 39 additions & 14 deletions lib/pages/about/about_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,41 @@ import 'package:flutter/material.dart';
import 'package:fun_reader/lang/keys.dart';
import 'package:fun_reader/routes/app_pages.dart';
import 'package:get/get.dart';
import 'package:package_info_plus/package_info_plus.dart';
import 'package:url_launcher/url_launcher.dart';

/// @Author: gstory
/// @CreateDate: 2022/6/22 17:38
/// @Email [email protected]
/// @Description: dart类作用描述
class AboutPage extends StatelessWidget {
const AboutPage({Key? key}) : super(key: key);

class AboutPage extends StatefulWidget {
static void go() {
Get.toNamed(Routes.ABOUT);
}

const AboutPage({Key? key}) : super(key: key);

@override
State<AboutPage> createState() => _AboutPageState();
}

class _AboutPageState extends State<AboutPage> {
var version = "";

@override
void initState() {
super.initState();
_getAppVersion();
}

Future<void> _getAppVersion() async {
PackageInfo packageInfo = await PackageInfo.fromPlatform();
setState(() {
version = "v${packageInfo.version}";
});
}

@override
Widget build(BuildContext context) {
return Scaffold(
Expand All @@ -26,18 +47,25 @@ class AboutPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(top: 100),
margin: const EdgeInsets.only(top: 100),
child: Image.asset(
"assets/images/logo.png",
width: 80,
height: 80,
),
),
Container(
margin: EdgeInsets.only(top: 30, bottom: 50),
margin: const EdgeInsets.only(top: 30),
child: Text(
Keys.appName.tr,
style: TextStyle(fontSize: 22, color: Colors.black),
style: const TextStyle(fontSize: 22, color: Colors.black),
),
),
Container(
margin: const EdgeInsets.only(top: 10, bottom: 50),
child: Text(
version,
style: const TextStyle(fontSize: 16, color: Colors.black),
),
),
Expanded(
Expand All @@ -62,8 +90,7 @@ class AboutPage extends StatelessWidget {
children: const [
Text(
"项目地址",
style: TextStyle(
fontSize: 16, color: Colors.black),
style: TextStyle(fontSize: 16, color: Colors.black),
),
Icon(Icons.chevron_right),
],
Expand All @@ -73,8 +100,8 @@ class AboutPage extends StatelessWidget {
//书源规则
InkWell(
onTap: () async {
await launchUrl(
Uri.parse("https://github.com/gstory0404/fun_reader/blob/master/rule.md"));
await launchUrl(Uri.parse(
"https://github.com/gstory0404/fun_reader/blob/master/rule.md"));
},
child: Container(
decoration: const BoxDecoration(
Expand All @@ -89,8 +116,7 @@ class AboutPage extends StatelessWidget {
children: const [
Text(
"书源规则",
style: TextStyle(
fontSize: 16, color: Colors.black),
style: TextStyle(fontSize: 16, color: Colors.black),
),
Icon(Icons.chevron_right),
],
Expand All @@ -116,8 +142,7 @@ class AboutPage extends StatelessWidget {
children: const [
Text(
"开源协议",
style: TextStyle(
fontSize: 16, color: Colors.black),
style: TextStyle(fontSize: 16, color: Colors.black),
),
Icon(Icons.chevron_right),
],
Expand Down
2 changes: 2 additions & 0 deletions macos/Flutter/GeneratedPluginRegistrant.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import FlutterMacOS
import Foundation

import package_info_plus_macos
import path_provider_macos
import shared_preferences_macos
import sqflite
Expand All @@ -13,6 +14,7 @@ import url_launcher_macos
import window_manager

func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ dependencies:
file_picker: ^4.6.1
url_launcher: ^6.1.3
flutter_spinkit: ^5.1.0
package_info_plus: ^1.4.2

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit ce3f1d4

Please sign in to comment.