From 758157787c221728cda8d17412d8b2c7866cd02c Mon Sep 17 00:00:00 2001 From: xiaoyaocz Date: Thu, 22 Oct 2020 11:23:15 +0800 Subject: [PATCH] =?UTF-8?q?iOS=E5=AE=A1=E6=A0=B8=E6=9C=9F=E9=97=B4?= =?UTF-8?q?=E9=9A=90=E8=97=8Fbanner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .flutter-plugins-dependencies | 2 +- lib/app/utils.dart | 4 +++ lib/models/version_info.dart | 4 +++ lib/views/comic/comic_home.dart | 2 +- lib/views/comic/comic_recommend.dart | 31 ++++++++++++++------ lib/views/news/news_home.dart | 44 ++++++++++++++++++---------- lib/views/novel/novel_home.dart | 2 +- lib/views/novel/novel_recommend.dart | 31 ++++++++++++++------ pubspec.yaml | 2 +- 9 files changed, 84 insertions(+), 38 deletions(-) diff --git a/.flutter-plugins-dependencies b/.flutter-plugins-dependencies index 55ba2f3..cb242dd 100644 --- a/.flutter-plugins-dependencies +++ b/.flutter-plugins-dependencies @@ -1 +1 @@ -{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"battery","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\battery-1.0.7\\\\","dependencies":[]},{"name":"connectivity","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-0.4.9+5\\\\","dependencies":[]},{"name":"fluttertoast","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\fluttertoast-3.1.3\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.21\\\\","dependencies":[]},{"name":"screen","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.5+3\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.12+2\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.7.5\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-1.0.4\\\\","dependencies":[]}],"android":[{"name":"battery","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\battery-1.0.7\\\\","dependencies":[]},{"name":"connectivity","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-0.4.9+5\\\\","dependencies":[]},{"name":"fluttertoast","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\fluttertoast-3.1.3\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.21\\\\","dependencies":[]},{"name":"screen","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.5+3\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.12+2\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.7.5\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-1.0.4\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity_macos-0.1.0+2\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.3\\\\","dependencies":[]},{"name":"path_provider_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-0.0.4\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_macos-0.0.1+6\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1+2\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_macos-0.0.1+4\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_linux-0.0.2+2\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_linux-0.0.1+1\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-0.0.4+1\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_windows-0.0.1+1\\\\","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_windows-0.0.1+1\\\\","dependencies":[]}],"web":[{"name":"connectivity_for_web","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity_for_web-0.3.1+2\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_web-0.1.2+4\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_web-0.1.5\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"battery","dependencies":[]},{"name":"connectivity","dependencies":["connectivity_macos","connectivity_for_web"]},{"name":"connectivity_for_web","dependencies":[]},{"name":"connectivity_macos","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"screen","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2020-10-21 12:09:52.029774","version":"1.22.2"} \ No newline at end of file +{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"battery","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\battery-1.0.7\\\\","dependencies":[]},{"name":"connectivity","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-0.4.9+5\\\\","dependencies":[]},{"name":"fluttertoast","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\fluttertoast-3.1.3\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.21\\\\","dependencies":[]},{"name":"screen","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.5+3\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.12+2\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.7.5\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-1.0.4\\\\","dependencies":[]}],"android":[{"name":"battery","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\battery-1.0.7\\\\","dependencies":[]},{"name":"connectivity","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity-0.4.9+5\\\\","dependencies":[]},{"name":"fluttertoast","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\fluttertoast-3.1.3\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.3\\\\","dependencies":[]},{"name":"path_provider","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider-1.6.21\\\\","dependencies":[]},{"name":"screen","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\screen-0.0.5\\\\","dependencies":[]},{"name":"share","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\share-0.6.5+3\\\\","dependencies":[]},{"name":"shared_preferences","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences-0.5.12+2\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1+2\\\\","dependencies":[]},{"name":"url_launcher","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher-5.7.5\\\\","dependencies":[]},{"name":"webview_flutter","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\webview_flutter-1.0.4\\\\","dependencies":[]}],"macos":[{"name":"connectivity_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity_macos-0.1.0+2\\\\","dependencies":[]},{"name":"package_info","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\package_info-0.4.3\\\\","dependencies":[]},{"name":"path_provider_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_macos-0.0.4\\\\","dependencies":[]},{"name":"shared_preferences_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_macos-0.0.1+6\\\\","dependencies":[]},{"name":"sqflite","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\sqflite-1.3.1+2\\\\","dependencies":[]},{"name":"url_launcher_macos","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_macos-0.0.1+4\\\\","dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_linux-0.0.1+2\\\\","dependencies":[]},{"name":"shared_preferences_linux","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_linux-0.0.2+2\\\\","dependencies":["path_provider_linux"]},{"name":"url_launcher_linux","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_linux-0.0.1+1\\\\","dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\path_provider_windows-0.0.4+1\\\\","dependencies":[]},{"name":"shared_preferences_windows","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_windows-0.0.1+1\\\\","dependencies":["path_provider_windows"]},{"name":"url_launcher_windows","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_windows-0.0.1+1\\\\","dependencies":[]}],"web":[{"name":"connectivity_for_web","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\connectivity_for_web-0.3.1+2\\\\","dependencies":[]},{"name":"shared_preferences_web","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\shared_preferences_web-0.1.2+4\\\\","dependencies":[]},{"name":"url_launcher_web","path":"D:\\\\flutter\\\\.pub-cache\\\\hosted\\\\pub.flutter-io.cn\\\\url_launcher_web-0.1.5\\\\","dependencies":[]}]},"dependencyGraph":[{"name":"battery","dependencies":[]},{"name":"connectivity","dependencies":["connectivity_macos","connectivity_for_web"]},{"name":"connectivity_for_web","dependencies":[]},{"name":"connectivity_macos","dependencies":[]},{"name":"fluttertoast","dependencies":[]},{"name":"package_info","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_macos","path_provider_linux","path_provider_windows"]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_macos","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"screen","dependencies":[]},{"name":"share","dependencies":[]},{"name":"shared_preferences","dependencies":["shared_preferences_linux","shared_preferences_macos","shared_preferences_web","shared_preferences_windows"]},{"name":"shared_preferences_linux","dependencies":["path_provider_linux"]},{"name":"shared_preferences_macos","dependencies":[]},{"name":"shared_preferences_web","dependencies":[]},{"name":"shared_preferences_windows","dependencies":["path_provider_windows"]},{"name":"sqflite","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_web","url_launcher_linux","url_launcher_macos","url_launcher_windows"]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":[]}],"date_created":"2020-10-22 11:22:45.700564","version":"1.22.2"} \ No newline at end of file diff --git a/lib/app/utils.dart b/lib/app/utils.dart index 5d0f840..2881268 100644 --- a/lib/app/utils.dart +++ b/lib/app/utils.dart @@ -34,6 +34,7 @@ class Utils { static EventBus changeComicHomeTabIndex = EventBus(); static EventBus changeNovelHomeTabIndex = EventBus(); static EventBus changHistory = EventBus(); + static EventBus changeHideBanner = EventBus(); static void showSnackbarWithAction( BuildContext context, String content, String action, Function onPressed) { final snackBar = new SnackBar( @@ -53,6 +54,7 @@ class Utils { Scaffold.of(context).showSnackBar(snackBar); } + static bool hideBanner = true; static Future checkVersion() async { try { var newVersion = await http.get( @@ -60,6 +62,8 @@ class Utils { DateTime.now().millisecondsSinceEpoch.toString()); var verInfo = VersionInfo.fromJson(jsonDecode(utf8.decode(newVersion.bodyBytes))); + hideBanner = verInfo.hide_banner; + changeHideBanner.fire(hideBanner); PackageInfo packageInfo = await PackageInfo.fromPlatform(); if (packageInfo.buildNumber != verInfo.version_code) { return verInfo; diff --git a/lib/models/version_info.dart b/lib/models/version_info.dart index 405cf94..34c0460 100644 --- a/lib/models/version_info.dart +++ b/lib/models/version_info.dart @@ -6,6 +6,7 @@ class VersionInfo { String message; String android_url; String ios_url; + bool hide_banner; VersionInfo({ this.version, @@ -13,6 +14,7 @@ class VersionInfo { this.message, this.android_url, this.ios_url, + this.hide_banner, }); factory VersionInfo.fromJson(jsonRes) => jsonRes == null @@ -23,6 +25,7 @@ class VersionInfo { message: jsonRes['message'], android_url: jsonRes['android_url'], ios_url: jsonRes['ios_url'], + hide_banner: jsonRes['hide_banner'], ); Map toJson() => { 'version': version, @@ -30,6 +33,7 @@ class VersionInfo { 'message': message, 'android_url': android_url, 'ios_url': ios_url, + 'hide_banner': hide_banner, }; @override diff --git a/lib/views/comic/comic_home.dart b/lib/views/comic/comic_home.dart index c7f7e15..e28f92b 100644 --- a/lib/views/comic/comic_home.dart +++ b/lib/views/comic/comic_home.dart @@ -39,7 +39,7 @@ class _ComicHomePageState extends State Tab(child: Text("专题")), ], indicatorSize: TabBarIndicatorSize.label, - labelPadding: EdgeInsets.all(8), + //labelPadding: EdgeInsets.all(8), ), actions: [ IconButton( diff --git a/lib/views/comic/comic_recommend.dart b/lib/views/comic/comic_recommend.dart index 478a3d4..9e057be 100644 --- a/lib/views/comic/comic_recommend.dart +++ b/lib/views/comic/comic_recommend.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -36,9 +37,18 @@ class ComicRecommendState extends State List _anime = []; List _mySub = []; + //如果是IOS,且在审核期间,隐藏Banner + bool _hideBanner = false; + @override void initState() { super.initState(); + _hideBanner = Utils.hideBanner; + Utils.changeHideBanner.on().listen((event) { + setState(() { + _hideBanner = event; + }); + }); loadData(); } @@ -89,15 +99,18 @@ class ComicRecommendState extends State : CrossAxisAlignment.center, children: [ //banner - AppBanner( - items: _banners - .map((i) => BannerImageItem( - pic: i.cover, - title: i.title, - onTaped: () => Utils.openPage(context, i.id, i.type, - url: i.url, title: i.title), - )) - .toList()), + (Platform.isIOS && _hideBanner) + ? Container() + : AppBanner( + items: _banners + .map((i) => BannerImageItem( + pic: i.cover, + title: i.title, + onTaped: () => Utils.openPage( + context, i.id, i.type, + url: i.url, title: i.title), + )) + .toList()), _getItem2( "我的订阅", _mySub, diff --git a/lib/views/news/news_home.dart b/lib/views/news/news_home.dart index 65170bc..363855b 100644 --- a/lib/views/news/news_home.dart +++ b/lib/views/news/news_home.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:common_utils/common_utils.dart'; import 'package:flutter/material.dart'; @@ -60,8 +61,8 @@ class _NewsHomePageState extends State .map((x) => Tab(child: Text(x.tag_name))) .toList(), isScrollable: true, - indicatorSize: TabBarIndicatorSize.tab, - labelPadding: EdgeInsets.fromLTRB(12, 8, 12, 8), + indicatorSize: TabBarIndicatorSize.label, + //labelPadding: EdgeInsets.fromLTRB(12, 8, 12, 8), ), ), body: TabBarView( @@ -100,9 +101,18 @@ class NewsNewTabViewState extends State @override bool get wantKeepAlive => true; + //如果是IOS,且在审核期间,隐藏Banner + bool _hideBanner = false; + @override void initState() { super.initState(); + _hideBanner = Utils.hideBanner; + Utils.changeHideBanner.on().listen((event) { + setState(() { + _hideBanner = event; + }); + }); loadData(); scrollController.addListener(() { if (scrollController.position.pixels == @@ -122,20 +132,22 @@ class NewsNewTabViewState extends State controller: scrollController, child: Column( children: [ - AppBanner( - items: _banners - .map((i) => BannerImageItem( - pic: i.pic_url, - title: i.title, - onTaped: () => Navigator.push( - context, - MaterialPageRoute( - builder: (_) => NewsDetailPage( - i.object_id, - i.object_url, - i.title))), - )) - .toList()), + (Platform.isIOS && _hideBanner) + ? Container() + : AppBanner( + items: _banners + .map((i) => BannerImageItem( + pic: i.pic_url, + title: i.title, + onTaped: () => Navigator.push( + context, + MaterialPageRoute( + builder: (_) => NewsDetailPage( + i.object_id, + i.object_url, + i.title))), + )) + .toList()), ListView.builder( shrinkWrap: true, physics: ScrollPhysics(), diff --git a/lib/views/novel/novel_home.dart b/lib/views/novel/novel_home.dart index a3abb0e..1bb57e9 100644 --- a/lib/views/novel/novel_home.dart +++ b/lib/views/novel/novel_home.dart @@ -37,7 +37,7 @@ class _NovelHomePageState extends State Tab(child: Text("排行")) ], indicatorSize: TabBarIndicatorSize.label, - labelPadding: EdgeInsets.all(8), + //labelPadding: EdgeInsets.all(8), ), actions: [ IconButton( diff --git a/lib/views/novel/novel_recommend.dart b/lib/views/novel/novel_recommend.dart index a14baef..25e5ab2 100644 --- a/lib/views/novel/novel_recommend.dart +++ b/lib/views/novel/novel_recommend.dart @@ -1,4 +1,5 @@ import 'dart:convert'; +import 'dart:io'; import 'package:cached_network_image/cached_network_image.dart'; import 'package:flutter/material.dart'; @@ -29,9 +30,18 @@ class NovelRecommendState extends State List _anime = []; List _hot = []; + //如果是IOS,且在审核期间,隐藏Banner + bool _hideBanner = false; + @override void initState() { super.initState(); + _hideBanner = Utils.hideBanner; + Utils.changeHideBanner.on().listen((event) { + setState(() { + _hideBanner = event; + }); + }); loadData(); } @@ -74,15 +84,18 @@ class NovelRecommendState extends State : CrossAxisAlignment.center, children: [ //bannera - AppBanner( - items: _banners - .map((i) => BannerImageItem( - pic: i.cover, - title: i.title, - onTaped: () => Utils.openPage(context, i.id, i.type, - url: i.url, title: i.title), - )) - .toList()), + (Platform.isIOS && _hideBanner) + ? Container() + : AppBanner( + items: _banners + .map((i) => BannerImageItem( + pic: i.cover, + title: i.title, + onTaped: () => Utils.openPage( + context, i.id, i.type, + url: i.url, title: i.title), + )) + .toList()), // _getItem2("我的订阅", _my_sub, // icon: Icon(Icons.chevron_right, color: Colors.grey), // ontap: () => Utils.openSubscribePage(context), diff --git a/pubspec.yaml b/pubspec.yaml index 34958c1..f61482c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -11,7 +11,7 @@ description: A new Flutter project. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.0.4+200719 +version: 1.0.5+201022 environment: sdk: ">=2.1.0 <3.0.0"