Skip to content

Commit 9351d29

Browse files
committed
增加模糊与阴影支持
1 parent ac42be1 commit 9351d29

File tree

3 files changed

+116
-53
lines changed

3 files changed

+116
-53
lines changed

ios/Podfile.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,13 @@ PODS:
77
- device_info (0.0.1):
88
- Flutter
99
- Flutter (1.0.0)
10-
- flutter_lottie (0.0.1):
11-
- Flutter
12-
- lottie-ios
1310
- flutter_webview_plugin (0.0.1):
1411
- Flutter
1512
- fluttertoast (0.0.2):
1613
- Flutter
1714
- FMDB (2.7.2):
1815
- FMDB/standard (= 2.7.2)
1916
- FMDB/standard (2.7.2)
20-
- lottie-ios (2.5.2)
2117
- package_info (0.0.1):
2218
- Flutter
2319
- path_provider (0.0.1):
@@ -42,7 +38,6 @@ DEPENDENCIES:
4238
- connectivity (from `.symlinks/plugins/connectivity/ios`)
4339
- device_info (from `.symlinks/plugins/device_info/ios`)
4440
- Flutter (from `.symlinks/flutter/ios`)
45-
- flutter_lottie (from `.symlinks/plugins/flutter_lottie/ios`)
4641
- flutter_webview_plugin (from `.symlinks/plugins/flutter_webview_plugin/ios`)
4742
- fluttertoast (from `.symlinks/plugins/fluttertoast/ios`)
4843
- package_info (from `.symlinks/plugins/package_info/ios`)
@@ -57,7 +52,6 @@ DEPENDENCIES:
5752
SPEC REPOS:
5853
https://github.com/cocoapods/specs.git:
5954
- FMDB
60-
- lottie-ios
6155
- Reachability
6256

6357
EXTERNAL SOURCES:
@@ -69,8 +63,6 @@ EXTERNAL SOURCES:
6963
:path: ".symlinks/plugins/device_info/ios"
7064
Flutter:
7165
:path: ".symlinks/flutter/ios"
72-
flutter_lottie:
73-
:path: ".symlinks/plugins/flutter_lottie/ios"
7466
flutter_webview_plugin:
7567
:path: ".symlinks/plugins/flutter_webview_plugin/ios"
7668
fluttertoast:
@@ -97,11 +89,9 @@ SPEC CHECKSUMS:
9789
connectivity: c72716e202a1225ec4810740d5cb56b8ae3bf4cc
9890
device_info: 3ebad48f726348f69abd802f3334a8d1ed795fbd
9991
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
100-
flutter_lottie: c1fd7e92e771209f8b623119646c15201c5e8c87
10192
flutter_webview_plugin: ed9e8a6a96baf0c867e90e1bce2673913eeac694
10293
fluttertoast: b644586ef3b16f67fae9a1f8754cef6b2d6b634b
10394
FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa
104-
lottie-ios: 3fef45d3fabe63e3c7c2eb603dd64ddfffc73062
10595
package_info: 78cabb3c322943c55d39676f4a5bfc748c01d055
10696
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
10797
permission_handler: fa6b0d784b1a43cb96b468a5b8365cb130b1956a

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,8 @@
539539
"${BUILT_PRODUCTS_DIR}/android_intent/android_intent.framework",
540540
"${BUILT_PRODUCTS_DIR}/connectivity/connectivity.framework",
541541
"${BUILT_PRODUCTS_DIR}/device_info/device_info.framework",
542-
"${BUILT_PRODUCTS_DIR}/flutter_lottie/flutter_lottie.framework",
543542
"${BUILT_PRODUCTS_DIR}/flutter_webview_plugin/flutter_webview_plugin.framework",
544543
"${BUILT_PRODUCTS_DIR}/fluttertoast/fluttertoast.framework",
545-
"${BUILT_PRODUCTS_DIR}/lottie-ios/Lottie.framework",
546544
"${BUILT_PRODUCTS_DIR}/package_info/package_info.framework",
547545
"${BUILT_PRODUCTS_DIR}/path_provider/path_provider.framework",
548546
"${BUILT_PRODUCTS_DIR}/share/share.framework",
@@ -559,10 +557,8 @@
559557
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/android_intent.framework",
560558
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/connectivity.framework",
561559
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/device_info.framework",
562-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_lottie.framework",
563560
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/flutter_webview_plugin.framework",
564561
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/fluttertoast.framework",
565-
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Lottie.framework",
566562
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/package_info.framework",
567563
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/path_provider.framework",
568564
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/share.framework",

lib/widget/repos_header_item.dart

Lines changed: 116 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:ui';
2+
13
import 'package:flutter/material.dart';
24
import 'package:gsy_github_app_flutter/common/config/config.dart';
35
import 'package:gsy_github_app_flutter/common/model/Repository.dart';
@@ -43,7 +45,9 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
4345
child: new GSYIConText(
4446
icon,
4547
text,
46-
GSYConstant.smallSubLightText,
48+
GSYConstant.smallSubLightText.copyWith(shadows: [
49+
BoxShadow(color: Colors.grey, offset: Offset(0.5, 0.5))
50+
]),
4751
Color(GSYColors.subLightTextColor),
4852
15.0,
4953
padding: 3.0,
@@ -75,7 +79,9 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
7579
),
7680
child: new Text(
7781
item,
78-
style: GSYConstant.smallSubLightText,
82+
style: GSYConstant.smallSubLightText.copyWith(shadows: [
83+
BoxShadow(color: Colors.grey, offset: Offset(0.5, 0.5))
84+
]),
7985
),
8086
));
8187
}
@@ -123,26 +129,31 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
123129
@override
124130
void didUpdateWidget(ReposHeaderItem oldWidget) {
125131
super.didUpdateWidget(oldWidget);
132+
126133
///如果没有tag列表,不需要处理
127134
/*if(layoutTopicContainerKey.currentContext == null || layoutLastTopicKey.currentContext == null) {
128135
return;
129136
}*/
137+
130138
///如果存在tag,根据tag去判断,修复溢出
131-
new Future.delayed(Duration(seconds: 0), (){
139+
new Future.delayed(Duration(seconds: 0), () {
132140
/// tag 所在 container
133-
RenderBox renderBox2 = layoutTopicContainerKey.currentContext?.findRenderObject();
141+
RenderBox renderBox2 =
142+
layoutTopicContainerKey.currentContext?.findRenderObject();
143+
134144
/// 最后面的一个tag
135-
RenderBox renderBox3 = layoutLastTopicKey.currentContext?.findRenderObject();
145+
RenderBox renderBox3 =
146+
layoutLastTopicKey.currentContext?.findRenderObject();
136147
double overflow = ((renderBox3?.localToGlobal(Offset.zero)?.dy ?? 0) -
137-
(renderBox2?.localToGlobal(Offset.zero)?.dy ?? 0)) -
148+
(renderBox2?.localToGlobal(Offset.zero)?.dy ?? 0)) -
138149
(layoutLastTopicKey.currentContext?.size?.height ?? 0);
139150
var newSize;
140-
if(overflow > 0) {
141-
newSize = layoutKey.currentContext.size.height + overflow;
151+
if (overflow > 0) {
152+
newSize = layoutKey.currentContext.size.height + overflow;
142153
} else {
143-
newSize = layoutKey.currentContext.size.height + 10.0;
154+
newSize = layoutKey.currentContext.size.height + 10.0;
144155
}
145-
if(Config.DEBUG) {
156+
if (Config.DEBUG) {
146157
print("newSize $newSize overflow $overflow");
147158
}
148159
if (widgetHeight != newSize && newSize > 0) {
@@ -171,11 +182,9 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
171182
GSYICons.DEFAULT_REMOTE_PIC),
172183
),
173184
),
174-
child: new Container(
175-
///透明黑色遮罩
176-
decoration: new BoxDecoration(
177-
color: Color(GSYColors.primaryDarkValue & 0xA0FFFFFF),
178-
),
185+
child: new BackdropFilter(
186+
///高斯模糊
187+
filter: ImageFilter.blur(sigmaX: 8.0, sigmaY: 8.0),
179188
child: new Padding(
180189
padding: new EdgeInsets.only(
181190
left: 10.0, top: 0.0, right: 10.0, bottom: 10.0),
@@ -194,42 +203,76 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
194203
context, widget.reposHeaderViewModel.ownerName);
195204
},
196205
child: new Text(widget.reposHeaderViewModel.ownerName,
197-
style: GSYConstant.normalTextActionWhiteBold),
206+
style: GSYConstant.normalTextActionWhiteBold
207+
.copyWith(shadows: [
208+
BoxShadow(
209+
color: Colors.black,
210+
offset: Offset(0.5, 0.5))
211+
])),
198212
),
199-
new Text(" /",
200-
style: GSYConstant.normalTextMitWhiteBold),
213+
new Text(" / ",
214+
style: GSYConstant.normalTextMitWhiteBold.copyWith(
215+
shadows: [
216+
BoxShadow(
217+
color: Colors.black,
218+
offset: Offset(0.5, 0.5))
219+
])),
201220

202221
///仓库名
203-
new Text(
204-
" " + widget.reposHeaderViewModel.repositoryName,
205-
style: GSYConstant.normalTextMitWhiteBold),
222+
new Text(widget.reposHeaderViewModel.repositoryName,
223+
style: GSYConstant.normalTextMitWhiteBold.copyWith(
224+
shadows: [
225+
BoxShadow(
226+
color: Colors.black,
227+
offset: Offset(0.5, 0.5))
228+
])),
206229
],
207230
),
208231
new Row(
209232
children: <Widget>[
210233
///仓库语言
211234
new Text(
212235
widget.reposHeaderViewModel.repositoryType ?? "--",
213-
style: GSYConstant.smallSubLightText),
236+
style: GSYConstant.smallSubLightText.copyWith(
237+
shadows: [
238+
BoxShadow(
239+
color: Colors.grey,
240+
offset: Offset(0.5, 0.5))
241+
])),
214242
new Container(width: 5.3, height: 1.0),
215243

216244
///仓库大小
217245
new Text(
218246
widget.reposHeaderViewModel.repositorySize ?? "--",
219-
style: GSYConstant.smallSubLightText),
247+
style: GSYConstant.smallSubLightText.copyWith(
248+
shadows: [
249+
BoxShadow(
250+
color: Colors.grey,
251+
offset: Offset(0.5, 0.5))
252+
])),
220253
new Container(width: 5.3, height: 1.0),
221254

222255
///仓库协议
223256
new Text(widget.reposHeaderViewModel.license ?? "--",
224-
style: GSYConstant.smallSubLightText),
257+
style: GSYConstant.smallSubLightText.copyWith(
258+
shadows: [
259+
BoxShadow(
260+
color: Colors.grey,
261+
offset: Offset(0.5, 0.5))
262+
])),
225263
],
226264
),
227265

228266
///仓库描述
229267
new Container(
230268
child: new Text(
231269
widget.reposHeaderViewModel.repositoryDes ?? "---",
232-
style: GSYConstant.smallSubLightText,
270+
style: GSYConstant.smallSubLightText.copyWith(
271+
shadows: [
272+
BoxShadow(
273+
color: Colors.grey,
274+
offset: Offset(0.5, 0.5))
275+
]),
233276
maxLines: 3,
234277
overflow: TextOverflow.ellipsis,
235278
),
@@ -257,8 +300,18 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
257300
const BoxConstraints(minWidth: 0.0, minHeight: 0.0),
258301
child: new Text(_getInfoText(context),
259302
style: widget.reposHeaderViewModel.repositoryIsFork
260-
? GSYConstant.smallActionLightText
261-
: GSYConstant.smallSubLightText),
303+
? GSYConstant.smallActionLightText.copyWith(
304+
shadows: [
305+
BoxShadow(
306+
color: Colors.grey,
307+
offset: Offset(0.5, 0.5))
308+
])
309+
: GSYConstant.smallSubLightText.copyWith(
310+
shadows: [
311+
BoxShadow(
312+
color: Colors.grey,
313+
offset: Offset(0.5, 0.5))
314+
])),
262315
),
263316
),
264317
new Divider(
@@ -289,11 +342,19 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
289342
},
290343
),
291344

292-
///fork状态
293345
new Container(
294-
width: 0.3,
295-
height: 25.0,
296-
color: Color(GSYColors.subLightTextColor)),
346+
width: 0.3,
347+
height: 25.0,
348+
decoration: BoxDecoration(
349+
color: Color(GSYColors.subLightTextColor),
350+
boxShadow: [
351+
BoxShadow(
352+
color: Colors.grey,
353+
offset: Offset(0.5, 0.5))
354+
]),
355+
),
356+
357+
///fork状态
297358
_getBottomItem(
298359
GSYICons.REPOS_ITEM_FORK,
299360
widget.reposHeaderViewModel.repositoryFork,
@@ -310,11 +371,19 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
310371
},
311372
),
312373

313-
///订阅状态
314374
new Container(
315-
width: 0.3,
316-
height: 25.0,
317-
color: Color(GSYColors.subLightTextColor)),
375+
width: 0.3,
376+
height: 25.0,
377+
decoration: BoxDecoration(
378+
color: Color(GSYColors.subLightTextColor),
379+
boxShadow: [
380+
BoxShadow(
381+
color: Colors.grey,
382+
offset: Offset(0.5, 0.5))
383+
]),
384+
),
385+
386+
///订阅状态
318387
_getBottomItem(
319388
GSYICons.REPOS_ITEM_WATCH,
320389
widget.reposHeaderViewModel.repositoryWatch,
@@ -331,11 +400,19 @@ class _ReposHeaderItemState extends State<ReposHeaderItem> {
331400
},
332401
),
333402

334-
///issue状态
335403
new Container(
336-
width: 0.3,
337-
height: 25.0,
338-
color: Color(GSYColors.subLightTextColor)),
404+
width: 0.3,
405+
height: 25.0,
406+
decoration: BoxDecoration(
407+
color: Color(GSYColors.subLightTextColor),
408+
boxShadow: [
409+
BoxShadow(
410+
color: Colors.grey,
411+
offset: Offset(0.5, 0.5))
412+
]),
413+
),
414+
415+
///issue状态
339416
_getBottomItem(
340417
GSYICons.REPOS_ITEM_ISSUE,
341418
widget.reposHeaderViewModel.repositoryIssue,

0 commit comments

Comments
 (0)