Skip to content

Commit 19ded28

Browse files
committed
添加LayoutBuilder、IgnorePointer、AbsorbPointer、BackdropFilter
1 parent 174bc72 commit 19ded28

File tree

18 files changed

+569
-27
lines changed

18 files changed

+569
-27
lines changed

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,18 @@
55
### FlutterUnit apk 下载体验:
66

77

8-
![](https://user-gold-cdn.xitu.io/2020/4/18/1718a20ac5a16964?w=300&h=390&f=png&s=23054)
8+
![](https://user-gold-cdn.xitu.io/2020/4/19/17190d6a0b639752?w=300&h=390&f=png&s=22993)
99

1010
---
1111

1212

1313
### 一、组件的展示页面
1414

15-
#### 1. `200+组件收录`
15+
#### 1. `210+组件收录`
1616

1717
> Flutter源码中的可用的组件一共350个左右,纷繁复杂,也没有明确的分类标准
1818
FlutterUnit 对`大大小小,常用不常用`的组件能收的尽量收录。并`根据个人感觉进行评星 `
19-
`目前收录组件207个`,每个都有至少一个演示展现和代码展示。
19+
`目前收录组件211个`,每个都有至少一个演示展现和代码展示。
2020

2121
| . | . | . |
2222
|------|------------|------------|
@@ -198,4 +198,16 @@ feature " 小彩蛋: 【长按】底部栏【最左侧按钮】,打开左边
198198
" 【长按】底部栏【最右侧按钮】,打开右边菜单栏
199199
200200
fixed " 收藏集的AppBar背景色同主页选中色。
201+
```
202+
203+
---
204+
205+
206+
- `2020-4-19`
207+
208+
```
209+
optimize " 添加收录【LayoutBuilder】组件
210+
optimize " 添加收录【IgnorePointer】组件
211+
optimize " 添加收录【AbsorbPointer】组件
212+
optimize " 添加收录【BackdropFilter】组件
201213
```

assets/flutter.db

24 KB
Binary file not shown.

ios/Podfile.lock

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,34 @@ PODS:
33
- FMDB (2.7.5):
44
- FMDB/standard (= 2.7.5)
55
- FMDB/standard (2.7.5)
6+
- share (0.5.2):
7+
- Flutter
8+
- shared_preferences (0.0.1):
9+
- Flutter
10+
- shared_preferences_macos (0.0.1):
11+
- Flutter
12+
- shared_preferences_web (0.0.1):
13+
- Flutter
614
- sqflite (0.0.1):
715
- Flutter
816
- FMDB (~> 2.7.2)
17+
- url_launcher (0.0.1):
18+
- Flutter
19+
- url_launcher_macos (0.0.1):
20+
- Flutter
21+
- url_launcher_web (0.0.1):
22+
- Flutter
923

1024
DEPENDENCIES:
1125
- Flutter (from `Flutter`)
26+
- share (from `.symlinks/plugins/share/ios`)
27+
- shared_preferences (from `.symlinks/plugins/shared_preferences/ios`)
28+
- shared_preferences_macos (from `.symlinks/plugins/shared_preferences_macos/ios`)
29+
- shared_preferences_web (from `.symlinks/plugins/shared_preferences_web/ios`)
1230
- sqflite (from `.symlinks/plugins/sqflite/ios`)
31+
- url_launcher (from `.symlinks/plugins/url_launcher/ios`)
32+
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
33+
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
1334

1435
SPEC REPOS:
1536
trunk:
@@ -18,13 +39,34 @@ SPEC REPOS:
1839
EXTERNAL SOURCES:
1940
Flutter:
2041
:path: Flutter
42+
share:
43+
:path: ".symlinks/plugins/share/ios"
44+
shared_preferences:
45+
:path: ".symlinks/plugins/shared_preferences/ios"
46+
shared_preferences_macos:
47+
:path: ".symlinks/plugins/shared_preferences_macos/ios"
48+
shared_preferences_web:
49+
:path: ".symlinks/plugins/shared_preferences_web/ios"
2150
sqflite:
2251
:path: ".symlinks/plugins/sqflite/ios"
52+
url_launcher:
53+
:path: ".symlinks/plugins/url_launcher/ios"
54+
url_launcher_macos:
55+
:path: ".symlinks/plugins/url_launcher_macos/ios"
56+
url_launcher_web:
57+
:path: ".symlinks/plugins/url_launcher_web/ios"
2358

2459
SPEC CHECKSUMS:
2560
Flutter: 0e3d915762c693b495b44d77113d4970485de6ec
2661
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
62+
share: bae0a282aab4483288913fc4dc0b935d4b491f2e
63+
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
64+
shared_preferences_macos: f3f29b71ccbb56bf40c9dd6396c9acf15e214087
65+
shared_preferences_web: 141cce0c3ed1a1c5bf2a0e44f52d31eeb66e5ea9
2766
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
67+
url_launcher: a1c0cc845906122c4784c542523d8cacbded5626
68+
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
69+
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
2870

2971
PODFILE CHECKSUM: 1b66dae606f75376c5f2135a8290850eeb09ae83
3072

ios/Runner.xcodeproj/project.pbxproj

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
05552E71DDEE1B210A67DBD4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 70F3B239A93318DF93C8360D /* Pods_Runner.framework */; };
1111
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
1212
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
13-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; };
14-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
1513
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
1614
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; };
1715
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
@@ -27,7 +25,6 @@
2725
dstPath = "";
2826
dstSubfolderSpec = 10;
2927
files = (
30-
3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */,
3128
9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */,
3229
);
3330
name = "Embed Frameworks";
@@ -40,7 +37,6 @@
4037
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
4138
33DC5F3DBC90F47343297D28 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
4239
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
43-
3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = "<group>"; };
4440
70F3B239A93318DF93C8360D /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
4541
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
4642
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
@@ -63,7 +59,6 @@
6359
buildActionMask = 2147483647;
6460
files = (
6561
9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */,
66-
3B80C3941E831B6300D905FE /* App.framework in Frameworks */,
6762
05552E71DDEE1B210A67DBD4 /* Pods_Runner.framework in Frameworks */,
6863
);
6964
runOnlyForDeploymentPostprocessing = 0;
@@ -82,7 +77,6 @@
8277
9740EEB11CF90186004384FC /* Flutter */ = {
8378
isa = PBXGroup;
8479
children = (
85-
3B80C3931E831B6300D905FE /* App.framework */,
8680
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
8781
9740EEBA1CF902C7004384FC /* Flutter.framework */,
8882
9740EEB21CF90195004384FC /* Debug.xcconfig */,
@@ -141,7 +135,6 @@
141135
F3E5257BAD406E789F4D36B1 /* Pods-Runner.release.xcconfig */,
142136
33DC5F3DBC90F47343297D28 /* Pods-Runner.profile.xcconfig */,
143137
);
144-
name = Pods;
145138
path = Pods;
146139
sourceTree = "<group>";
147140
};
@@ -181,7 +174,9 @@
181174
TargetAttributes = {
182175
97C146ED1CF9000F007C117D = {
183176
CreatedOnToolsVersion = 7.3.1;
177+
DevelopmentTeam = V6P5QXUH55;
184178
LastSwiftMigration = 1100;
179+
ProvisioningStyle = Automatic;
185180
};
186181
};
187182
};
@@ -374,7 +369,10 @@
374369
buildSettings = {
375370
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
376371
CLANG_ENABLE_MODULES = YES;
372+
CODE_SIGN_IDENTITY = "Apple Development";
373+
CODE_SIGN_STYLE = Automatic;
377374
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
375+
DEVELOPMENT_TEAM = V6P5QXUH55;
378376
ENABLE_BITCODE = NO;
379377
FRAMEWORK_SEARCH_PATHS = (
380378
"$(inherited)",
@@ -386,8 +384,9 @@
386384
"$(inherited)",
387385
"$(PROJECT_DIR)/Flutter",
388386
);
389-
PRODUCT_BUNDLE_IDENTIFIER = com.toly1994.flutterUnit;
387+
PRODUCT_BUNDLE_IDENTIFIER = "com.toly1994.flutter-unit";
390388
PRODUCT_NAME = "$(TARGET_NAME)";
389+
PROVISIONING_PROFILE_SPECIFIER = "";
391390
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
392391
SWIFT_VERSION = 5.0;
393392
VERSIONING_SYSTEM = "apple-generic";
@@ -508,7 +507,10 @@
508507
buildSettings = {
509508
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
510509
CLANG_ENABLE_MODULES = YES;
510+
CODE_SIGN_IDENTITY = "Apple Development";
511+
CODE_SIGN_STYLE = Automatic;
511512
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
513+
DEVELOPMENT_TEAM = V6P5QXUH55;
512514
ENABLE_BITCODE = NO;
513515
FRAMEWORK_SEARCH_PATHS = (
514516
"$(inherited)",
@@ -520,8 +522,9 @@
520522
"$(inherited)",
521523
"$(PROJECT_DIR)/Flutter",
522524
);
523-
PRODUCT_BUNDLE_IDENTIFIER = com.toly1994.flutterUnit;
525+
PRODUCT_BUNDLE_IDENTIFIER = "com.toly1994.flutter-unit";
524526
PRODUCT_NAME = "$(TARGET_NAME)";
527+
PROVISIONING_PROFILE_SPECIFIER = "";
525528
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
526529
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
527530
SWIFT_VERSION = 5.0;
@@ -535,7 +538,10 @@
535538
buildSettings = {
536539
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
537540
CLANG_ENABLE_MODULES = YES;
541+
CODE_SIGN_IDENTITY = "Apple Development";
542+
CODE_SIGN_STYLE = Automatic;
538543
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
544+
DEVELOPMENT_TEAM = V6P5QXUH55;
539545
ENABLE_BITCODE = NO;
540546
FRAMEWORK_SEARCH_PATHS = (
541547
"$(inherited)",
@@ -547,8 +553,9 @@
547553
"$(inherited)",
548554
"$(PROJECT_DIR)/Flutter",
549555
);
550-
PRODUCT_BUNDLE_IDENTIFIER = com.toly1994.flutterUnit;
556+
PRODUCT_BUNDLE_IDENTIFIER = "com.toly1994.flutter-unit";
551557
PRODUCT_NAME = "$(TARGET_NAME)";
558+
PROVISIONING_PROFILE_SPECIFIER = "";
552559
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
553560
SWIFT_VERSION = 5.0;
554561
VERSIONING_SYSTEM = "apple-generic";
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

lib/main.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import 'blocs/widgets/home_bloc.dart';
1717
import 'blocs/widgets/home_event.dart';
1818

1919
import 'app/router.dart';
20+
import 'tools/widget_me_repository.dart';
2021

2122
void main() async {
2223
// await Initial.init();
@@ -35,6 +36,7 @@ class BlocWrapper extends StatelessWidget {
3536
BlocWrapper({this.child});
3637

3738
final repository = WidgetDbRepository(storage);
39+
// final repository = WidgetMeRepository();
3840

3941
@override
4042
Widget build(BuildContext context) {

lib/storage/po/collect_po.dart

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,29 @@ import 'package:equatable/equatable.dart';
44
/// contact me by email [email protected]
55
/// 说明:
66
7-
//1 动画组件集 ff000000 收录动画相关组件 2020-04-17
7+
// static const String sql_create_collect = """
8+
// CREATE TABLE IF NOT EXISTS category_widget(
9+
// id INTEGER PRIMARY KEY AUTOINCREMENT,
10+
// name VARCHAR(64) NOT NULL,
11+
// color VARCHAR(9) DEFAULT '#FF2196F3',
12+
// info VARCHAR(256) DEFAULT '这里什么都没有...',
13+
// created DATETIME NOT NULL,
14+
// updated DATETIME NOT NULL,
15+
// priority INTEGER DEFAULT 0,
16+
// image VARCHAR(128) NULL image DEFAULT ''
17+
// );"""; //建表语句
818

919
class CollectPo extends Equatable {
1020
final int id;
1121
final String name;
1222
final int color;
1323
final String info;
1424
final DateTime created;
25+
final DateTime updated;
1526
final String image;
27+
final int priority;
1628

17-
const CollectPo({this.id, this.name, this.color, this.created, this.info,this.image});
29+
const CollectPo({this.id, this.name, this.color, this.created, this.updated,this.priority,this.info,this.image});
1830

1931
factory CollectPo.fromJson(Map<String, dynamic> map) {
2032
return CollectPo(
@@ -23,16 +35,18 @@ class CollectPo extends Equatable {
2335
color: map["color"],
2436
created: map["created"],
2537
image: map["image"],
38+
priority: map["priority"],
39+
updated: map["updated"],
2640
info: map["info"]);
2741
}
2842

2943

3044
@override
3145
String toString() {
32-
return 'CollectPo{id: $id, name: $name, color: $color, info: $info, created: $created, image: $image}';
46+
return 'CollectPo{id: $id, name: $name, color: $color, info: $info, created: $created, updated: $updated, image: $image, priority: $priority}';
3347
}
3448

3549
@override
3650
List<Object> get props =>
37-
[id, name, color, created, image, info];
51+
[id, name, color, created, image, info,updated,priority];
3852
}
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import 'package:flutter/material.dart';
2+
import 'package:flutter_unit/views/dialogs/dialog_about.dart';
3+
4+
/// create by 张风捷特烈 on 2020-04-19
5+
/// contact me by email [email protected]
6+
/// 说明:
7+
8+
// {
9+
// "widgetId": 292,
10+
// "name": 'AbsorbPointer基本使用',
11+
// "priority": 1,
12+
// "subtitle":
13+
// "【child】 : 孩子组件 【Widget】\n"
14+
// "【absorbing】 : 是否吸收事件 【bool】\n"
15+
// "如下,Switch选中时absorbing为true,按钮事件将被吸收,无法点击。",
16+
// }
17+
18+
class CustomAbsorbPointer extends StatefulWidget {
19+
@override
20+
_CustomAbsorbPointerState createState() => _CustomAbsorbPointerState();
21+
}
22+
23+
class _CustomAbsorbPointerState extends State<CustomAbsorbPointer> {
24+
bool _absorbing = false;
25+
26+
@override
27+
Widget build(BuildContext context) {
28+
return Container(
29+
child: Wrap(
30+
crossAxisAlignment: WrapCrossAlignment.center,
31+
children: <Widget>[
32+
GestureDetector(
33+
onTap: (){
34+
print('AbsorbPointer');
35+
},
36+
child: AbsorbPointer(
37+
absorbing: _absorbing,
38+
child: _buildButton(),
39+
),
40+
),
41+
_buildSwitch(),
42+
Text(!_absorbing ? '允许点击' : '事件已被吸收')
43+
],
44+
),
45+
);
46+
}
47+
48+
Widget _buildButton() => RaisedButton(
49+
color: Theme.of(context).primaryColor,
50+
child: Text(
51+
'To About',
52+
style: TextStyle(color: Colors.white),
53+
),
54+
onPressed: () => DialogAbout.show(context));
55+
56+
_buildSwitch() => Switch(
57+
value: _absorbing,
58+
onChanged: (v) {
59+
setState(() {
60+
_absorbing = v;
61+
});
62+
});
63+
}

0 commit comments

Comments
 (0)