diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index e4c7c203..4f77e0fd 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -8,7 +8,6 @@ /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; 333E5DAE7FC10AC69FEC26C0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = DDA792F029EDD7A11295D192 /* libPods-Runner.a */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; @@ -40,7 +39,6 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -90,7 +88,6 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( - 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 9740EEBA1CF902C7004384FC /* Flutter.framework */, @@ -210,7 +207,6 @@ 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, ); runOnlyForDeploymentPostprocessing = 0; diff --git a/lib/model/collection_general.dart b/lib/model/collection_general.dart index 9e23674d..18367092 100644 --- a/lib/model/collection_general.dart +++ b/lib/model/collection_general.dart @@ -50,7 +50,6 @@ class CollectionControlModel { List list = await sql.getByCondition(); List resultList = []; list.forEach((item){ - print(item); resultList.add(CollectionGeneral.fromJSON(item)); }); return resultList; diff --git a/lib/views/collection_page.dart b/lib/views/collection_page.dart index b1e0fe60..af417ad7 100644 --- a/lib/views/collection_page.dart +++ b/lib/views/collection_page.dart @@ -104,7 +104,7 @@ class _CollectionPageState extends State { color: Theme.of(context).primaryColor, ), title: Text( - _collectionList[index - 1].name, + Uri.decodeComponent(_collectionList[index - 1].name), overflow: TextOverflow.ellipsis, style: TextStyle(fontSize: 17.0), ), @@ -112,8 +112,9 @@ class _CollectionPageState extends State { Icon(Icons.keyboard_arrow_right, color: Colors.grey, size: 30.0), onTap: () { if (_collectionList[index - 1].router.contains('http')) { + // 注意这里title已经转义过了 Application.router.navigateTo(context, - '${Routes.webViewPage}?title=${Uri.encodeComponent(_collectionList[index - 1].name)}&url=${Uri.encodeComponent(_collectionList[index - 1].router)}'); + '${Routes.webViewPage}?title=${_collectionList[index - 1].name}&url=${Uri.encodeComponent(_collectionList[index - 1].router)}'); } else { Application.router .navigateTo(context, "${_collectionList[index - 1].router}"); diff --git a/lib/views/web_view_page.dart b/lib/views/web_view_page.dart index 27b0eb78..1cbbe1a0 100644 --- a/lib/views/web_view_page.dart +++ b/lib/views/web_view_page.dart @@ -10,6 +10,7 @@ import '../model/collection.dart'; import '../event/event-bus.dart'; import '../event/event-model.dart'; import 'package:fluttertoast/fluttertoast.dart'; +import 'dart:core'; class WebViewPage extends StatefulWidget { final String url; @@ -38,7 +39,7 @@ class _WebViewPageState extends State { @override void initState() { super.initState(); - _collectionControl.getRouterByName(widget.title.trim()).then((list) { + _collectionControl.getRouterByName(Uri.encodeComponent(widget.title.trim())).then((list) { list.forEach((item) { if(widget.title.trim() == item['name']){ @@ -57,7 +58,7 @@ class _WebViewPageState extends State { _getCollection() { if (_hasCollected) { // 删除操作 - _collectionControl.deleteByName(widget.title.trim()).then((result) { + _collectionControl.deleteByName(Uri.encodeComponent(widget.title.trim())).then((result) { if (result > 0 && this.mounted) { setState(() { _hasCollected = false; @@ -75,7 +76,7 @@ class _WebViewPageState extends State { } else { // 插入操作 _collectionControl - .insert(Collection(name: widget.title.trim(), router: widget.url)) + .insert(Collection(name:Uri.encodeComponent(widget.title.trim()) , router: widget.url)) .then((result) { if (this.mounted) { setState(() {