提交 858a28d5 authored 作者: 岳维路's avatar 岳维路

合并分支 'test' 到 'sim'

Test 查看合并请求 kiwitap/zijing-app!8
...@@ -43,6 +43,10 @@ PODS: ...@@ -43,6 +43,10 @@ PODS:
- permission_handler_apple (9.1.1): - permission_handler_apple (9.1.1):
- Flutter - Flutter
- ReachabilitySwift (5.0.0) - ReachabilitySwift (5.0.0)
- screen_protector (1.2.1):
- Flutter
- ScreenProtectorKit (~> 1.3.1)
- ScreenProtectorKit (1.3.1)
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
...@@ -72,6 +76,7 @@ DEPENDENCIES: ...@@ -72,6 +76,7 @@ DEPENDENCIES:
- package_info_plus (from `.symlinks/plugins/package_info_plus/ios`) - package_info_plus (from `.symlinks/plugins/package_info_plus/ios`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- screen_protector (from `.symlinks/plugins/screen_protector/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`) - sqflite (from `.symlinks/plugins/sqflite/darwin`)
- tobias (from `.symlinks/plugins/tobias/ios`) - tobias (from `.symlinks/plugins/tobias/ios`)
...@@ -81,6 +86,7 @@ SPEC REPOS: ...@@ -81,6 +86,7 @@ SPEC REPOS:
- flutter_sound_core - flutter_sound_core
- OrderedSet - OrderedSet
- ReachabilitySwift - ReachabilitySwift
- ScreenProtectorKit
- WechatOpenSDK-XCFramework - WechatOpenSDK-XCFramework
EXTERNAL SOURCES: EXTERNAL SOURCES:
...@@ -114,6 +120,8 @@ EXTERNAL SOURCES: ...@@ -114,6 +120,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/path_provider_foundation/darwin" :path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple: permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios" :path: ".symlinks/plugins/permission_handler_apple/ios"
screen_protector:
:path: ".symlinks/plugins/screen_protector/ios"
shared_preferences_foundation: shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin" :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite: sqflite:
...@@ -140,6 +148,8 @@ SPEC CHECKSUMS: ...@@ -140,6 +148,8 @@ SPEC CHECKSUMS:
path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c path_provider_foundation: 3784922295ac71e43754bd15e0653ccfd36a147c
permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6 permission_handler_apple: e76247795d700c14ea09e3a2d8855d41ee80a2e6
ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825 ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
screen_protector: 6f92086bd2f2f4b54f54913289b9d1310610140b
ScreenProtectorKit: 83a6281b02c7a5902ee6eac4f5045f674e902ae4
shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695 shared_preferences_foundation: b4c3b4cddf1c21f02770737f147a3f5da9d39695
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
tobias: 22f69183b14af82a2ac8ff698af084c352744e5f tobias: 22f69183b14af82a2ac8ff698af084c352744e5f
......
...@@ -540,6 +540,7 @@ class DiscussModel { ...@@ -540,6 +540,7 @@ class DiscussModel {
this.personPic, this.personPic,
this.isMy, this.isMy,
this.commentsCheck, this.commentsCheck,
this.privacyStatus,
this.status, this.status,
this.isPraise, this.isPraise,
}); });
...@@ -565,6 +566,7 @@ class DiscussModel { ...@@ -565,6 +566,7 @@ class DiscussModel {
isMy = json['is_my']; isMy = json['is_my'];
isPraise = json['is_praise']; isPraise = json['is_praise'];
commentsCheck = json['comments_check']; commentsCheck = json['comments_check'];
privacyStatus = json['privacy_status'];
status = json['status']; status = json['status'];
if (json['comment_all'] != null) { if (json['comment_all'] != null) {
...@@ -589,6 +591,7 @@ class DiscussModel { ...@@ -589,6 +591,7 @@ class DiscussModel {
num? isMy; num? isMy;
num? isPraise; num? isPraise;
num? commentsCheck; num? commentsCheck;
num? privacyStatus;
num? status; num? status;
String? createTime; String? createTime;
String? replacePersonName; String? replacePersonName;
...@@ -612,6 +615,7 @@ class DiscussModel { ...@@ -612,6 +615,7 @@ class DiscussModel {
num? isMy, num? isMy,
num? isPraise, num? isPraise,
num? commentsCheck, num? commentsCheck,
num? privacyStatus,
num? status, num? status,
String? createTime, String? createTime,
String? replacePersonName, String? replacePersonName,
...@@ -636,6 +640,7 @@ class DiscussModel { ...@@ -636,6 +640,7 @@ class DiscussModel {
isPraise: isPraise ?? this.isPraise, isPraise: isPraise ?? this.isPraise,
status:status ?? this.status, status:status ?? this.status,
commentsCheck: commentsCheck ?? this.commentsCheck, commentsCheck: commentsCheck ?? this.commentsCheck,
privacyStatus: privacyStatus ?? this.privacyStatus,
createTime: createTime ?? this.createTime, createTime: createTime ?? this.createTime,
replacePersonName: replacePersonName ?? this.replacePersonName, replacePersonName: replacePersonName ?? this.replacePersonName,
replacePersonPic: replacePersonPic ?? this.replacePersonPic, replacePersonPic: replacePersonPic ?? this.replacePersonPic,
...@@ -663,6 +668,7 @@ class DiscussModel { ...@@ -663,6 +668,7 @@ class DiscussModel {
map['is_my'] = isMy; map['is_my'] = isMy;
map['is_praise'] = isPraise; map['is_praise'] = isPraise;
map['comments_check'] = commentsCheck; map['comments_check'] = commentsCheck;
map['privacy_status'] = privacyStatus;
map['status'] = status; map['status'] = status;
map['create_time'] = createTime; map['create_time'] = createTime;
map['replace_person_name'] = replacePersonName; map['replace_person_name'] = replacePersonName;
......
...@@ -112,7 +112,17 @@ class _BuildItemState extends State<BuildItem> { ...@@ -112,7 +112,17 @@ class _BuildItemState extends State<BuildItem> {
/// 章节名称容器 /// 章节名称容器
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
widget.onTap(chapterModel); if(chapterModel.children!.isEmpty){
widget.onTap(chapterModel);
}
else{
setState(() {
chapterModel.selected = !chapterModel.selected;
});
}
// setState(() {
// chapterModel.selected = !chapterModel.selected;
// });
// // 如果章下面没有节 点击才会跳转 // // 如果章下面没有节 点击才会跳转
// if (widget.model.children!.isEmpty){ // if (widget.model.children!.isEmpty){
// widget.onTap(widget.model); // widget.onTap(widget.model);
...@@ -156,7 +166,7 @@ class _BuildItemState extends State<BuildItem> { ...@@ -156,7 +166,7 @@ class _BuildItemState extends State<BuildItem> {
chapterModel.selected = !chapterModel.selected; chapterModel.selected = !chapterModel.selected;
}); });
}, },
child: Container( child: SizedBox(
width: 20.w, width: 20.w,
height: 20.w, height: 20.w,
// color: Colors.red, // color: Colors.red,
......
...@@ -48,36 +48,26 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt ...@@ -48,36 +48,26 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
} }
} }
/// 写入特定数据
void writeData(List<ChapterModel> listA, List<ChapterModel> listB){
for(int i = 0; i < listA.length;i++){
ChapterModel aModel = listA[i];
ChapterModel bModel = listB[i];
if(aModel.id == bModel.id){
// aModel.seen = bModel.seen;
bModel.selected = aModel.selected;
}
writeData(aModel.children!, bModel.children!);
}
}
/// 获取目录信息 /// 获取目录信息
void getChapters() async { void getChapters() async {
final result = await LibraryAPI.chapters(bookId: bookId);
writeData(chapters, result);
// final result = await LibraryAPI.chapters(bookId: bookId); chapters = result;
// for(int index = 0;index < chapters.length;index++){
// ChapterModel oModel = chapters[index];
// ChapterModel nModel = result[index];
// if()
// }
chapters = await LibraryAPI.chapters(bookId: bookId);
// chapters = [
// ChapterModel(name: '第一章',selected: false, children: [
// ChapterModel(name: '第一节',children: [
// ChapterModel(name: '第一小节',children: []),
// ]),
// ChapterModel(name: '第二节',children: [
// ChapterModel(name: '第二小节',children: []),
// ])
// ]),
// ChapterModel(name: '第二章',children: [
// ChapterModel(name: '第一节',children: [
// ChapterModel(name: '第1小节',children: []),
// ]),
// ChapterModel(name: '第一节',children: [
// ChapterModel(name: '第1小节',children: []),
// ])
// ]),
// ];
update(); update();
} }
...@@ -85,12 +75,16 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt ...@@ -85,12 +75,16 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
void getBookDetails() async { void getBookDetails() async {
bookDetails = await LibraryAPI.details(bookId:bookId); bookDetails = await LibraryAPI.details(bookId:bookId);
// 将阅读最后章节写入到数据库 // 将阅读最后章节写入到数据库
try { bool netStatus = await Tools.checkCurrentNetStatus();
final result = await SqlManager.updateReadHistoryByBookId(int.parse(bookId), bookDetails.chapterId!.toInt()); // 有网络的时候才会 存储 其余不存储
Console.log('Sql-------存入数据库读到的章节----------------book_id:$bookId-----chapterId:${bookDetails.chapterId!.toInt()}---------result:$result--'); if (netStatus){
} try {
catch(err){ final result = await SqlManager.updateReadHistoryByBookId(int.parse(bookId), bookDetails.chapterId!.toInt());
Console.log('Sql--------------err------------------$err'); Console.log('Sql-------存入数据库读到的章节----------------book_id:$bookId-----chapterId:${bookDetails.chapterId!.toInt()}---------result:$result--');
}
catch(err){
Console.log('Sql--------------err------------------$err');
}
} }
update(); update();
...@@ -108,14 +102,77 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt ...@@ -108,14 +102,77 @@ class BookDetailController extends GetxController with GetSingleTickerProviderSt
} }
bool result = await CommonAPI.love( bool result = await CommonAPI.love(
bookId: bookId, love: isCollection.toString()); bookId: bookId, love: isCollection.toString());
Console.log('================================$result');
if (result) { if (result) {
getBookDetails(); getBookDetails();
} }
} }
// 获取当前的章节id
Future<String> getCurrentChapterId() async{
String chapterId = '';
bool netStatus = await Tools.checkCurrentNetStatus();
final exist = await _isExistFile(bookId);
if (!netStatus && exist){
chapterId = await SqlManager.queryReadHistoryByBookId(int.parse(bookId));
}
else{
chapterId = bookDetails.chapterId.toString();
}
return chapterId;
}
// 获取当前的章节名称
Future<String> getCurrentChapterName() async{
String chapterName = '';
bool netStatus = await Tools.checkCurrentNetStatus();
final exist = await _isExistFile(bookId);
if (!netStatus && exist){
String chapterId = await SqlManager.queryReadHistoryByBookId(int.parse(bookId));
chapterName = _getChapterName(chapterId);
}
else{
chapterName = bookDetails.chapterName.toString();
}
Console.log('getCurrentChapterName-------------------------------$chapterName-');
return chapterName;
}
// 判断是否存在离线文件
Future<bool> _isExistFile(String bookId) async {
bool existDownFile= false;
String directoryPath = await Tools.getDirectory();
Directory directory = Directory(directoryPath);
bool directoryExists = await directory.exists();
if (directoryExists) {
Console.log('存在名为 "$bookId" 的文件夹');
existDownFile = await Directory('${directory.path}/$bookId').exists();
}
else {
Console.log('不存在名为 "$bookId" 的文件夹');
existDownFile = false;
}
return existDownFile;
}
String _getChapterName(String chapterId){
for (ChapterModel model in chapters){
if ('${model.id}' == chapterId){
return model.name??'';
}
if (model.children !=null){
for (ChapterModel subModel in model.children!){
if ('${subModel.id}' == chapterId){
return subModel.name??'';
}
}
}
}
return '';
}
......
library book_detail; library book_detail;
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_book/apis/index.dart'; import 'package:flutter_book/apis/index.dart';
import 'package:flutter_book/theme.dart'; import 'package:flutter_book/theme.dart';
......
...@@ -143,11 +143,16 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -143,11 +143,16 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
<meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" /> <meta http-equiv="Cache-Control" content="no-siteapp" />
<style> <style>
*{ margin: 0; padding: 5px;} *{ margin: 0px; padding: 5px; font-size:16px}
html{ font-size: 10px;} html{ font-size: 10px;}
body p{ font-size: 1.5rem; line-height:2.4rem;color: #999} body{ padding:0px}
img,video,pre,code{ max-width:100%} body p{ font-size: 1.5rem; line-height:2.4rem;color: #999}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all} img,video,pre,code{ max-width:100%}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all}
hr{background-color: var(--w-e-textarea-border-color); border: 0; display: block; height: 1px}
table, td {border: 1px solid #ccc;border-collapse: collapse;}
ol, ol li{margin:10px}
ul, ul li{margin:10px}
</style> </style>
</head> </head>
<body> <body>
...@@ -204,7 +209,9 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -204,7 +209,9 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
// 1免费 0 不免费 // 1免费 0 不免费
if(controller.bookDetails.isFree == 1){ if(controller.bookDetails.isFree == 1){
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': controller.bookDetails.chapterId.toString(),'chapter_name':controller.bookDetails.chapterName.toString(),'note_id':'0'},extra: controller.bookDetails); final String chapterId = await controller.getCurrentChapterId();
final String chapterName = await controller.getCurrentChapterName();
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (result == true){
controller.getChapters(); controller.getChapters();
} }
...@@ -233,14 +240,20 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -233,14 +240,20 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
} }
} }
else{ else{
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': controller.bookDetails.chapterId.toString(),'chapter_name':controller.bookDetails.chapterName.toString(),'note_id':'0'},extra: controller.bookDetails); final String chapterId = await controller.getCurrentChapterId();
final String chapterName = await controller.getCurrentChapterName();
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (result == true){
controller.getChapters(); controller.getChapters();
} }
} }
} }
else{ else{
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': controller.bookDetails.chapterId.toString(),'chapter_name':controller.bookDetails.chapterName.toString(),'note_id':'0'},extra: controller.bookDetails);
final String chapterId = await controller.getCurrentChapterId();
final String chapterName = await controller.getCurrentChapterName();
final result = await context.pushNamed(Routes.web,queryParameters: {'book_id': controller.bookDetails.bookId.toString(),'chapter_id': chapterId,'chapter_name':chapterName,'note_id':'0'},extra: controller.bookDetails);
if (result == true){ if (result == true){
controller.getChapters(); controller.getChapters();
} }
...@@ -271,5 +284,4 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid ...@@ -271,5 +284,4 @@ class _BookDetailPageState extends State<BookDetailPage> with SingleTickerProvid
} }
} }
...@@ -28,11 +28,16 @@ class HelpCenterContentController extends GetxController { ...@@ -28,11 +28,16 @@ class HelpCenterContentController extends GetxController {
<meta http-equiv="Cache-Control" content="no-transform" /> <meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" /> <meta http-equiv="Cache-Control" content="no-siteapp" />
<style> <style>
*{ margin: 0; padding: 5px;} *{ margin: 0px; padding: 5px; font-size:16px}
html{ font-size: 10px;} html{ font-size: 10px;}
body p{ font-size: 1.5rem; line-height:2.4rem;color: #999} body{ padding:0px}
img,video,pre,code{ max-width:100%} body p{ font-size: 1.5rem; line-height:2.4rem;color: #999}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all} img,video,pre,code{ max-width:100%}
pre{white-space: pre-wrap;word-wrap: break-word;word-break: break-all}
hr{background-color: var(--w-e-textarea-border-color); border: 0; display: block; height: 1px}
table, td {border: 1px solid #ccc;border-collapse: collapse;}
ol, ol li{margin:10px}
ul, ul li{margin:10px}
</style> </style>
</head> </head>
<body> <body>
......
...@@ -68,9 +68,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -68,9 +68,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
@override @override
void onInit() { void onInit() {
// 获取分类数据
_getTabs();
_controller = AnimationController( _controller = AnimationController(
vsync: this, vsync: this,
duration: const Duration(milliseconds: 100), duration: const Duration(milliseconds: 100),
...@@ -84,8 +81,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -84,8 +81,10 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
void onReady() async { void onReady() async {
// 获取标签数据 // 获取标签数据
_getLabels(); _getLabels();
// 获取分类数据
_getTabs();
// 获取广告数据
_getAds(); _getAds();
onRefresh();
// Map<String, dynamic> data = { // Map<String, dynamic> data = {
// 'types': 1, // 'types': 1,
...@@ -207,7 +206,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{ ...@@ -207,7 +206,6 @@ class LibraryController extends GetxController with GetTickerProviderStateMixin{
filterCategories = categories.map((model) { filterCategories = categories.map((model) {
return FilterModel(id: model.categoryId.toString(), name: model.name??'',selected: model.selected); return FilterModel(id: model.categoryId.toString(), name: model.name??'',selected: model.selected);
}).toList(); }).toList();
print('===========$filterCategories');
update(); update();
} }
......
...@@ -85,13 +85,18 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -85,13 +85,18 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
late SearchAllModel sModel = SearchAllModel(bookId: '0'); late SearchAllModel sModel = SearchAllModel(bookId: '0');
// 本地文件地址
String localHtml5Path = '';
///------------------------------------------ 页面 生命周期-------------------------------------------------------- ///------------------------------------------ 页面 生命周期--------------------------------------------------------
@override @override
void onInit() { void onInit() async {
initTts(); initTts();
netStatus = await Tools.checkCurrentNetStatus();
discussTitleFocusNode.addListener(_onCommentFocusChanged); discussTitleFocusNode.addListener(_onCommentFocusChanged);
await ScreenProtector.preventScreenshotOn();
super.onInit(); super.onInit();
} }
...@@ -103,18 +108,12 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -103,18 +108,12 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
netStatus = await Tools.checkCurrentNetStatus(); netStatus = await Tools.checkCurrentNetStatus();
final exist = await _isExistFile(bookId); final exist = await _isExistFile(bookId);
// chapterId = await SqlManager.queryReadHistoryByBookId(int.parse(bookId));
// Console.log('数据库中得到最后阅读的章节----------------------$chapterId----------');
if (!netStatus && exist){ if (!netStatus && exist){
// 1、从数据库中获取读到那个章节
chapterId = await SqlManager.queryReadHistoryByBookId(int.parse(bookId)); // 1、通过 chapterId 获取 对应离线的 html路径
Console.log('Sql-----------数据库中得到最后阅读的章节----------------------$chapterId----------');
chapterName = getChapterName(chapterId);
// 2、通过 chapterId 获取 对应离线的 html路径
String toReadHtmlPath = await getLocalReadHtml(chapterId); String toReadHtmlPath = await getLocalReadHtml(chapterId);
// 3、开始读书 // 2、开始读书
read(toReadHtmlPath); read(toReadHtmlPath);
// 获取当前 文件名称 // 获取当前 文件名称
...@@ -127,7 +126,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -127,7 +126,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
} }
@override @override
void onClose() { void onClose() async {
// 上报阅读结束时间 // 上报阅读结束时间
_addReadTime(type: 'close'); _addReadTime(type: 'close');
discussTitleFocusNode.removeListener(_onCommentFocusChanged); discussTitleFocusNode.removeListener(_onCommentFocusChanged);
...@@ -136,6 +135,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -136,6 +135,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
contentInput.dispose(); contentInput.dispose();
flutterTts.stop(); flutterTts.stop();
searchInput.dispose(); searchInput.dispose();
await ScreenProtector.preventScreenshotOff();
super.onClose(); super.onClose();
} }
///------------------------------------------ 页面 生命周期-------------------------------------------------------- ///------------------------------------------ 页面 生命周期--------------------------------------------------------
...@@ -304,13 +304,14 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -304,13 +304,14 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
startRecording = true; startRecording = true;
String filePath = await Tools.getDirectory(); String filePath = await Tools.getDirectory();
String fileName = Tools.generateVoiceFileName(); String fileName = Tools.generateVoiceFileName();
Console.log('record---------------------$filePath/$fileName');
_mRecorder.startRecorder( _mRecorder.startRecorder(
toFile: '$filePath/$fileName', toFile: '$filePath/$fileName',
audioSource: AudioSource.microphone, audioSource: AudioSource.microphone,
codec: Codec.aacMP4, codec: Codec.aacMP4,
); );
// _mRecorder?.setSubscriptionDuration(Duration(milliseconds: 100)); // _mRecorder?.setSubscriptionDuration(Duration(milliseconds: 100));
// _mRecorder?.onProgress?.listen((e) // _mRecorder?.onProgress?.listen((e)
// { // {
...@@ -325,10 +326,13 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -325,10 +326,13 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
void stopRecorder() async{ void stopRecorder() async{
startRecording = false; startRecording = false;
final path = await _mRecorder.stopRecorder(); final path = await _mRecorder.stopRecorder();
Console.log('stopRecorder-----------path---------------------$path');
var duration = await audioPlayer.setFilePath(path!); var duration = await audioPlayer.setFilePath(path!);
Console.log('-----duration---------------------$duration------'); Console.log('-----duration---------------------$duration------');
AudioModel audioModel = AudioModel(path: path,duration: Tools.formatDuration(duration!),currentDuration: '0:00:00'); AudioModel audioModel = AudioModel(path: path,duration: Tools.formatDuration(duration!),currentDuration: '0:00:00');
discussInputAudios.add(audioModel); if(audioModel.duration !='0:00:00'){
discussInputAudios.add(audioModel);
}
update(); update();
} }
...@@ -450,6 +454,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -450,6 +454,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
final status = await Tools.checkCurrentNetStatus(); final status = await Tools.checkCurrentNetStatus();
// 有网情况下 先直传oss 获取到url // 有网情况下 先直传oss 获取到url
if (status){ if (status){
CustomToast.loading();
// 循环上传图片获取地址 // 循环上传图片获取地址
for(String path in discussInputImages){ for(String path in discussInputImages){
final url = await upload(path: path); final url = await upload(path: path);
...@@ -461,6 +466,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -461,6 +466,7 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
final url = await upload(path: model.path); final url = await upload(path: model.path);
audios.add(url); audios.add(url);
} }
CustomToast.dismiss();
} }
// 没有网的情况下 存储到本地数据库 // 没有网的情况下 存储到本地数据库
else{ else{
...@@ -688,10 +694,20 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide ...@@ -688,10 +694,20 @@ class ReadController extends FullLifeCycleController with GetSingleTickerProvide
File file = File(writeFilePath); File file = File(writeFilePath);
// 7、将HTML内容写入文件 // 7、将HTML内容写入文件
await file.writeAsString(htmlStr); await file.writeAsString(htmlStr);
localHtml5Path = writeFilePath;
String url = writeFilePath;
if(Platform.isIOS){
url = 'file://$writeFilePath';
}
webViewController.loadUrl(urlRequest: URLRequest( webViewController.loadUrl(urlRequest: URLRequest(
// url: Uri.parse(writeFilePath), // url: Uri.parse(writeFilePath),
url: WebUri.uri(Uri.parse(writeFilePath)) url: WebUri.uri(Uri.parse(url))
)); ));
final result = await SqlManager.updateReadHistoryByBookId(int.parse(bookId), int.parse(chapterId));
Console.log('Sql----readread---存入数据库读到的章节----------------book_id:$bookId-----chapterId:$chapterId---------result:$result--');
queryLocalNote(); queryLocalNote();
} }
......
...@@ -26,6 +26,7 @@ import 'package:just_audio/just_audio.dart' as just_audio; ...@@ -26,6 +26,7 @@ import 'package:just_audio/just_audio.dart' as just_audio;
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'dart:async'; import 'dart:async';
import 'package:plugin_platform_interface/plugin_platform_interface.dart'; import 'package:plugin_platform_interface/plugin_platform_interface.dart';
import 'package:screen_protector/screen_protector.dart';
import 'package:sqflite/sqflite.dart'; import 'package:sqflite/sqflite.dart';
import '../../apis/index.dart'; import '../../apis/index.dart';
......
...@@ -30,6 +30,7 @@ class _ReadPageState extends State<ReadPage> { ...@@ -30,6 +30,7 @@ class _ReadPageState extends State<ReadPage> {
return WillPopScope( return WillPopScope(
onWillPop: () async { onWillPop: () async {
context.pop(true); context.pop(true);
CustomToast.dismiss();
return false; return false;
}, },
child: GetBuilder<ReadController>( child: GetBuilder<ReadController>(
...@@ -69,9 +70,9 @@ class _ReadPageState extends State<ReadPage> { ...@@ -69,9 +70,9 @@ class _ReadPageState extends State<ReadPage> {
child: Stack( child: Stack(
children: [ children: [
InAppWebView( InAppWebView(
initialUrlRequest: URLRequest( initialUrlRequest:URLRequest(
// url: Uri.parse(kReadBook), // url: Uri.parse(kReadBook),
url: WebUri.uri(Uri.parse(kReadBook)) url: readController.localHtml5Path.isNotEmpty?WebUri.uri(Uri.parse(readController.localHtml5Path)): WebUri.uri(Uri.parse(kReadBook))
// url: Uri.parse("/storage/emulated/0/Android/data/com.zijin.book.flutter_book/files/174/7-325.html"), // url: Uri.parse("/storage/emulated/0/Android/data/com.zijin.book.flutter_book/files/174/7-325.html"),
), ),
initialSettings:InAppWebViewSettings( initialSettings:InAppWebViewSettings(
......
...@@ -34,7 +34,7 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> { ...@@ -34,7 +34,7 @@ class _ReadCategoryPageState extends State<ReadCategoryPage> {
widget.onTap!(); widget.onTap!();
}, },
child: Container( child: Container(
// color: Colors.red, color: Colors.white,
padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 15.w,bottom: 15.w), padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 15.w,bottom: 15.w),
child: Image.asset('assets/images/close.png') child: Image.asset('assets/images/close.png')
), ),
......
...@@ -35,7 +35,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> { ...@@ -35,7 +35,7 @@ class _ReadDiscussPageState extends State<ReadDiscussPage> {
widget.onTap!(); widget.onTap!();
}, },
child: Container( child: Container(
// color: Colors.red, color: Colors.white,
padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 15.w,bottom: 15.w), padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 15.w,bottom: 15.w),
child: Image.asset('assets/images/close.png') child: Image.asset('assets/images/close.png')
), ),
......
...@@ -98,7 +98,18 @@ class _BuildItemState extends State<BuildItem> { ...@@ -98,7 +98,18 @@ class _BuildItemState extends State<BuildItem> {
/// 章节名称容器 /// 章节名称容器
GestureDetector( GestureDetector(
onTap: (){ onTap: (){
widget.onTapChapter(chapterModel); if(chapterModel.children!.isEmpty){
widget.onTapChapter(chapterModel);
}
else{
setState(() {
chapterModel.selected = !chapterModel.selected;
});
}
// // widget.onTapChapter(chapterModel);
// setState(() {
// chapterModel.selected = !chapterModel.selected;
// });
// // 如果章下面没有节 点击才会跳转 // // 如果章下面没有节 点击才会跳转
// if (widget.model.children!.isEmpty){ // if (widget.model.children!.isEmpty){
// widget.onTap(widget.model); // widget.onTap(widget.model);
......
...@@ -33,7 +33,7 @@ class _ReadNotePageState extends State<ReadNotePage> { ...@@ -33,7 +33,7 @@ class _ReadNotePageState extends State<ReadNotePage> {
widget.onTap!(); widget.onTap!();
}, },
child: Container( child: Container(
// color: Colors.red, color: Colors.white,
padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 15.w,bottom: 15.w), padding: EdgeInsets.only(left: 15.w,right: 15.w,top: 15.w,bottom: 15.w),
child: Image.asset('assets/images/close.png') child: Image.asset('assets/images/close.png')
), ),
......
...@@ -42,23 +42,25 @@ class BuildItem extends StatelessWidget { ...@@ -42,23 +42,25 @@ class BuildItem extends StatelessWidget {
height: 86.w, height: 86.w,
url: model.img??'', url: model.img??'',
), ),
Container( Expanded(
height: 87.w, child: Container(
margin: EdgeInsets.only(left: 13.w), height: 87.w,
// color: Colors.green, margin: EdgeInsets.only(left: 13.w),
child: Column( // color: Colors.green,
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),), children: [
Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),), Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),),
], Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),overflow: TextOverflow.ellipsis,maxLines: 2,),
), ],
Text('${model.commentNum.toString()}个讨论',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)), ),
], Text('${model.commentNum.toString()}个讨论',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)),
],
),
), ),
) )
], ],
......
...@@ -245,25 +245,23 @@ class _BuildDiscussState extends State<BuildDiscuss> { ...@@ -245,25 +245,23 @@ class _BuildDiscussState extends State<BuildDiscuss> {
String text = ''; String text = '';
// 是我的 // 是我的
if(discussModel.isMy == 1){ if(discussModel.isMy == 1){
if(discussModel.commentsCheck == 1){
// 审核中
if(discussModel.content?.text?.privacyStatus ==0 ||discussModel.content?.text?.privacyStatus ==2 ||discussModel.status == 0){
text = '(审核中)';
}
// 审核未通过
else if(discussModel.content?.text?.privacyStatus ==-1 ||discussModel.status == 2){
text = '(审核未通过)';
}
}else{
// 审核中
if(discussModel.content?.text?.privacyStatus ==0 ||discussModel.content?.text?.privacyStatus ==2){
text = '(审核中)';
}
// 审核未通过
else if(discussModel.content?.text?.privacyStatus ==-1){
text = '(审核未通过)';
}
if(discussModel.privacyStatus ==-1){
text = '(审核未通过)';
}
else if(discussModel.privacyStatus ==0){
text = '(审核中)';
}
else if(discussModel.privacyStatus ==1){
if(discussModel.commentsCheck == 1){
if(discussModel.status == 0){
text = '(审核中)';
}
else if(discussModel.status == 2){
text = '(审核未通过)';
}
}
} }
} }
return text; return text;
...@@ -273,25 +271,23 @@ class _BuildDiscussState extends State<BuildDiscuss> { ...@@ -273,25 +271,23 @@ class _BuildDiscussState extends State<BuildDiscuss> {
String text = ''; String text = '';
// 是我的 // 是我的
if(discussModel.isMy == 1){ if(discussModel.isMy == 1){
if(discussModel.commentsCheck == 1){
// 审核中
if(mediaModel?.privacyStatus ==0 ||mediaModel?.privacyStatus ==2 ||discussModel.status == 0){
text = '(审核中)';
}
// 审核未通过
else if(mediaModel?.privacyStatus ==-1 ||discussModel.status == 2){
text = '(审核未通过)';
}
}else{
// 审核中
if(mediaModel?.privacyStatus ==0 ||mediaModel?.privacyStatus ==2){
text = '(审核中)';
}
// 审核未通过
else if(mediaModel?.privacyStatus ==-1){
text = '(审核未通过)';
}
if(discussModel.privacyStatus ==-1){
text = '(审核未通过)';
}
else if(discussModel.privacyStatus ==0){
text = '(审核中)';
}
else if(discussModel.privacyStatus ==1){
if(discussModel.commentsCheck == 1){
if(discussModel.status == 0){
text = '(审核中)';
}
else if(discussModel.status == 2){
text = '(审核未通过)';
}
}
} }
} }
return text; return text;
......
...@@ -37,23 +37,25 @@ class BuildItem extends StatelessWidget { ...@@ -37,23 +37,25 @@ class BuildItem extends StatelessWidget {
height: 86.w, height: 86.w,
url: model.img??'', url: model.img??'',
), ),
Container( Expanded(
height: 87.w, child: Container(
margin: EdgeInsets.only(left: 13.w), height: 87.w,
// color: Colors.green, margin: EdgeInsets.only(left: 13.w),
child: Column( // color: Colors.green,
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),), children: [
Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),), Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),),
], Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),overflow: TextOverflow.ellipsis,maxLines: 2,),
), ],
Text('${model.commentNum.toString()}个讨论',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)), ),
], Text('${model.commentNum.toString()}个讨论',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)),
],
),
), ),
) )
], ],
......
...@@ -37,23 +37,25 @@ class BuildItem extends StatelessWidget { ...@@ -37,23 +37,25 @@ class BuildItem extends StatelessWidget {
height: 86.w, height: 86.w,
url: model.img??'', url: model.img??'',
), ),
Container( Expanded(
height: 87.w, child: Container(
margin: EdgeInsets.only(left: 13.w), height: 87.w,
// color: Colors.green, margin: EdgeInsets.only(left: 13.w),
child: Column( // color: Colors.green,
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),), children: [
Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),), Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),),
], Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),overflow: TextOverflow.ellipsis,maxLines: 2,),
), ],
Text('${model.notesNum.toString()}个笔记',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)), ),
], Text('${model.notesNum.toString()}个笔记',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)),
],
),
), ),
) )
], ],
......
...@@ -37,23 +37,25 @@ class BuildItem extends StatelessWidget { ...@@ -37,23 +37,25 @@ class BuildItem extends StatelessWidget {
height: 86.w, height: 86.w,
url: model.img??'', url: model.img??'',
), ),
Container( Expanded(
height: 87.w, child: Container(
margin: EdgeInsets.only(left: 13.w), height: 87.w,
// color: Colors.green, margin: EdgeInsets.only(left: 13.w),
child: Column( // color: Colors.green,
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Column(
crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Column( children: [
crossAxisAlignment: CrossAxisAlignment.start, Column(
children: [ crossAxisAlignment: CrossAxisAlignment.start,
Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),), children: [
Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),), Text(model.bookName??'',style: TextStyle(fontSize: 14.w,height: 1.5,fontWeight: Fonts.medium,color: Colours.c3),),
], Text(model.authors??'',style: TextStyle(fontSize: 12.w,height: 1.5,color: Colours.c6),overflow: TextOverflow.ellipsis,maxLines: 2,),
), ],
Text('${model.notesNum.toString()}个笔记',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)), ),
], Text('${model.notesNum.toString()}个笔记',style: TextStyle(fontSize: 11.w,height: 1.5,color: AppTheme.primary)),
],
),
), ),
) )
], ],
......
...@@ -63,7 +63,7 @@ class BuildNote extends StatelessWidget { ...@@ -63,7 +63,7 @@ class BuildNote extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Row( _showText(model).isEmpty?const SizedBox():Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text(_showText(model),style: TextStyle( Text(_showText(model),style: TextStyle(
......
...@@ -343,10 +343,10 @@ class _CacheInterceptor extends Interceptor { ...@@ -343,10 +343,10 @@ class _CacheInterceptor extends Interceptor {
final status = await Tools.checkCurrentNetStatus(); final status = await Tools.checkCurrentNetStatus();
if (cacheEnabled && !status) { if (cacheEnabled && !status) {
// 在发起请求之前,检查缓存是否存在有效数据 // 在发起请求之前,检查缓存是否存在有效数据
String cacheKey = options.data.isEmpty ? options.uri.toString() : '${options.uri.toString()}?${options.data}'; String cacheKey = '${options.uri.toString()}?${options.data}';
final cachedFile = await DefaultCacheManager().getFileFromCache(cacheKey); final cachedFile = await DefaultCacheManager().getFileFromCache(cacheKey);
Console.log('获取数据----------cacheKey-----------------------$cacheKey');
if (cachedFile != null && cachedFile.validTill.isAfter(DateTime.now())) { if (cachedFile != null && cachedFile.validTill.isAfter(DateTime.now())) {
Console.log('-获取数据cachedFile------------------------------$cachedFile-');
// 如果缓存有效,直接返回缓存数据 // 如果缓存有效,直接返回缓存数据
final cachedData = await cachedFile.file.readAsBytes(); final cachedData = await cachedFile.file.readAsBytes();
final decodedData = utf8.decode(cachedData); // 将字节列表解码为字符串 final decodedData = utf8.decode(cachedData); // 将字节列表解码为字符串
...@@ -383,7 +383,7 @@ class _CacheInterceptor extends Interceptor { ...@@ -383,7 +383,7 @@ class _CacheInterceptor extends Interceptor {
cacheKey, cacheKey,
uint8List, uint8List,
fileExtension: '.json', // 可以根据需求修改文件扩展名 fileExtension: '.json', // 可以根据需求修改文件扩展名
maxAge: const Duration(hours: 1) maxAge: const Duration(hours: 12)
); );
} catch (e) { } catch (e) {
Console.log('Error caching response: $e'); Console.log('Error caching response: $e');
......
...@@ -53,8 +53,10 @@ class SqlManager { ...@@ -53,8 +53,10 @@ class SqlManager {
static Future<Database?> getCurrentDatabase() async { static Future<Database?> getCurrentDatabase() async {
if (_database == null) { if (_database == null) {
Console.log('Sql-------------getCurrentDatabase---------------_database == null----');
await init(); await init();
} }
Console.log('Sql-------------getCurrentDatabase---------------$_database');
return _database; return _database;
} }
...@@ -146,18 +148,29 @@ class SqlManager { ...@@ -146,18 +148,29 @@ class SqlManager {
} }
// 根据 book_id 查询当前读到的 章节 // 根据 book_id 查询当前读到的 章节
static Future<String> queryReadHistoryByBookId(int bookId) async { static Future<String> queryReadHistoryByBookId(int bookId) async {
Database? db = await SqlManager.getCurrentDatabase(); try {
List<Map<String, dynamic>>? results = await db?.query( Database? db = await SqlManager.getCurrentDatabase();
'read_history', if (!db!.isOpen){
where: 'book_id = ?', await init();
whereArgs: [bookId], }
); List<Map<String, dynamic>>? results = await db?.query(
return results?.first['chapter_id'].toString() ?? ''; 'read_history',
where: 'book_id = ?',
whereArgs: [bookId],
);
return results?.first['chapter_id'].toString() ?? '';
}
catch(e){
Console.log('Error querying read history by book id: $e');
return '';
}
} }
// 根据 book_id 写入当前读到的 章节 // 根据 book_id 写入当前读到的 章节
static Future<int> updateReadHistoryByBookId(int bookId ,int chapterId) async { static Future<int> updateReadHistoryByBookId(int bookId ,int chapterId) async {
Database? db = await SqlManager.getCurrentDatabase(); Database? db = await SqlManager.getCurrentDatabase();
final queryResult = await queryReadHistoryByBookId(bookId); final queryResult = await queryReadHistoryByBookId(bookId);
if (queryResult.isEmpty){ if (queryResult.isEmpty){
Console.log('Sql----------没有当前书籍的数据----------------------'); Console.log('Sql----------没有当前书籍的数据----------------------');
...@@ -171,14 +184,14 @@ class SqlManager { ...@@ -171,14 +184,14 @@ class SqlManager {
} }
else{ else{
Console.log('Sql----------有当前书籍的数据----------------------'); Console.log('Sql----------有当前书籍的数据----------------------');
final result = await db!.update( final result = await db?.update(
'read_history', 'read_history',
{'chapter_id':chapterId}, {'chapter_id':chapterId},
where: 'book_id = ?', where: 'book_id = ?',
whereArgs: [bookId], whereArgs: [bookId],
); );
Console.log('Sql----------更新数据结果:$result----------------------'); Console.log('Sql----------更新数据结果:$result----------------------');
return result; return result??0;
} }
} }
......
...@@ -38,7 +38,7 @@ abstract class Tools { ...@@ -38,7 +38,7 @@ abstract class Tools {
static Future<String> getDirectory() async { static Future<String> getDirectory() async {
// getTemporaryDirectory // getTemporaryDirectory
final directory = await getExternalStorageDirectory(); final directory = await getTemporaryDirectory();
return directory!.path; return directory!.path;
} }
......
...@@ -857,10 +857,18 @@ packages: ...@@ -857,10 +857,18 @@ packages:
dependency: transitive dependency: transitive
description: description:
name: rxdart name: rxdart
sha256: "0c7c0cedd93788d996e33041ffecda924cc54389199cde4e6a34b440f50044cb" sha256: "2ef8b4e91cb3b55d155e0e34eeae0ac7107974e451495c955ac04ddee8cc21fd"
url: "https://pub.flutter-io.cn" url: "https://pub.flutter-io.cn"
source: hosted source: hosted
version: "0.27.7" version: "0.26.0"
screen_protector:
dependency: "direct main"
description:
name: screen_protector
sha256: "541bdcd341de1e38026b5b94cc2a74cd95299d2c51150735165c4b445fa0209a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.4.2"
scrollable_positioned_list: scrollable_positioned_list:
dependency: transitive dependency: transitive
description: description:
......
...@@ -119,6 +119,9 @@ dependencies: ...@@ -119,6 +119,9 @@ dependencies:
device_info_plus: ^9.1.2 device_info_plus: ^9.1.2
# 安卓 # 安卓
android_id: ^0.3.6 android_id: ^0.3.6
# 防止截屏
# secure_application: ^3.8.0
screen_protector: ^1.4.2
dev_dependencies: dev_dependencies:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论