Skip to content

Commit e98fa6d

Browse files
authored
Merge pull request alibaba#205 from alibaba/dev/sanl
delete ios file
2 parents dfcf0ce + 9ecc52d commit e98fa6d

File tree

4 files changed

+80
-93
lines changed

4 files changed

+80
-93
lines changed

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
);
354354
inputPaths = (
355355
"${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh",
356-
"${PODS_ROOT}/../.symlinks/flutter/ios-release/Flutter.framework",
356+
"${PODS_ROOT}/../.symlinks/flutter/ios/Flutter.framework",
357357
);
358358
name = "[CP] Embed Pods Frameworks";
359359
outputPaths = (

ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

Lines changed: 0 additions & 8 deletions
This file was deleted.

lib/views/home.dart

Lines changed: 36 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
21
/// Created with Android Studio.
32
/// User: 三帆
43
/// Date: 16/01/2019
54
/// Time: 11:16
65
76
/// target: app首页
87
9-
108
import 'package:flutter/material.dart';
119
import 'package:flutter/rendering.dart';
1210
import 'package:flutter_go/utils/shared_preferences.dart';
@@ -22,10 +20,6 @@ import 'package:flutter_go/components/search_input.dart';
2220
import 'package:flutter_go/model/search_history.dart';
2321
import 'package:flutter_go/resources/widget_name_to_icon.dart';
2422

25-
import './first_page/main_page.dart';
26-
27-
28-
2923
const int ThemeColor = 0xFFC91B3A;
3024

3125
class AppPage extends StatefulWidget {
@@ -40,41 +34,40 @@ class _MyHomePageState extends State<AppPage>
4034
SpUtil sp;
4135
WidgetControlModel widgetControl = new WidgetControlModel();
4236
SearchHistoryList searchHistoryList;
43-
TabController controller;
4437
bool isSearch = false;
45-
String data = '无';
46-
String data2ThirdPage = '这是传给ThirdPage的值';
4738
String appBarTitle = tabData[0]['text'];
39+
List<Widget> list = List();
40+
int _currentIndex = 0;
4841
static List tabData = [
49-
{'text': '业界动态', 'icon': new Icon(Icons.language)},
50-
{'text': 'WIDGET', 'icon': new Icon(Icons.extension)},
51-
{'text': '组件收藏', 'icon': new Icon(Icons.favorite)},
52-
{'text': '关于手册', 'icon': new Icon(Icons.import_contacts)}
42+
{'text': '业界动态', 'icon': Icon(Icons.language)},
43+
{'text': 'WIDGET', 'icon': Icon(Icons.extension)},
44+
{'text': '组件收藏', 'icon': Icon(Icons.favorite)},
45+
{'text': '关于手册', 'icon': Icon(Icons.import_contacts)}
5346
];
5447

55-
List<Widget> myTabs = [];
48+
List<BottomNavigationBarItem> myTabs = [];
5649

5750
@override
5851
void initState() {
5952
super.initState();
60-
6153
initSearchHistory();
62-
controller = new TabController(
63-
initialIndex: 0, vsync: this, length: 4); // 这里的length 决定有多少个底导 submenus
6454
for (int i = 0; i < tabData.length; i++) {
65-
myTabs.add(new Tab(text: tabData[i]['text'], icon: tabData[i]['icon']));
55+
myTabs.add(BottomNavigationBarItem(
56+
icon: tabData[i]['icon'],
57+
title: Text(
58+
tabData[i]['text'],
59+
),
60+
));
6661
}
67-
controller.addListener(() {
68-
if (controller.indexIsChanging) {
69-
_onTabChange();
70-
}
71-
});
72-
Application.controller = controller;
62+
list
63+
..add(FirstPage())
64+
..add(WidgetPage(Provider.db))
65+
..add(CollectionPage())
66+
..add(FourthPage());
7367
}
7468

7569
@override
7670
void dispose() {
77-
controller.dispose();
7871
super.dispose();
7972
}
8073

@@ -106,7 +99,6 @@ class _MyHomePageState extends State<AppPage>
10699
return new SearchInput((value) async {
107100
if (value != '') {
108101
List<WidgetPoint> list = await widgetControl.search(value);
109-
110102
return list
111103
.map((item) => new MaterialSearchResult<String>(
112104
value: item.name,
@@ -123,63 +115,31 @@ class _MyHomePageState extends State<AppPage>
123115
}, (value) {}, () {});
124116
}
125117

126-
renderAppBar(BuildContext context,Widget widget) {
127-
print('renderAppBar=====>>>>>>${controller.index}');
128-
if(controller.index == 0) {
129-
return null;
130-
}
131-
return AppBar(title: buildSearchInput(context));
132-
}
133118

134119
@override
135120
Widget build(BuildContext context) {
136-
var db = Provider.db;
137-
138121
return new Scaffold(
139-
appBar: renderAppBar(context,widget),
140-
body: new TabBarView(controller: controller, children: <Widget>[
141-
//new FirstPage(),
142-
MainPage(),
143-
WidgetPage(db),
144-
CollectionPage(),
145-
FourthPage()
146-
]),
147-
bottomNavigationBar: Material(
148-
color: const Color(0xFFF0EEEF), //底部导航栏主题颜色
149-
child: SafeArea(
150-
child: Container(
151-
height: 65.0,
152-
decoration: BoxDecoration(
153-
color: const Color(0xFFF0F0F0),
154-
boxShadow: <BoxShadow>[
155-
BoxShadow(
156-
color: const Color(0xFFd0d0d0),
157-
blurRadius: 3.0,
158-
spreadRadius: 2.0,
159-
offset: Offset(-1.0, -1.0),
160-
),
161-
],
162-
),
163-
child: TabBar(
164-
controller: controller,
165-
indicatorColor: Theme.of(context).primaryColor,
166-
//tab标签的下划线颜色
167-
// labelColor: const Color(0xFF000000),
168-
indicatorWeight: 3.0,
169-
labelColor: Theme.of(context).primaryColor,
170-
unselectedLabelColor: const Color(0xFF8E8E8E),
171-
tabs: myTabs),
172-
),
173-
),
122+
appBar: new AppBar(title: buildSearchInput(context)),
123+
body: list[_currentIndex],
124+
bottomNavigationBar: BottomNavigationBar(
125+
items: myTabs,
126+
//高亮 被点击高亮
127+
currentIndex: _currentIndex,
128+
//修改 页面
129+
onTap: _ItemTapped,
130+
//shifting :按钮点击移动效果
131+
//fixed:固定
132+
type: BottomNavigationBarType.fixed,
133+
134+
fixedColor: Color(0xFFC91B3A),
174135
),
175136
);
176137
}
177138

178-
void _onTabChange() {
179-
if (this.mounted) {
180-
this.setState(() {
181-
appBarTitle = tabData[controller.index]['text'];
182-
});
183-
}
139+
void _ItemTapped(int index) {
140+
setState(() {
141+
_currentIndex = index;
142+
appBarTitle = tabData[index]['text'];
143+
});
184144
}
185145
}

pubspec.lock

Lines changed: 43 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,14 @@ packages:
1414
name: async
1515
url: "https://pub.dartlang.org"
1616
source: hosted
17-
version: "2.2.0"
17+
version: "2.0.8"
18+
bloc:
19+
dependency: "direct main"
20+
description:
21+
name: bloc
22+
url: "https://pub.dartlang.org"
23+
source: hosted
24+
version: "0.12.0"
1825
boolean_selector:
1926
dependency: transitive
2027
description:
@@ -50,6 +57,13 @@ packages:
5057
url: "https://pub.dartlang.org"
5158
source: hosted
5259
version: "0.0.8"
60+
csslib:
61+
dependency: transitive
62+
description:
63+
name: csslib
64+
url: "https://pub.dartlang.org"
65+
source: hosted
66+
version: "0.16.0"
5367
cupertino_icons:
5468
dependency: "direct main"
5569
description:
@@ -97,6 +111,13 @@ packages:
97111
description: flutter
98112
source: sdk
99113
version: "0.0.0"
114+
flutter_bloc:
115+
dependency: "direct main"
116+
description:
117+
name: flutter_bloc
118+
url: "https://pub.dartlang.org"
119+
source: hosted
120+
version: "0.11.1"
100121
flutter_markdown:
101122
dependency: "direct main"
102123
description:
@@ -116,6 +137,13 @@ packages:
116137
url: "https://pub.dartlang.org"
117138
source: hosted
118139
version: "0.3.4"
140+
html:
141+
dependency: "direct main"
142+
description:
143+
name: html
144+
url: "https://pub.dartlang.org"
145+
source: hosted
146+
version: "0.14.0+2"
119147
image_picker:
120148
dependency: "direct main"
121149
description:
@@ -150,7 +178,7 @@ packages:
150178
name: matcher
151179
url: "https://pub.dartlang.org"
152180
source: hosted
153-
version: "0.12.5"
181+
version: "0.12.3+1"
154182
meta:
155183
dependency: transitive
156184
description:
@@ -171,14 +199,21 @@ packages:
171199
name: pedantic
172200
url: "https://pub.dartlang.org"
173201
source: hosted
174-
version: "1.5.0"
202+
version: "1.4.0"
175203
quiver:
176204
dependency: transitive
177205
description:
178206
name: quiver
179207
url: "https://pub.dartlang.org"
180208
source: hosted
181-
version: "2.0.3"
209+
version: "2.0.1"
210+
rxdart:
211+
dependency: transitive
212+
description:
213+
name: rxdart
214+
url: "https://pub.dartlang.org"
215+
source: hosted
216+
version: "0.21.0"
182217
shared_preferences:
183218
dependency: "direct main"
184219
description:
@@ -197,7 +232,7 @@ packages:
197232
name: source_span
198233
url: "https://pub.dartlang.org"
199234
source: hosted
200-
version: "1.5.5"
235+
version: "1.5.4"
201236
sqflite:
202237
dependency: "direct main"
203238
description:
@@ -218,7 +253,7 @@ packages:
218253
name: stream_channel
219254
url: "https://pub.dartlang.org"
220255
source: hosted
221-
version: "2.0.0"
256+
version: "1.6.8"
222257
string_scanner:
223258
dependency: transitive
224259
description:
@@ -246,7 +281,7 @@ packages:
246281
name: test_api
247282
url: "https://pub.dartlang.org"
248283
source: hosted
249-
version: "0.2.5"
284+
version: "0.2.2"
250285
typed_data:
251286
dependency: transitive
252287
description:
@@ -269,5 +304,5 @@ packages:
269304
source: hosted
270305
version: "2.0.8"
271306
sdks:
272-
dart: ">=2.2.0 <3.0.0"
307+
dart: ">=2.1.0 <3.0.0"
273308
flutter: ">=1.2.1 <2.0.0"

0 commit comments

Comments
 (0)