ios version

This commit is contained in:
xj.deng
2019-05-08 14:10:23 +08:00
parent eae10b59ed
commit 5d41873082
3 changed files with 55 additions and 84 deletions

View File

@ -17,11 +17,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string> <string>1.0.7</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>107</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSCameraUsageDescription</key> <key>NSCameraUsageDescription</key>
@ -31,7 +31,7 @@
<key>NSPhotoLibraryAddUsageDescription</key> <key>NSPhotoLibraryAddUsageDescription</key>
<string>测试选择图片</string> <string>测试选择图片</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string></string> <string>测试选择相机</string>
<key>UILaunchStoryboardName</key> <key>UILaunchStoryboardName</key>
<string>LaunchScreen</string> <string>LaunchScreen</string>
<key>UIMainStoryboardFile</key> <key>UIMainStoryboardFile</key>

View File

@ -1,4 +1,3 @@
/// Created with Android Studio. /// Created with Android Studio.
/// User: 三帆 /// User: 三帆
/// Date: 16/01/2019 /// Date: 16/01/2019
@ -6,11 +5,9 @@
/// email: sanfan.hx@alibaba-inc.com /// email: sanfan.hx@alibaba-inc.com
/// target: app首页 /// target: app首页
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart'; import 'package:flutter/rendering.dart';
import 'package:flutter_go/utils/shared_preferences.dart'; import 'package:flutter_go/utils/shared_preferences.dart';
import 'package:flutter_go/views/first_page/first_page.dart';
import 'package:flutter_go/views/widget_page/widget_page.dart'; import 'package:flutter_go/views/widget_page/widget_page.dart';
import 'package:flutter_go/views/welcome_page/fourth_page.dart'; import 'package:flutter_go/views/welcome_page/fourth_page.dart';
import 'package:flutter_go/views/collection_page/collection_page.dart'; import 'package:flutter_go/views/collection_page/collection_page.dart';
@ -36,41 +33,38 @@ class _MyHomePageState extends State<AppPage>
SpUtil sp; SpUtil sp;
WidgetControlModel widgetControl = new WidgetControlModel(); WidgetControlModel widgetControl = new WidgetControlModel();
SearchHistoryList searchHistoryList; SearchHistoryList searchHistoryList;
TabController controller;
bool isSearch = false; bool isSearch = false;
String data = '';
String data2ThirdPage = '这是传给ThirdPage的值';
String appBarTitle = tabData[0]['text']; String appBarTitle = tabData[0]['text'];
List<Widget> list = List();
int _currentIndex = 0;
static List tabData = [ static List tabData = [
{'text': '业界动态', 'icon': new Icon(Icons.language)}, {'text': 'WIDGET', 'icon': Icon(Icons.extension)},
{'text': 'WIDGET', 'icon': new Icon(Icons.extension)}, {'text': '组件收藏', 'icon': Icon(Icons.favorite)},
{'text': '组件收藏', 'icon': new Icon(Icons.favorite)}, {'text': '关于手册', 'icon': Icon(Icons.import_contacts)},
{'text': '关于手册', 'icon': new Icon(Icons.import_contacts)}
]; ];
List<Widget> myTabs = []; List<BottomNavigationBarItem> myTabs = [];
@override @override
void initState() { void initState() {
super.initState(); super.initState();
initSearchHistory(); initSearchHistory();
controller = new TabController(
initialIndex: 0, vsync: this, length: 4); // 这里的length 决定有多少个底导 submenus
for (int i = 0; i < tabData.length; i++) { for (int i = 0; i < tabData.length; i++) {
myTabs.add(new Tab(text: tabData[i]['text'], icon: tabData[i]['icon'])); myTabs.add(BottomNavigationBarItem(
icon: tabData[i]['icon'],
title: Text(
tabData[i]['text'],
),
));
} }
controller.addListener(() { list
if (controller.indexIsChanging) { ..add(WidgetPage(Provider.db))
_onTabChange(); ..add(CollectionPage())
} ..add(FourthPage());
});
Application.controller = controller;
} }
@override @override
void dispose() { void dispose() {
controller.dispose();
super.dispose(); super.dispose();
} }
@ -92,7 +86,9 @@ class _MyHomePageState extends State<AppPage>
}); });
searchHistoryList searchHistoryList
.add(SearchHistory(name: targetName, targetRouter: targetRouter)); .add(SearchHistory(name: targetName, targetRouter: targetRouter));
print("searchHistoryList ${searchHistoryList.toString()}"); print("searchHistoryList1 ${searchHistoryList.toString()}");
print("searchHistoryList2 ${targetRouter}");
print("searchHistoryList3 ${widgetPoint.name}");
Application.router.navigateTo(context, "$targetRouter"); Application.router.navigateTo(context, "$targetRouter");
} }
@ -100,16 +96,15 @@ class _MyHomePageState extends State<AppPage>
return new SearchInput((value) async { return new SearchInput((value) async {
if (value != '') { if (value != '') {
List<WidgetPoint> list = await widgetControl.search(value); List<WidgetPoint> list = await widgetControl.search(value);
return list return list
.map((item) => new MaterialSearchResult<String>( .map((item) => new MaterialSearchResult<String>(
value: item.name, value: item.name,
icon: WidgetName2Icon.icons[item.name] ?? null, icon: WidgetName2Icon.icons[item.name] ?? null,
text: 'widget', text: 'widget',
onTap: () { onTap: () {
onWidgetTap(item, context); onWidgetTap(item, context);
}, },
)) ))
.toList(); .toList();
} else { } else {
return null; return null;
@ -119,52 +114,28 @@ class _MyHomePageState extends State<AppPage>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var db = Provider.db;
return new Scaffold( return new Scaffold(
appBar: new AppBar(title: buildSearchInput(context)), appBar: AppBar(title: buildSearchInput(context)),
body: new TabBarView(controller: controller, children: <Widget>[ body: list[_currentIndex],
new FirstPage(), bottomNavigationBar: BottomNavigationBar(
new WidgetPage(db), items: myTabs,
new CollectionPage(), //高亮 被点击高亮
FourthPage() currentIndex: _currentIndex,
]), //修改 页面
bottomNavigationBar: Material( onTap: _ItemTapped,
color: const Color(0xFFF0EEEF), //底部导航栏主题颜色 //shifting :按钮点击移动效果
child: SafeArea( //fixed固定
child: Container( type: BottomNavigationBarType.fixed,
height: 65.0,
decoration: BoxDecoration( fixedColor: Color(0xFFC91B3A),
color: const Color(0xFFF0F0F0),
boxShadow: <BoxShadow>[
BoxShadow(
color: const Color(0xFFd0d0d0),
blurRadius: 3.0,
spreadRadius: 2.0,
offset: Offset(-1.0, -1.0),
),
],
),
child: TabBar(
controller: controller,
indicatorColor: Theme.of(context).primaryColor,
//tab标签的下划线颜色
// labelColor: const Color(0xFF000000),
indicatorWeight: 3.0,
labelColor: Theme.of(context).primaryColor,
unselectedLabelColor: const Color(0xFF8E8E8E),
tabs: myTabs),
),
),
), ),
); );
} }
void _onTabChange() { void _ItemTapped(int index) {
if (this.mounted) { setState(() {
this.setState(() { _currentIndex = index;
appBarTitle = tabData[controller.index]['text']; appBarTitle = tabData[index]['text'];
}); });
}
} }
} }

View File

@ -14,7 +14,7 @@ packages:
name: async name: async
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.2.0" version: "2.0.8"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -150,7 +150,7 @@ packages:
name: matcher name: matcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.5" version: "0.12.3+1"
meta: meta:
dependency: transitive dependency: transitive
description: description:
@ -171,14 +171,14 @@ packages:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.0" version: "1.4.0"
quiver: quiver:
dependency: transitive dependency: transitive
description: description:
name: quiver name: quiver
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.3" version: "2.0.1"
shared_preferences: shared_preferences:
dependency: "direct main" dependency: "direct main"
description: description:
@ -197,7 +197,7 @@ packages:
name: source_span name: source_span
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.5.5" version: "1.5.4"
sqflite: sqflite:
dependency: "direct main" dependency: "direct main"
description: description:
@ -218,7 +218,7 @@ packages:
name: stream_channel name: stream_channel
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "1.6.8"
string_scanner: string_scanner:
dependency: transitive dependency: transitive
description: description:
@ -246,7 +246,7 @@ packages:
name: test_api name: test_api
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.2.5" version: "0.2.2"
typed_data: typed_data:
dependency: transitive dependency: transitive
description: description:
@ -269,5 +269,5 @@ packages:
source: hosted source: hosted
version: "2.0.8" version: "2.0.8"
sdks: sdks:
dart: ">=2.2.0 <3.0.0" dart: ">=2.1.0 <3.0.0"
flutter: ">=1.2.1 <2.0.0" flutter: ">=1.2.1 <2.0.0"