From 397a296fe3a3c79ce606648ef95c92981df01b11 Mon Sep 17 00:00:00 2001 From: yuluo Date: Fri, 22 Oct 2021 17:24:06 +0800 Subject: [PATCH 1/4] save --- douban_app/ios/Flutter/Debug.xcconfig | 1 + douban_app/ios/Flutter/Release.xcconfig | 1 + douban_app/ios/Podfile | 41 ++++++++++ .../lib/models/book_av/book_rank_card.dart | 28 +++++++ douban_app/lib/models/book_av/rank_list.dart | 22 ++++++ .../book/tab_pages/read/book_card_list.dart | 12 ++- .../lib/views/book/tab_pages/read/index.dart | 78 +++++++++++++++++-- .../book/tab_pages/read/rank_list_card.dart | 15 ++-- .../lib/views/book/tab_pages/story/index.dart | 9 +++ douban_app/lib/views/web_view/index.dart | 9 +++ douban_app/models.jsonc | 55 +++++++++++++ douban_app/pubspec.yaml | 1 + 12 files changed, 253 insertions(+), 19 deletions(-) create mode 100644 douban_app/ios/Podfile create mode 100644 douban_app/lib/models/book_av/book_rank_card.dart create mode 100644 douban_app/lib/models/book_av/rank_list.dart create mode 100644 douban_app/lib/views/book/tab_pages/story/index.dart create mode 100644 douban_app/lib/views/web_view/index.dart create mode 100644 douban_app/models.jsonc diff --git a/douban_app/ios/Flutter/Debug.xcconfig b/douban_app/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/douban_app/ios/Flutter/Debug.xcconfig +++ b/douban_app/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/douban_app/ios/Flutter/Release.xcconfig b/douban_app/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/douban_app/ios/Flutter/Release.xcconfig +++ b/douban_app/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/douban_app/ios/Podfile b/douban_app/ios/Podfile new file mode 100644 index 0000000..1e8c3c9 --- /dev/null +++ b/douban_app/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end diff --git a/douban_app/lib/models/book_av/book_rank_card.dart b/douban_app/lib/models/book_av/book_rank_card.dart new file mode 100644 index 0000000..7955de8 --- /dev/null +++ b/douban_app/lib/models/book_av/book_rank_card.dart @@ -0,0 +1,28 @@ +import 'rank_list.dart'; + +class BookRankCard { + String mainTitle; + String subTitle; + String backgroundImageUrl; + List rankList; + + BookRankCard({this.mainTitle, this.subTitle, this.backgroundImageUrl, this.rankList}); + + factory BookRankCard.fromJson(Map json) => BookRankCard( + mainTitle: json['mainTitle'] as String, + subTitle: json['subTitle'] as String, + backgroundImageUrl: json['backgroundImageUrl'] as String, + rankList: (json['rankList'] as List) + ?.map((e) => e == null + ? null + : RankList.fromJson(e as Map)) + ?.toList(), + ); + + Map toJson() => { + 'mainTitle': mainTitle, + 'subTitle': subTitle, + 'backgroundImageUrl': backgroundImageUrl, + 'rankList': rankList?.map((e) => e?.toJson())?.toList(), + }; +} diff --git a/douban_app/lib/models/book_av/rank_list.dart b/douban_app/lib/models/book_av/rank_list.dart new file mode 100644 index 0000000..20aa331 --- /dev/null +++ b/douban_app/lib/models/book_av/rank_list.dart @@ -0,0 +1,22 @@ +class RankList { + String index; + String bookCoverUrl; + String bookName; + double ranking; + + RankList({this.index, this.bookCoverUrl, this.bookName, this.ranking}); + + factory RankList.fromJson(Map json) => RankList( + index: json['index'] as String, + bookCoverUrl: json['bookCoverUrl'] as String, + bookName: json['bookName'] as String, + ranking: json['ranking'] as double, + ); + + Map toJson() => { + 'index': index, + 'bookCoverUrl': bookCoverUrl, + 'bookName': bookName, + 'ranking': ranking, + }; +} diff --git a/douban_app/lib/views/book/tab_pages/read/book_card_list.dart b/douban_app/lib/views/book/tab_pages/read/book_card_list.dart index 4602423..9c0fc89 100644 --- a/douban_app/lib/views/book/tab_pages/read/book_card_list.dart +++ b/douban_app/lib/views/book/tab_pages/read/book_card_list.dart @@ -1,8 +1,12 @@ import 'package:douban_app/components/create_star/create_star.dart'; +import 'package:douban_app/models/book_av/rank_list.dart'; import 'package:flutter/material.dart'; class BookCardListItem extends StatefulWidget { + final RankList _rankList; + BookCardListItem(this._rankList); + @override _BookCardListItemState createState() => _BookCardListItemState(); } @@ -19,7 +23,7 @@ class _BookCardListItemState extends State { width: 24, margin: EdgeInsets.only(right: 10), child: Center( - child: Text('1', style: TextStyle(color: Colors.white, fontSize: 18),), + child: Text(widget._rankList.index, style: TextStyle(color: Colors.white, fontSize: 18),), ), ), Container( @@ -28,7 +32,7 @@ class _BookCardListItemState extends State { margin: EdgeInsets.only(right: 10), decoration: BoxDecoration( image: DecorationImage( - image: NetworkImage('https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2561716440.jpg') + image: NetworkImage(widget._rankList.bookCoverUrl) ) ), ), @@ -36,9 +40,9 @@ class _BookCardListItemState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text('索拉里斯星', style: TextStyle(color: Colors.white, fontSize: 16),), + Text(widget._rankList.bookName, style: TextStyle(color: Colors.white, fontSize: 16),), SizedBox(height: 6,), - CreateStar(rating: 8.7,starSize: 16,) + CreateStar(rating: widget._rankList.ranking,starSize: 16,) ], ), ) diff --git a/douban_app/lib/views/book/tab_pages/read/index.dart b/douban_app/lib/views/book/tab_pages/read/index.dart index f6e2511..87af401 100644 --- a/douban_app/lib/views/book/tab_pages/read/index.dart +++ b/douban_app/lib/views/book/tab_pages/read/index.dart @@ -1,3 +1,4 @@ +import 'package:douban_app/models/book_av/book_rank_card.dart'; import 'package:douban_app/models/book_av/new_book.dart'; import 'package:douban_app/service/http_book_av.dart'; import 'package:douban_app/utils/my_icon.dart'; @@ -31,9 +32,63 @@ const List> mockData = [ } ]; +const List> doubanRankMockData = [ + { + 'mainTitle': '一周热门图书榜', + 'subTitle': '豆瓣榜单', + 'backgroundImageUrl': 'https://tenfei05.cfp.cn/creative/vcg/800/new/VCG211320865019.jpg', + 'rankList': [ + { + 'index': '1', + 'bookCoverUrl': 'https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2561716440.jpg', + 'bookName': '霸王别姬', + 'ranking': 9.0 + }, + { + 'index': '2', + 'bookCoverUrl': 'https://img9.doubanio.com/view/subject/s/public/s33958826.jpg', + 'bookName': '拯救计划', + 'ranking': 6.0 + }, + { + 'index': '3', + 'bookCoverUrl': 'https://img1.doubanio.com/view/subject/s/public/s34003939.jpg', + 'bookName': '电子游戏微历史', + 'ranking': 8.0 + }, + ] + }, + { + 'mainTitle': '豆瓣读书排行', + 'subTitle': '豆瓣榜单', + 'backgroundImageUrl': 'https://tenfei05.cfp.cn/creative/vcg/800/new/VCG41160533664.jpg', + 'rankList': [ + { + 'index': '1', + 'bookCoverUrl': 'https://img3.doubanio.com/view/subject/s/public/s33974760.jpg', + 'bookName': '诸子百家', + 'ranking': 9.0 + }, + { + 'index': '2', + 'bookCoverUrl': 'https://img2.doubanio.com/view/subject/s/public/s33979743.jpg', + 'bookName': '电力商人', + 'ranking': 8.0 + }, + { + 'index': '3', + 'bookCoverUrl': 'https://img2.doubanio.com/view/subject/s/public/s34005071.jpg', + 'bookName': '再见妖精', + 'ranking': 8.0 + }, + ] + }, +]; + class _TabReadState extends State { - List books = []; + List books = []; + List bookRankCard = []; // 实例化请求 BookAvRequest bookAvRequest = BookAvRequest(); @@ -47,6 +102,9 @@ class _TabReadState extends State { for (var item in mockData) { books.add(NewBook.fromJson(item)); } + for (var item in doubanRankMockData) { + bookRankCard.add(BookRankCard.fromJson(item)); + } } String currentTabItem = '全部'; @@ -117,12 +175,18 @@ class _TabReadState extends State { Container( margin: EdgeInsets.only(top: 20), height: 250, - child: ListView( - scrollDirection: Axis.horizontal, - children: [ - RankList() - ], - ), + child: ListView.separated( + scrollDirection: Axis.horizontal, + itemBuilder: (ctx, index) { + return RankList(bookRankCard[index]); + }, + separatorBuilder: (ctx, index) { + return VerticalDivider( + width: 10, + ); + }, + itemCount: bookRankCard.length + ) ) ], ) diff --git a/douban_app/lib/views/book/tab_pages/read/rank_list_card.dart b/douban_app/lib/views/book/tab_pages/read/rank_list_card.dart index 90d7b60..51e8c7b 100644 --- a/douban_app/lib/views/book/tab_pages/read/rank_list_card.dart +++ b/douban_app/lib/views/book/tab_pages/read/rank_list_card.dart @@ -1,8 +1,11 @@ +import 'package:douban_app/models/book_av/book_rank_card.dart'; import 'package:flutter/material.dart'; import 'book_card_list.dart'; class RankList extends StatelessWidget { + final BookRankCard bookRankCard; + RankList(this.bookRankCard); @override Widget build(BuildContext context) { @@ -13,7 +16,7 @@ class RankList extends StatelessWidget { decoration: BoxDecoration( image: DecorationImage( fit: BoxFit.cover, - image: AssetImage('lib/assets/images/book_av/technology.jpeg') + image: NetworkImage(bookRankCard.backgroundImageUrl) ), borderRadius: BorderRadius.circular(10) ), @@ -22,18 +25,14 @@ class RankList extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text('一周热门图书榜',style: TextStyle(fontSize: 20, color: Colors.white),), - Text('豆瓣榜单', style: TextStyle(fontSize: 12, color: Colors.white),), + Text(bookRankCard.mainTitle,style: TextStyle(fontSize: 20, color: Colors.white),), + Text(bookRankCard.subTitle, style: TextStyle(fontSize: 12, color: Colors.white),), ], ), SizedBox(height: 10), Container( child: Column( - children: [ - BookCardListItem(), - BookCardListItem(), - BookCardListItem() - ], + children: bookRankCard.rankList.map((e) => BookCardListItem(e)).toList() ), ) ], diff --git a/douban_app/lib/views/book/tab_pages/story/index.dart b/douban_app/lib/views/book/tab_pages/story/index.dart new file mode 100644 index 0000000..af00f0e --- /dev/null +++ b/douban_app/lib/views/book/tab_pages/story/index.dart @@ -0,0 +1,9 @@ +import 'package:flutter/material.dart'; + + +class TabStory extends StatelessWidget { + @override + Widget build(BuildContext context) { + return Container(); + } +} \ No newline at end of file diff --git a/douban_app/lib/views/web_view/index.dart b/douban_app/lib/views/web_view/index.dart new file mode 100644 index 0000000..a85bc3e --- /dev/null +++ b/douban_app/lib/views/web_view/index.dart @@ -0,0 +1,9 @@ +import 'package:flutter/material.dart'; + +class WebViewPage extends StatelessWidget { + + @override + Widget build(BuildContext context) { + return Container(); + } +} \ No newline at end of file diff --git a/douban_app/models.jsonc b/douban_app/models.jsonc new file mode 100644 index 0000000..0ea46ba --- /dev/null +++ b/douban_app/models.jsonc @@ -0,0 +1,55 @@ +// GENERATED BY JSON TO DART MODEL +[ + // Useful links to work with this file: + // About jsonc: https://github.com/onury/jsonc + // Try jsonc: https://komkom.github.io + // + // To configure generator, go to Settings/Extensions/JSON To Dart Model + // + // Add your json objects here separated by commas. + // Note that you add class names to each object with key "__className": + // And avoid duplicate class names in this list for best results. + // FOR EXAMPLE: + + // Uncomment this to test and run builder with Shift + Ctrl + Alt + B + { + // To add enhancemed name to all generated files add new name after dot. + // Example: user_post.model. Result: user_post.model.dart + "__className": "BookRankCard", // <- The base class name of the object. + // It's possible to override the default path with a new one by adding "__path" key. + // - it's useful if you want split your models to different workspace directories. + "__path": "/lib/models/book_av", // <- this is not required. + // "userId": 1, + // "id": 1, // To mark as required value, change "id" to "r@id". + // "title": "Json To Dart Model", // To mark as a default value, change "title" to "d@title". + // "body": "Json to Dart advanced..." + // Force new type by adding new one after dot. + // Note: it works only with not primitive values. + // "type": {...} // <- Example: "type.post_type". Result: PostType type; + "mainTitle": "一周热门图书榜", + "subTitle": "豆瓣榜单", + "backgroundImage": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2561716440.jpg", + "rankList": [ + { + "index": 1, + "bookCoverUrl": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2561716440.jpg", + "bookName": "霸王别姬", + "ranking": 9 + }, + { + "index": 2, + "bookCoverUrl": "https://img9.doubanio.com/view/subject/s/public/s33958826.jpg", + "bookName": "拯救计划", + "ranking": 6 + }, + { + "index": 3, + "bookCoverUrl": "https://img1.doubanio.com/view/subject/s/public/s34003939.jpg", + "bookName": "电子游戏微历史", + "ranking": 8 + } + ] + } + + +] \ No newline at end of file diff --git a/douban_app/pubspec.yaml b/douban_app/pubspec.yaml index cff64ce..ac319c3 100644 --- a/douban_app/pubspec.yaml +++ b/douban_app/pubspec.yaml @@ -31,6 +31,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^0.1.3 + webview_flutter: ^0.3.9+1 dev_dependencies: flutter_test: -- Gitee From e3b93e89e48bfcfa453d3785f4e9f883c13900e3 Mon Sep 17 00:00:00 2001 From: yuluo Date: Mon, 25 Oct 2021 17:41:37 +0800 Subject: [PATCH 2/4] save --- douban_app/ios/Podfile.lock | 22 ++++++ .../ios/Runner.xcodeproj/project.pbxproj | 68 +++++++++++++++++++ .../contents.xcworkspacedata | 3 + .../lib/views/book/tab_pages/read/index.dart | 6 ++ douban_app/lib/views/web_view/index.dart | 12 +++- 5 files changed, 110 insertions(+), 1 deletion(-) create mode 100644 douban_app/ios/Podfile.lock diff --git a/douban_app/ios/Podfile.lock b/douban_app/ios/Podfile.lock new file mode 100644 index 0000000..1e7b80d --- /dev/null +++ b/douban_app/ios/Podfile.lock @@ -0,0 +1,22 @@ +PODS: + - Flutter (1.0.0) + - webview_flutter (0.0.1): + - Flutter + +DEPENDENCIES: + - Flutter (from `Flutter`) + - webview_flutter (from `.symlinks/plugins/webview_flutter/ios`) + +EXTERNAL SOURCES: + Flutter: + :path: Flutter + webview_flutter: + :path: ".symlinks/plugins/webview_flutter/ios" + +SPEC CHECKSUMS: + Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a + webview_flutter: d2b4d6c66968ad042ad94cbb791f5b72b4678a96 + +PODFILE CHECKSUM: aafe91acc616949ddb318b77800a7f51bffa2a4c + +COCOAPODS: 1.10.2 diff --git a/douban_app/ios/Runner.xcodeproj/project.pbxproj b/douban_app/ios/Runner.xcodeproj/project.pbxproj index 6a32840..9009c94 100644 --- a/douban_app/ios/Runner.xcodeproj/project.pbxproj +++ b/douban_app/ios/Runner.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 0F9538D725E52AEDC97B632C /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5D16FE99A459486951B73158 /* Pods_Runner.framework */; }; 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; @@ -31,7 +32,11 @@ /* 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 = ""; }; + 14F4F2A9CE13CAC21560FBEC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; + 26FC8BE45938A1B7CD4C84A7 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; + 5D16FE99A459486951B73158 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 6BC7F252FD36229FA7332483 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -49,12 +54,24 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 0F9538D725E52AEDC97B632C /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ + 331CC859770C79FB2BDBBA52 /* Pods */ = { + isa = PBXGroup; + children = ( + 14F4F2A9CE13CAC21560FBEC /* Pods-Runner.debug.xcconfig */, + 26FC8BE45938A1B7CD4C84A7 /* Pods-Runner.release.xcconfig */, + 6BC7F252FD36229FA7332483 /* Pods-Runner.profile.xcconfig */, + ); + name = Pods; + path = Pods; + sourceTree = ""; + }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -72,6 +89,8 @@ 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, + 331CC859770C79FB2BDBBA52 /* Pods */, + BEBBD522F1559B578F503F3B /* Frameworks */, ); sourceTree = ""; }; @@ -106,6 +125,14 @@ name = "Supporting Files"; sourceTree = ""; }; + BEBBD522F1559B578F503F3B /* Frameworks */ = { + isa = PBXGroup; + children = ( + 5D16FE99A459486951B73158 /* Pods_Runner.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -113,12 +140,14 @@ isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( + 1BC86BC8E205514DB3FE0E4D /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, + 7B55E0C1116B5C9C421AD231 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -177,6 +206,28 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ + 1BC86BC8E205514DB3FE0E4D /* [CP] Check Pods Manifest.lock */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + ); + inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( + ); + outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + showEnvVarsInLog = 0; + }; 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -191,6 +242,23 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; }; + 7B55E0C1116B5C9C421AD231 /* [CP] Embed Pods Frameworks */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Embed Pods Frameworks"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; + showEnvVarsInLog = 0; + }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; diff --git a/douban_app/ios/Runner.xcworkspace/contents.xcworkspacedata b/douban_app/ios/Runner.xcworkspace/contents.xcworkspacedata index 1d526a1..21a3cc1 100644 --- a/douban_app/ios/Runner.xcworkspace/contents.xcworkspacedata +++ b/douban_app/ios/Runner.xcworkspace/contents.xcworkspacedata @@ -4,4 +4,7 @@ + + diff --git a/douban_app/lib/views/book/tab_pages/read/index.dart b/douban_app/lib/views/book/tab_pages/read/index.dart index 87af401..635692c 100644 --- a/douban_app/lib/views/book/tab_pages/read/index.dart +++ b/douban_app/lib/views/book/tab_pages/read/index.dart @@ -5,6 +5,7 @@ import 'package:douban_app/utils/my_icon.dart'; import 'package:douban_app/views/book/tab_pages/read/book_card.dart'; import 'package:douban_app/views/book/tab_pages/read/rank_list_card.dart'; import 'package:douban_app/views/book/tab_pages/read/top_card.dart'; +import 'package:douban_app/views/web_view/index.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -207,6 +208,11 @@ class _TabReadState extends State { setState(() { currentTabItem = text; }); + Navigator.push(context, MaterialPageRoute( + builder: (context) { + return WebViewPage(); + } + )); }, child: Container( padding: EdgeInsets.symmetric(vertical: 4, horizontal: 10), diff --git a/douban_app/lib/views/web_view/index.dart b/douban_app/lib/views/web_view/index.dart index a85bc3e..a8bac4e 100644 --- a/douban_app/lib/views/web_view/index.dart +++ b/douban_app/lib/views/web_view/index.dart @@ -1,9 +1,19 @@ import 'package:flutter/material.dart'; +import 'package:webview_flutter/webview_flutter.dart'; class WebViewPage extends StatelessWidget { @override Widget build(BuildContext context) { - return Container(); + return Scaffold( + appBar: AppBar( + title: Text('标题'), + ), + body: WebView( + initialUrl: 'https://m.baidu.com', + //JS执行模式 是否允许JS执行 + javascriptMode: JavascriptMode.unrestricted, + ) + ); } } \ No newline at end of file -- Gitee From 268444b9392129cf4bd6cc042e0def4e955f44ec Mon Sep 17 00:00:00 2001 From: yuluo Date: Tue, 26 Oct 2021 17:32:30 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common_page_scaffold/index.dart | 25 +++ .../lib/components/page_list_title/index.dart | 59 +++++++ .../lib/models/book_av/book_type_list.dart | 22 +++ .../lib/models/book_av/sub_type_list.dart | 16 ++ .../book/tab_pages/read/find_books/index.dart | 146 ++++++++++++++++++ .../lib/views/book/tab_pages/read/index.dart | 28 ++-- .../views/book/tab_pages/read/top_card.dart | 65 +++++--- douban_app/lib/views/web_view/index.dart | 4 +- douban_app/models.jsonc | 39 ++--- 9 files changed, 342 insertions(+), 62 deletions(-) create mode 100644 douban_app/lib/components/common_page_scaffold/index.dart create mode 100644 douban_app/lib/components/page_list_title/index.dart create mode 100644 douban_app/lib/models/book_av/book_type_list.dart create mode 100644 douban_app/lib/models/book_av/sub_type_list.dart create mode 100644 douban_app/lib/views/book/tab_pages/read/find_books/index.dart diff --git a/douban_app/lib/components/common_page_scaffold/index.dart b/douban_app/lib/components/common_page_scaffold/index.dart new file mode 100644 index 0000000..6b5603a --- /dev/null +++ b/douban_app/lib/components/common_page_scaffold/index.dart @@ -0,0 +1,25 @@ +import 'package:flutter/material.dart'; + +class ComomonPageScaffold extends StatelessWidget { + // 后续功能待开发... + + final String titleName; + final Widget body; + ComomonPageScaffold({Key key, this.titleName, this.body}):super(key: key); + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + title: Text( + titleName, + style: TextStyle(fontSize: 18), + ), + elevation: 0, + backgroundColor: Colors.white, + foregroundColor: Color(0xFF333333)), + backgroundColor: Colors.white, + body: body, + ); + } +} diff --git a/douban_app/lib/components/page_list_title/index.dart b/douban_app/lib/components/page_list_title/index.dart new file mode 100644 index 0000000..2f67622 --- /dev/null +++ b/douban_app/lib/components/page_list_title/index.dart @@ -0,0 +1,59 @@ +import 'package:flutter/material.dart'; + +class PageListTitle extends StatelessWidget { + final String mainTitle; + final String rightText; + final bool canJump; + final Widget jumpWidget; + + PageListTitle( + {this.mainTitle = '标题', + this.rightText = '描述', + this.canJump = false, + this.jumpWidget = null}) {} + + @override + Widget build(BuildContext context) { + return Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + this.mainTitle, + style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold), + ), + this.canJump ? _Jumpable(context) : _NotJump() + ], + ); + } + + Widget _NotJump() { + return Row( + children: [ + Text( + this.rightText, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold), + ), + Icon(Icons.chevron_right) + ], + ); + } + + Widget _Jumpable(BuildContext context) { + return GestureDetector( + onTap: () { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return this.jumpWidget; + })); + }, + child: Row( + children: [ + Text( + this.rightText, + style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold), + ), + Icon(Icons.chevron_right) + ], + ), + ); + } +} diff --git a/douban_app/lib/models/book_av/book_type_list.dart b/douban_app/lib/models/book_av/book_type_list.dart new file mode 100644 index 0000000..fb0d211 --- /dev/null +++ b/douban_app/lib/models/book_av/book_type_list.dart @@ -0,0 +1,22 @@ +import 'sub_type_list.dart'; + +class BookTypeList { + String typeTitle; + List subTypeList; + + BookTypeList({this.typeTitle, this.subTypeList}); + + factory BookTypeList.fromJson(Map json) => BookTypeList( + typeTitle: json['typeTitle'] as String, + subTypeList: (json['subTypeList'] as List) + ?.map((e) => e == null + ? null + : SubTypeList.fromJson(e as Map)) + ?.toList(), + ); + + Map toJson() => { + 'typeTitle': typeTitle, + 'subTypeList': subTypeList?.map((e) => e?.toJson())?.toList(), + }; +} diff --git a/douban_app/lib/models/book_av/sub_type_list.dart b/douban_app/lib/models/book_av/sub_type_list.dart new file mode 100644 index 0000000..8f992c4 --- /dev/null +++ b/douban_app/lib/models/book_av/sub_type_list.dart @@ -0,0 +1,16 @@ +class SubTypeList { + String subTypeTitle; + int color; + + SubTypeList({this.subTypeTitle, this.color}); + + factory SubTypeList.fromJson(Map json) => SubTypeList( + subTypeTitle: json['subTypeTitle'] as String, + color: json['color'] as int, + ); + + Map toJson() => { + 'subTypeTitle': subTypeTitle, + 'color': color, + }; +} diff --git a/douban_app/lib/views/book/tab_pages/read/find_books/index.dart b/douban_app/lib/views/book/tab_pages/read/find_books/index.dart new file mode 100644 index 0000000..f614500 --- /dev/null +++ b/douban_app/lib/views/book/tab_pages/read/find_books/index.dart @@ -0,0 +1,146 @@ +import 'package:douban_app/components/common_page_scaffold/index.dart'; +import 'package:douban_app/models/book_av/book_type_list.dart'; +import 'package:douban_app/models/book_av/sub_type_list.dart'; +import 'package:flutter/material.dart'; + +class FindBooksByType extends StatefulWidget { + @override + _FindBooksByTypeState createState() => _FindBooksByTypeState(); +} + +class _FindBooksByTypeState extends State { + List> bookTypeListMock = [ + { + "typeTitle": "专题", + "subTypeList": [ + {"subTypeTitle": "影视原著", "color": 0xFF473334}, + {"subTypeTitle": "名著经典", "color": 0xFF86635E}, + ] + }, + { + "typeTitle": "精神避难所", + "subTypeList": [ + {"subTypeTitle": "文学", "color": 0xFF834139}, + {"subTypeTitle": "诗歌", "color": 0xFF7D828B}, + {"subTypeTitle": "小说", "color": 0xFF88443A}, + {"subTypeTitle": "散文", "color": 0xFF866E52}, + {"subTypeTitle": "戏剧", "color": 0xFF86635E}, + {"subTypeTitle": "戏剧", "color": 0xFF8A7250}, + {"subTypeTitle": "传记", "color": 0xFF86635E}, + {"subTypeTitle": "哲学", "color": 0xFF212850}, + {"subTypeTitle": "历史", "color": 0xFF86746C}, + ] + }, + { + "typeTitle": "生活启示录", + "subTypeList": [ + {"subTypeTitle": "心理", "color": 0xFF8B8383}, + {"subTypeTitle": "教育", "color": 0xFF171514}, + {"subTypeTitle": "生活", "color": 0xFF443644}, + {"subTypeTitle": "摄影", "color": 0xFF414642}, + {"subTypeTitle": "绘画", "color": 0xFF828B80}, + {"subTypeTitle": "语言", "color": 0xFF27314F}, + {"subTypeTitle": "旅游", "color": 0xFF774465}, + {"subTypeTitle": "家居", "color": 0xFF8B8B85}, + {"subTypeTitle": "美食", "color": 0xFF2A3B47}, + ] + }, + ]; + + List bookTypeList = []; + List dataList = []; + + @override + void initState() { + super.initState(); + for (var item in bookTypeListMock) { + bookTypeList.add(BookTypeList.fromJson(item)); + } + dataList = bookTypeList.map((item) => _TypeWrap(item)).toList(); + dataList.insert(0, _TopBlock()); + print(dataList); + } + + @override + Widget build(BuildContext context) { + return ComomonPageScaffold( + titleName: '分类找图书', + body: Container( + padding: EdgeInsets.all(20), child: ListView(children: dataList)), + ); + } + + Widget _TopBlock() { + return Container( + padding: EdgeInsets.symmetric(horizontal: 16), + height: 50, + decoration: BoxDecoration( + border: Border.all(width: 1, color: Color(0xFFDFDFDF)), + borderRadius: BorderRadius.circular(8)), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + children: [ + Icon(Icons.filter_list), + Text( + '分类找图书', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + ], + ), + Row( + children: [ + Text( + '地区、类型、特色', + style: TextStyle(color: Color(0xFF818181)), + ), + Icon( + Icons.chevron_right_rounded, + color: Color(0xFF1A1A1A), + ) + ], + ) + ], + ), + ); + } + + Widget _TypeWrap(BookTypeList bookType) { + return Container( + margin: EdgeInsets.only(top: 20), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + bookType.typeTitle, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + SizedBox( + height: 18, + ), + Wrap( + spacing: 10.0, + runSpacing: 10.0, + children: + bookType.subTypeList.map((item) => _TypeCard(item)).toList()) + ], + ), + ); + } + + Widget _TypeCard(SubTypeList subType) { + return Container( + width: 110, + height: 60, + decoration: BoxDecoration( + color: Color(subType.color), + borderRadius: BorderRadius.circular(10)), + child: Center( + child: Text( + subType.subTypeTitle, + style: TextStyle(color: Colors.white, fontSize: 16), + ), + )); + } +} diff --git a/douban_app/lib/views/book/tab_pages/read/index.dart b/douban_app/lib/views/book/tab_pages/read/index.dart index 635692c..7c3944c 100644 --- a/douban_app/lib/views/book/tab_pages/read/index.dart +++ b/douban_app/lib/views/book/tab_pages/read/index.dart @@ -1,8 +1,11 @@ + +import 'package:douban_app/components/page_list_title/index.dart'; import 'package:douban_app/models/book_av/book_rank_card.dart'; import 'package:douban_app/models/book_av/new_book.dart'; import 'package:douban_app/service/http_book_av.dart'; import 'package:douban_app/utils/my_icon.dart'; import 'package:douban_app/views/book/tab_pages/read/book_card.dart'; +import 'package:douban_app/views/book/tab_pages/read/find_books/index.dart'; import 'package:douban_app/views/book/tab_pages/read/rank_list_card.dart'; import 'package:douban_app/views/book/tab_pages/read/top_card.dart'; import 'package:douban_app/views/web_view/index.dart'; @@ -123,10 +126,10 @@ class _TabReadState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - topCard(MyIcons.searchBook, '找图书'), - topCard(MyIcons.rankingList, '豆瓣榜单'), - topCard(MyIcons.doubanCai, '豆瓣猜'), - topCard(MyIcons.bookList, '豆瓣书单'), + topCard(MyIcons.searchBook, '找图书', context), + topCard(MyIcons.rankingList, '豆瓣榜单', context), + topCard(MyIcons.doubanCai, '豆瓣猜', context), + topCard(MyIcons.bookList, '豆瓣书单', context), ], ), ), @@ -134,18 +137,11 @@ class _TabReadState extends State { margin: EdgeInsets.only(top: 10, bottom: 10), child: Column( children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('新书速递', style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),), - Row( - children: [ - Text('全部 ', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold),), - Text('200', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold)), - Icon(Icons.chevron_right) - ], - ), - ], + PageListTitle( + mainTitle: '新书速递', + rightText: '全部 200', + canJump: true, + jumpWidget: FindBooksByType(), ), Container( height: 50, diff --git a/douban_app/lib/views/book/tab_pages/read/top_card.dart b/douban_app/lib/views/book/tab_pages/read/top_card.dart index a39091d..8e96723 100644 --- a/douban_app/lib/views/book/tab_pages/read/top_card.dart +++ b/douban_app/lib/views/book/tab_pages/read/top_card.dart @@ -1,24 +1,49 @@ +import 'package:douban_app/views/book/tab_pages/read/find_books/index.dart'; import 'package:flutter/material.dart'; -Widget topCard(IconData icon, String text) { - return Container( - width: 80, - padding: EdgeInsets.symmetric(vertical: 5), - decoration: BoxDecoration( - color: Colors.white, - border: Border.all(width: 1, color: Color.fromARGB(255, 233, 233, 233)), - borderRadius: BorderRadius.circular(10), - boxShadow: [BoxShadow( - color: Color.fromARGB(255, 244, 244, 244), - blurRadius: 5 - )] - ), - child: Column( - children: [ - Icon(icon, color: Color.fromARGB(255, 73, 73, 73),), - SizedBox(height: 5,), - Text(text, style: TextStyle(color: Color.fromARGB(255, 129, 129, 129),fontSize: 12),) - ], +Widget topCard(IconData icon, String text, BuildContext context) { + return GestureDetector( + onTap: () { + switch(text) { + case '找图书': + Navigator.push(context, + MaterialPageRoute( + builder: (context) { + return FindBooksByType(); + } + )); + break; + default: + break; + } + }, + child: Container( + width: 80, + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + border: + Border.all(width: 1, color: Color.fromARGB(255, 233, 233, 233)), + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow(color: Color.fromARGB(255, 244, 244, 244), blurRadius: 5) + ]), + child: Column( + children: [ + Icon( + icon, + color: Color.fromARGB(255, 73, 73, 73), + ), + SizedBox( + height: 5, + ), + Text( + text, + style: TextStyle( + color: Color.fromARGB(255, 129, 129, 129), fontSize: 12), + ) + ], + ), ), ); -} \ No newline at end of file +} diff --git a/douban_app/lib/views/web_view/index.dart b/douban_app/lib/views/web_view/index.dart index a8bac4e..01eac70 100644 --- a/douban_app/lib/views/web_view/index.dart +++ b/douban_app/lib/views/web_view/index.dart @@ -12,8 +12,8 @@ class WebViewPage extends StatelessWidget { body: WebView( initialUrl: 'https://m.baidu.com', //JS执行模式 是否允许JS执行 - javascriptMode: JavascriptMode.unrestricted, + javascriptMode: JavascriptMode.unrestricted, ) ); } -} \ No newline at end of file +} \ No newline at end of file diff --git a/douban_app/models.jsonc b/douban_app/models.jsonc index 0ea46ba..44c237d 100644 --- a/douban_app/models.jsonc +++ b/douban_app/models.jsonc @@ -15,7 +15,7 @@ { // To add enhancemed name to all generated files add new name after dot. // Example: user_post.model. Result: user_post.model.dart - "__className": "BookRankCard", // <- The base class name of the object. + "__className": "bookTypeList", // <- The base class name of the object. // It's possible to override the default path with a new one by adding "__path" key. // - it's useful if you want split your models to different workspace directories. "__path": "/lib/models/book_av", // <- this is not required. @@ -26,29 +26,20 @@ // Force new type by adding new one after dot. // Note: it works only with not primitive values. // "type": {...} // <- Example: "type.post_type". Result: PostType type; - "mainTitle": "一周热门图书榜", - "subTitle": "豆瓣榜单", - "backgroundImage": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2561716440.jpg", - "rankList": [ - { - "index": 1, - "bookCoverUrl": "https://img3.doubanio.com/view/photo/s_ratio_poster/public/p2561716440.jpg", - "bookName": "霸王别姬", - "ranking": 9 - }, - { - "index": 2, - "bookCoverUrl": "https://img9.doubanio.com/view/subject/s/public/s33958826.jpg", - "bookName": "拯救计划", - "ranking": 6 - }, - { - "index": 3, - "bookCoverUrl": "https://img1.doubanio.com/view/subject/s/public/s34003939.jpg", - "bookName": "电子游戏微历史", - "ranking": 8 - } - ] + + + "typeTitle": "专题", + "subTypeList": [ + { + "subTypeTitle": "影视原著", + "color": 1 + }, + { + "subTypeTitle": "名著经典", + "color": 1 + } + ] + } -- Gitee From d245a2fee20a0c07519f67298bceb6859f14c1f9 Mon Sep 17 00:00:00 2001 From: yuluo Date: Wed, 27 Oct 2021 09:45:23 +0800 Subject: [PATCH 4/4] update develop --- douban_app/ios/Flutter/Debug.xcconfig | 1 + douban_app/ios/Flutter/Release.xcconfig | 1 + douban_app/ios/Podfile | 41 +++++++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 douban_app/ios/Podfile diff --git a/douban_app/ios/Flutter/Debug.xcconfig b/douban_app/ios/Flutter/Debug.xcconfig index 592ceee..ec97fc6 100644 --- a/douban_app/ios/Flutter/Debug.xcconfig +++ b/douban_app/ios/Flutter/Debug.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/douban_app/ios/Flutter/Release.xcconfig b/douban_app/ios/Flutter/Release.xcconfig index 592ceee..c4855bf 100644 --- a/douban_app/ios/Flutter/Release.xcconfig +++ b/douban_app/ios/Flutter/Release.xcconfig @@ -1 +1,2 @@ +#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/douban_app/ios/Podfile b/douban_app/ios/Podfile new file mode 100644 index 0000000..1e8c3c9 --- /dev/null +++ b/douban_app/ios/Podfile @@ -0,0 +1,41 @@ +# Uncomment this line to define a global platform for your project +# platform :ios, '9.0' + +# CocoaPods analytics sends network stats synchronously affecting flutter build latency. +ENV['COCOAPODS_DISABLE_STATS'] = 'true' + +project 'Runner', { + 'Debug' => :debug, + 'Profile' => :release, + 'Release' => :release, +} + +def flutter_root + generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) + unless File.exist?(generated_xcode_build_settings_path) + raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" + end + + File.foreach(generated_xcode_build_settings_path) do |line| + matches = line.match(/FLUTTER_ROOT\=(.*)/) + return matches[1].strip if matches + end + raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" +end + +require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) + +flutter_ios_podfile_setup + +target 'Runner' do + use_frameworks! + use_modular_headers! + + flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) +end + +post_install do |installer| + installer.pods_project.targets.each do |target| + flutter_additional_ios_build_settings(target) + end +end -- Gitee