mirror of
https://github.com/alibaba/flutter-go.git
synced 2025-07-03 23:00:26 +08:00
ios version
This commit is contained in:
@ -17,11 +17,11 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||
<string>1.0.7</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||
<string>107</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSCameraUsageDescription</key>
|
||||
@ -31,7 +31,7 @@
|
||||
<key>NSPhotoLibraryAddUsageDescription</key>
|
||||
<string>测试选择图片</string>
|
||||
<key>NSPhotoLibraryUsageDescription</key>
|
||||
<string></string>
|
||||
<string>测试选择相机</string>
|
||||
<key>UILaunchStoryboardName</key>
|
||||
<string>LaunchScreen</string>
|
||||
<key>UIMainStoryboardFile</key>
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
/// Created with Android Studio.
|
||||
/// User: 三帆
|
||||
/// Date: 16/01/2019
|
||||
@ -6,11 +5,9 @@
|
||||
/// email: sanfan.hx@alibaba-inc.com
|
||||
/// target: app首页
|
||||
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/rendering.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/welcome_page/fourth_page.dart';
|
||||
import 'package:flutter_go/views/collection_page/collection_page.dart';
|
||||
@ -36,41 +33,38 @@ class _MyHomePageState extends State<AppPage>
|
||||
SpUtil sp;
|
||||
WidgetControlModel widgetControl = new WidgetControlModel();
|
||||
SearchHistoryList searchHistoryList;
|
||||
TabController controller;
|
||||
bool isSearch = false;
|
||||
String data = '无';
|
||||
String data2ThirdPage = '这是传给ThirdPage的值';
|
||||
String appBarTitle = tabData[0]['text'];
|
||||
List<Widget> list = List();
|
||||
int _currentIndex = 0;
|
||||
static List tabData = [
|
||||
{'text': '业界动态', 'icon': new Icon(Icons.language)},
|
||||
{'text': 'WIDGET', 'icon': new Icon(Icons.extension)},
|
||||
{'text': '组件收藏', 'icon': new Icon(Icons.favorite)},
|
||||
{'text': '关于手册', 'icon': new Icon(Icons.import_contacts)}
|
||||
{'text': 'WIDGET', 'icon': Icon(Icons.extension)},
|
||||
{'text': '组件收藏', 'icon': Icon(Icons.favorite)},
|
||||
{'text': '关于手册', 'icon': Icon(Icons.import_contacts)},
|
||||
];
|
||||
|
||||
List<Widget> myTabs = [];
|
||||
List<BottomNavigationBarItem> myTabs = [];
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
initSearchHistory();
|
||||
controller = new TabController(
|
||||
initialIndex: 0, vsync: this, length: 4); // 这里的length 决定有多少个底导 submenus
|
||||
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(() {
|
||||
if (controller.indexIsChanging) {
|
||||
_onTabChange();
|
||||
}
|
||||
});
|
||||
Application.controller = controller;
|
||||
list
|
||||
..add(WidgetPage(Provider.db))
|
||||
..add(CollectionPage())
|
||||
..add(FourthPage());
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
controller.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@ -92,7 +86,9 @@ class _MyHomePageState extends State<AppPage>
|
||||
});
|
||||
searchHistoryList
|
||||
.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");
|
||||
}
|
||||
|
||||
@ -100,16 +96,15 @@ class _MyHomePageState extends State<AppPage>
|
||||
return new SearchInput((value) async {
|
||||
if (value != '') {
|
||||
List<WidgetPoint> list = await widgetControl.search(value);
|
||||
|
||||
return list
|
||||
.map((item) => new MaterialSearchResult<String>(
|
||||
value: item.name,
|
||||
icon: WidgetName2Icon.icons[item.name] ?? null,
|
||||
text: 'widget',
|
||||
onTap: () {
|
||||
onWidgetTap(item, context);
|
||||
},
|
||||
))
|
||||
value: item.name,
|
||||
icon: WidgetName2Icon.icons[item.name] ?? null,
|
||||
text: 'widget',
|
||||
onTap: () {
|
||||
onWidgetTap(item, context);
|
||||
},
|
||||
))
|
||||
.toList();
|
||||
} else {
|
||||
return null;
|
||||
@ -119,52 +114,28 @@ class _MyHomePageState extends State<AppPage>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var db = Provider.db;
|
||||
|
||||
return new Scaffold(
|
||||
appBar: new AppBar(title: buildSearchInput(context)),
|
||||
body: new TabBarView(controller: controller, children: <Widget>[
|
||||
new FirstPage(),
|
||||
new WidgetPage(db),
|
||||
new CollectionPage(),
|
||||
FourthPage()
|
||||
]),
|
||||
bottomNavigationBar: Material(
|
||||
color: const Color(0xFFF0EEEF), //底部导航栏主题颜色
|
||||
child: SafeArea(
|
||||
child: Container(
|
||||
height: 65.0,
|
||||
decoration: BoxDecoration(
|
||||
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),
|
||||
),
|
||||
),
|
||||
appBar: AppBar(title: buildSearchInput(context)),
|
||||
body: list[_currentIndex],
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: myTabs,
|
||||
//高亮 被点击高亮
|
||||
currentIndex: _currentIndex,
|
||||
//修改 页面
|
||||
onTap: _ItemTapped,
|
||||
//shifting :按钮点击移动效果
|
||||
//fixed:固定
|
||||
type: BottomNavigationBarType.fixed,
|
||||
|
||||
fixedColor: Color(0xFFC91B3A),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void _onTabChange() {
|
||||
if (this.mounted) {
|
||||
this.setState(() {
|
||||
appBarTitle = tabData[controller.index]['text'];
|
||||
});
|
||||
}
|
||||
void _ItemTapped(int index) {
|
||||
setState(() {
|
||||
_currentIndex = index;
|
||||
appBarTitle = tabData[index]['text'];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
16
pubspec.lock
16
pubspec.lock
@ -14,7 +14,7 @@ packages:
|
||||
name: async
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.2.0"
|
||||
version: "2.0.8"
|
||||
boolean_selector:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -150,7 +150,7 @@ packages:
|
||||
name: matcher
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.12.5"
|
||||
version: "0.12.3+1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -171,14 +171,14 @@ packages:
|
||||
name: pedantic
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.0"
|
||||
version: "1.4.0"
|
||||
quiver:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: quiver
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.3"
|
||||
version: "2.0.1"
|
||||
shared_preferences:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -197,7 +197,7 @@ packages:
|
||||
name: source_span
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.5.5"
|
||||
version: "1.5.4"
|
||||
sqflite:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@ -218,7 +218,7 @@ packages:
|
||||
name: stream_channel
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
version: "1.6.8"
|
||||
string_scanner:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -246,7 +246,7 @@ packages:
|
||||
name: test_api
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.2.5"
|
||||
version: "0.2.2"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
@ -269,5 +269,5 @@ packages:
|
||||
source: hosted
|
||||
version: "2.0.8"
|
||||
sdks:
|
||||
dart: ">=2.2.0 <3.0.0"
|
||||
dart: ">=2.1.0 <3.0.0"
|
||||
flutter: ">=1.2.1 <2.0.0"
|
||||
|
Reference in New Issue
Block a user