Skip to content

Commit 2fd625d

Browse files
committed
修改Readme以及增加部分预览图
1 parent 35cdad5 commit 2fd625d

File tree

9 files changed

+128
-83
lines changed

9 files changed

+128
-83
lines changed

README.md

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,50 @@
11
# flutter_wechat
22

3-
A new Flutter project.
3+
<img src="snapshots/logo.png"/>
4+
5+
### 一、概述
6+
- 利用`Flutter` 来构建和模仿`微信7.0.0+ App`,且都是按照`原生微信App`页面,来开发和模仿滴,从而达到与原生app相近的视觉效果。
7+
8+
- 笔者于**2019年08月**入坑`Flutter`开发学习,纯属小白一枚,此项目初衷还是想通过项目实践新技术,在业务实践中发现问题,从而积累技术经验,源码中有详细的注释,以及发现问题和解决问题的思路。
9+
10+
- 笔者希望初学者通过学习和实践这个项目,能够打开学习`Flutter`的大门。当然同时也是抛砖引玉,取长补短,希望能够提供一点思路,少走一些弯路,填补一些细坑,在帮助他人的过程中,收获分享技术的乐趣。
11+
12+
---
13+
14+
### 二、使用
15+
- 项目运行
16+
17+
```
18+
flutter packages get // 项目初始化插件
19+
flutter run // 项目运行
20+
```
21+
- **使用注意**
22+
* 还请优先使用`iPhone 7/8 Plus`的模拟器或真机,来运行整个项目. 根本原因:目前可能部分界面还未做完屏幕适配,以及笔者生前是一名`iOS开发`且用的是`iPhone 7 Plus`手机。
23+
24+
* 登陆和注册:目前只支持`QQ账号``手机号`的登录或注册(PS:后期增加`微信号和QQ邮箱`登陆),且必须保证`QQ``手机号`的有效性。`密码`或者`验证码`可以随便输入,但必须是:`密码`长度需要保证在`8~16`位,`手机验证码`必须保证是`6位有效数字`
25+
26+
---
27+
28+
### 三、期待
29+
- 如果在使用过程中遇到BUG,希望你能Issues我,谢谢(或者尝试下载最新的代码看看BUG修复没有)。
30+
- 如果在使用过程中有任何地方不理解,希望你能Issues我,我非常乐意促使项目的理解和使用,谢谢。
31+
- 如果通过该工程的使用和说明文档的阅读,对你在平时开发中有帮助,码字不易,还请点击右上角`Star``Fork`按钮,谢谢。
32+
- 简书地址:<http://www.jianshu.com/u/126498da7523>
33+
34+
---
35+
36+
### 四、文档
37+
38+
39+
### 五、预览
40+
41+
###### 5.1 通讯录模块
42+
43+
![](./snapshots/contacts/contacts_page_0.png) | ![](./snapshots/contacts/contacts_page_1.png) | ![](./snapshots/contacts/contacts_page_2.png)
44+
:-: | :-: | :-:
45+
446

5-
## Getting Started
647

7-
This project is a starting point for a Flutter application.
848

9-
A few resources to get you started if this is your first Flutter project:
1049

11-
- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
1350

14-
For help getting started with Flutter, view our
15-
[online documentation](https://flutter.dev/docs), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.

ios/Podfile.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ DEPENDENCIES:
2424
- webview_flutter (from `.symlinks/plugins/webview_flutter/ios`)
2525

2626
SPEC REPOS:
27-
https://github.com/CocoaPods/Specs.git:
27+
https://github.com/cocoapods/specs.git:
2828
- FMDB
2929

3030
EXTERNAL SOURCES:
@@ -47,9 +47,9 @@ SPEC CHECKSUMS:
4747
package_info: 48b108e75b8802c2d5e126f208ef540561c98aef
4848
path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d
4949
shared_preferences: 430726339841afefe5142b9c1f50cb6bd7793e01
50-
sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a
50+
sqflite: 4001a31ff81d210346b500c55b17f4d6c7589dd0
5151
webview_flutter: db3aba222b23e4dc432e0c5882834123dc50ff9f
5252

5353
PODFILE CHECKSUM: 545ae53bd1d0bdac26cae6ddb8a02d47a0916981
5454

55-
COCOAPODS: 1.8.4
55+
COCOAPODS: 1.7.3

lib/views/contacts/contacts_page.dart

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ class _ContactsPageState extends State<ContactsPage> {
8686
// 监听事件
8787
void _handleSlideAnimationChanged(Animation<double> slideAnimation) {}
8888
void _handleSlideIsOpenChanged(bool isOpen) {
89-
print('handleSlideIsOpenChanged $isOpen');
9089
setState(() {
9190
_slideIsOpen = isOpen;
9291
});
@@ -121,16 +120,20 @@ class _ContactsPageState extends State<ContactsPage> {
121120
// 容错处理
122121
if (!_slideIsOpen) return;
123122

124-
final cxts = _slidableCxtMap.values.toList();
125-
final len = cxts.length;
126-
for (var i = 0; i < len; i++) {
127-
final value = cxts[i];
128-
if (Slidable.of(value)?.renderingMode != SlidableRenderingMode.none) {
129-
// 关掉上一个
130-
Slidable.of(value)?.close();
131-
return;
132-
}
133-
}
123+
// 方案三:
124+
_slidableController.activeState?.close();
125+
126+
// 方案二:
127+
// final cxts = _slidableCxtMap.values.toList();
128+
// final len = cxts.length;
129+
// for (var i = 0; i < len; i++) {
130+
// final value = cxts[i];
131+
// if (Slidable.of(value)?.renderingMode != SlidableRenderingMode.none) {
132+
// // 关掉上一个
133+
// Slidable.of(value)?.close();
134+
// return;
135+
// }
136+
// }
134137
}
135138

136139
/// 构建头部
@@ -235,12 +238,16 @@ class _ContactsPageState extends State<ContactsPage> {
235238
// 细节:这里由于 SlideActionType.primary 对应 actions 为空,所以虽然看似展开空,目的就是关闭 上一个打开的 secondary action
236239
// Slidable.of(cxt)?.open(actionType: SlideActionType.primary);
237240
// 上面的虽然打开了一个空的 但是系统还是会认为是 打开的 也就是 _slideIsOpen = true
238-
// 手动设置为true
241+
// 手动设置为false
239242
// _slideIsOpen = false;
240243

241244
// 方案二: 每次生成一个 cell ,就用 Map[key] = cxt 记录起来,特别注意,这里用Map 而不是 List or Set
242245
// 关闭上一个侧滑
243246
_closeSlidable();
247+
248+
// 方案三: 直接拿这个activaState 注:已经封装到了 _closeSlidable
249+
// _slidableController.activeState?.close();
250+
244251
// 下钻
245252
NavigatorUtils.push(cxt,
246253
'${ContactsRouter.contactInfoPage}?idstr=${user.idstr}');
@@ -355,8 +362,12 @@ class _ContactsPageState extends State<ContactsPage> {
355362
dragDismissible: true,
356363
child: SlidableDrawerDismissal(),
357364
onWillDismiss: (actionType) {
365+
print('🔥🔥🔥 $title');
358366
return false;
359367
},
368+
onDismissed: (_) {
369+
print('🔥🔥🔥 xx $title');
370+
},
360371
),
361372
actionPane: SlidableScrollActionPane(),
362373
actionExtentRatio: 0.2,
@@ -499,7 +510,7 @@ class _ContactsPageState extends State<ContactsPage> {
499510
data: tagList,
500511
tag: _suspensionTag,
501512
hintOffsetX: -80,
502-
ignoreTags: [],
513+
ignoreTags: ['♀'],
503514
// selectedTagColor: Colors.red,
504515
mapTag: {
505516
"♀": new SvgPicture.asset(

0 commit comments

Comments
 (0)