Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6caa466

Browse files
committed
basic
1 parent 25f3a58 commit 6caa466

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+987
-2728
lines changed

‎lib/app.dart‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter/cupertino.dart';
32
import 'package:flutter_localizations/flutter_localizations.dart';
43
import 'package:get/get.dart';
4+
import 'package:oktoast/oktoast.dart';
55
import 'package:provider/provider.dart';
66
import 'package:wechat_flutter/pages/login/login_begin_page.dart';
77
import 'package:wechat_flutter/pages/root/root_page.dart';
@@ -35,6 +35,9 @@ class MyApp extends StatelessWidget {
3535
return model.goToLogin ? new LoginBeginPage() : new RootPage();
3636
}
3737
},
38+
builder: (BuildContext context, Widget? widget) {
39+
return OKToast(child: widget ?? Container());
40+
},
3841
);
3942
}
4043
}

‎lib/http/api.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ void postSuggestionWithAvatar(BuildContext context) async {
2323
);
2424

2525
if (data.toString().contains('ucc')) {
26-
showToast(context, '设置头像成功');
26+
showToast( '设置头像成功');
2727
model.avatar = avatarUrl;
2828
model.refresh();
2929
await SharedUtil.instance.saveString(Keys.faceUrl, avatarUrl);
3030
} else {
31-
showToast(context, '设置头像失败');
31+
showToast( '设置头像失败');
3232
}
3333
},
3434
);
@@ -76,7 +76,7 @@ uploadImgApi(BuildContext context, base64Img, Callback callback) async {
7676
}
7777
},
7878
errorCallBack: (String msg, int code) {
79-
showToast(context, msg);
79+
showToast( msg);
8080
},
8181
params: {"image_base_64": base64Img},
8282
);

‎lib/im/friend_handle.dart‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ Future<dynamic> addFriend(String userName, BuildContext context,
88
try {
99
var result = await im.addFriend(userName);
1010
if (result.toString().contains('Friend_Exist')) {
11-
showToast(context, '朋友已存在');
11+
showToast( '朋友已存在');
1212
} else if (result.toString().contains('30014')) {
13-
showToast(context, '对方好友人数上限');
13+
showToast( '对方好友人数上限');
1414
return;
1515
} else if (result.toString().contains('30003')) {
16-
showToast(context, '添加的这个账号不存在');
16+
showToast( '添加的这个账号不存在');
1717
return;
1818
} else {
19-
showToast(context, '添加成功');
19+
showToast( '添加成功');
2020
}
2121
if (suCc == null) {
2222
popToHomePage();
@@ -33,9 +33,9 @@ Future<dynamic> delFriend(String userName, BuildContext context,
3333
try {
3434
var result = await im.delFriend(userName);
3535
if (result.toString().contains('ucc')) {
36-
showToast(context, '删除成功');
36+
showToast( '删除成功');
3737
} else {
38-
showToast(context, result);
38+
showToast( result);
3939
}
4040

4141
if (suCc == null) {

‎lib/im/login_handle.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Future<void> init(BuildContext context) async {
1212
var result = await im.init(appId);
1313
debugPrint('初始化结果 ======> ${result.toString()}');
1414
} on PlatformException {
15-
showToast(context, "初始化失败");
15+
showToast( "初始化失败");
1616
}
1717
}
1818

@@ -32,7 +32,7 @@ Future<void> login(String userName, BuildContext context) async {
3232
print('error::' + result.toString());
3333
}
3434
} on PlatformException {
35-
showToast(context, '你已登录或者其他错误');
35+
showToast( '你已登录或者其他错误');
3636
}
3737
}
3838

@@ -42,7 +42,7 @@ Future<void> loginOut(BuildContext context) async {
4242
try {
4343
var result = await im.imLogout();
4444
if (result.toString().contains('ucc')) {
45-
showToast(context, '登出成功');
45+
showToast( '登出成功');
4646
} else {
4747
print('error::' + result.toString());
4848
}

‎lib/pages/chat/chat_info_page.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class _ChatInfoPageState extends State<ChatInfoPage> {
7575
confirmAlert(
7676
context,
7777
(isOK) {
78-
if (isOK) showToast(context, '敬请期待');
78+
if (isOK) showToast( '敬请期待');
7979
},
8080
tips: '确定删除群的聊天记录吗?',
8181
okBtn: '清空',

‎lib/pages/chat/chat_more_page.dart‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ class _ChatMorePageState extends State<ChatMorePage> {
7676
logError(e.code, e.description);
7777
}
7878
} else if (name == '红包') {
79-
showToast(context, '测试发送红包消息');
79+
showToast( '测试发送红包消息');
8080
await sendTextMsg('${widget?.id}', widget.type, "测试发送红包消息");
8181
} else {
82-
showToast(context, '敬请期待$name');
82+
showToast( '敬请期待$name');
8383
}
8484
}
8585

‎lib/pages/chat/set_remark_page.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class _SetRemarkPageState extends State<SetRemarkPage> {
4040
radius: 4.0,
4141
onTap: () {
4242
if (!strNoEmpty(_tc.text)) {
43-
showToast(context, '输入的内容不能为空');
43+
showToast( '输入的内容不能为空');
4444
return;
4545
}
4646
},

‎lib/pages/chat/shoot_page.dart‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
170170
if (!isOnPress) return;
171171
isOnPress = false;
172172
if (_timing < 2) {
173-
showToast(context, '录制时间过短');
173+
showToast( '录制时间过短');
174174
stopVideoRecording();
175175
if (_timer != null) {
176176
_timer.cancel();
@@ -351,7 +351,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
351351
controller.addListener(() {
352352
if (mounted) setState(() {});
353353
if (controller.value.hasError) {
354-
showToast(context, 'Camera error ${controller.value.errorDescription}');
354+
showToast( 'Camera error ${controller.value.errorDescription}');
355355
}
356356
});
357357

@@ -374,42 +374,42 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
374374
videoController?.dispose();
375375
videoController = null;
376376
});
377-
if (filePath != null) showToast(context, '图片保存到$filePath');
377+
if (filePath != null) showToast( '图片保存到$filePath');
378378
}
379379
});
380380
}
381381

382382
void onVideoRecordButtonPressed() {
383383
startVideoRecording().then((String filePath) {
384384
if (mounted) setState(() {});
385-
if (filePath != null) showToast(context, '开始录制');
385+
if (filePath != null) showToast( '开始录制');
386386
});
387387
}
388388

389389
void onStopButtonPressed() {
390390
stopVideoRecording().then((_) {
391391
if (mounted) setState(() {});
392-
showToast(context, '视频记录到$videoPath');
392+
showToast( '视频记录到$videoPath');
393393
});
394394
}
395395

396396
void onPauseButtonPressed() {
397397
pauseVideoRecording().then((_) {
398398
if (mounted) setState(() {});
399-
showToast(context, '录制视频暂停');
399+
showToast( '录制视频暂停');
400400
});
401401
}
402402

403403
void onResumeButtonPressed() {
404404
resumeVideoRecording().then((_) {
405405
if (mounted) setState(() {});
406-
showToast(context, '录制视频恢复');
406+
showToast( '录制视频恢复');
407407
});
408408
}
409409

410410
Future<String> startVideoRecording() async {
411411
if (!controller.value.isInitialized) {
412-
showToast(context, '异常: 首先选择一个相机');
412+
showToast( '异常: 首先选择一个相机');
413413
return null;
414414
}
415415

@@ -499,7 +499,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
499499

500500
Future<String> takePicture() async {
501501
if (!controller.value.isInitialized) {
502-
showToast(context, '异常: 首先选择一个相机');
502+
showToast( '异常: 首先选择一个相机');
503503
return null;
504504
}
505505
final Directory extDir = await getApplicationDocumentsDirectory();
@@ -523,7 +523,7 @@ class _ShootPageState extends State<ShootPage> with WidgetsBindingObserver {
523523

524524
void _showCameraException(CameraException e) {
525525
logError(e.code, e.description);
526-
showToast(context, 'Error: ${e.code}\n${e.description}');
526+
showToast( 'Error: ${e.code}\n${e.description}');
527527
}
528528

529529
@override

‎lib/pages/contacts/contacts_details_page.dart‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class _ContactsDetailsPageState extends State<ContactsDetailsPage> {
6161
visible: !isSelf,
6262
child: new ButtonRow(
6363
text: '音视频通话',
64-
onPressed: () => showToast(context, '敬请期待'),
64+
onPressed: () => showToast( '敬请期待'),
6565
),
6666
),
6767
];

‎lib/pages/contacts/group_launch_page.dart‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,19 @@ class _GroupLaunchPageState extends State<GroupLaunchPage> {
133133
radius: 4.0,
134134
onTap: () {
135135
if (Platform.isIOS) {
136-
showToast(context, 'IOS暂不支持发起群聊');
136+
showToast( 'IOS暂不支持发起群聊');
137137
return;
138138
}
139139
createGroupChat(selectData, name: selectData.join(),
140140
callback: (callBack) {
141141
if (callBack.toString().contains('succ')) {
142-
showToast(context, '创建群组成功');
142+
showToast( '创建群组成功');
143143
if (Navigator.of(context).canPop()) {
144144
Navigator.of(context).pop();
145145
}
146146
}
147147
});
148-
showToast(context, '当前ID:${selectData.toString()}');
148+
showToast( '当前ID:${selectData.toString()}');
149149
},
150150
);
151151

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /