Skip to content

Commit 9289577

Browse files
committed
chore: Modify some comments.
1 parent 49d98f1 commit 9289577

File tree

10 files changed

+37
-40
lines changed

10 files changed

+37
-40
lines changed

lib/pages/chat/chat_logic.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ChatLogic extends SuperController {
3636
final focusNode = FocusNode();
3737
final scrollController = ScrollController();
3838
final refreshController = RefreshController();
39-
bool playOnce = false; // 点击的当前视频只能播放一次
39+
bool playOnce = false;
4040

4141
final forceCloseToolbox = PublishSubject<bool>();
4242
final sendStatusSub = PublishSubject<MsgStreamEv<bool>>();
@@ -47,7 +47,7 @@ class ChatLogic extends SuperController {
4747
final faceUrl = ''.obs;
4848
Timer? _debounce;
4949
final messageList = <Message>[].obs;
50-
final tempMessages = <Message>[]; // 临时存放消息体,例如图片消息
50+
final tempMessages = <Message>[];
5151
final scaleFactor = Config.textScaleFactor.obs;
5252
final background = "".obs;
5353
final memberUpdateInfoMap = <String, GroupMembersInfo>{};

lib/pages/contacts/select_contacts/select_contacts_logic.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ enum SelAction {
2020
}
2121

2222
class SelectContactsLogic extends GetxController implements OrganizationMultiSelBridge {
23-
final checkedList = <String, dynamic>{}.obs; // 已经选中的
24-
final defaultCheckedIDList = <String>{}.obs; // 默认选中,且不能修改
25-
List<String>? excludeIDList; // 剔除某些数据
23+
final checkedList = <String, dynamic>{}.obs;
24+
final defaultCheckedIDList = <String>{}.obs;
25+
List<String>? excludeIDList;
2626
late SelAction action;
2727
late bool openSelectedSheet;
2828
String? groupID;

lib/utils/upgrade_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mixin UpgradeManger {
5252
}).then((value) {
5353
upgradeInfoV2 = value;
5454
if (!canUpdate) {
55-
IMViews.showToast('已是最新版本');
55+
IMViews.showToast('Current version is latest');
5656
return;
5757
}
5858
Get.dialog(

openim_common/lib/src/extension/custom_ext.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class TextView extends StatelessWidget {
115115
onTap: onTap,
116116
behavior: HitTestBehavior.translucent,
117117
child: Text(
118-
wordEllipsis ? data : data.replaceAll('', '\u200B'), //解决Flutter按单词省略
118+
wordEllipsis ? data : data.replaceAll('', '\u200B'),
119119
style: style,
120120
textAlign: textAlign,
121121
overflow: overflow,

openim_common/lib/src/models/login_certificate.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import 'dart:convert';
22

33
class LoginCertificate {
44
String userID;
5-
String imToken; // im的
6-
String chatToken; // 业务服务器的
5+
String imToken;
6+
String chatToken;
77

88
LoginCertificate.fromJson(Map<String, dynamic> map)
99
: userID = map["userID"] ?? '',

openim_common/lib/src/res/styles.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
44
class Styles {
55
Styles._();
66

7-
static Color c_0089FF = const Color(0xFF0089FF); // 主题色
8-
static Color c_0C1C33 = const Color(0xFF0C1C33); // 黑色字体
9-
static Color c_8E9AB0 = const Color(0xFF8E9AB0); // 说明文字
10-
static Color c_E8EAEF = const Color(0xFFE8EAEF); // 分割线
11-
static Color c_FF381F = const Color(0xFFFF381F); // 警告色
12-
static Color c_FFFFFF = const Color(0xFFFFFFFF); // 警告色
13-
static Color c_18E875 = const Color(0xFF18E875); // 在线
14-
static Color c_F0F2F6 = const Color(0xFFF0F2F6); // 聊天页底部
7+
static Color c_0089FF = const Color(0xFF0089FF);
8+
static Color c_0C1C33 = const Color(0xFF0C1C33);
9+
static Color c_8E9AB0 = const Color(0xFF8E9AB0);
10+
static Color c_E8EAEF = const Color(0xFFE8EAEF);
11+
static Color c_FF381F = const Color(0xFFFF381F);
12+
static Color c_FFFFFF = const Color(0xFFFFFFFF);
13+
static Color c_18E875 = const Color(0xFF18E875);
14+
static Color c_F0F2F6 = const Color(0xFFF0F2F6);
1515
static Color c_000000 = const Color(0xFF000000); //
1616
static Color c_92B3E0 = const Color(0xFF92B3E0);
17-
static Color c_F2F8FF = const Color(0xFFF2F8FF); // 同步成功背景色
18-
static Color c_F8F9FA = const Color(0xFFF8F9FA); // 默认背景
17+
static Color c_F2F8FF = const Color(0xFFF2F8FF);
18+
static Color c_F8F9FA = const Color(0xFFF8F9FA);
1919
static Color c_6085B1 = const Color(0xFF6085B1);
20-
static Color c_FFB300 = const Color(0xFFFFB300); // 会议状态
21-
static Color c_FFE1DD = const Color(0xFFFFE1DD); // 同步失败背景色
20+
static Color c_FFB300 = const Color(0xFFFFB300);
21+
static Color c_FFE1DD = const Color(0xFFFFE1DD);
2222
static Color c_707070 = const Color(0xFF707070);
2323

24-
static Color c_92B3E0_opacity50 = c_92B3E0.withOpacity(.5); // 气泡背景
24+
static Color c_92B3E0_opacity50 = c_92B3E0.withOpacity(.5);
2525
static Color c_E8EAEF_opacity50 = c_E8EAEF.withOpacity(.5);
2626
static Color c_F4F5F7 = const Color(0xFFF4F5F7);
2727
static Color c_CCE7FE = const Color(0xFFCCE7FE);

openim_common/lib/src/widgets/chat/chat_notice_view.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import 'package:flutter/material.dart';
22
import 'package:flutter_screenutil/flutter_screenutil.dart';
33
import 'package:openim_common/openim_common.dart';
44

5-
/// 群公告
65
class ChatNoticeView extends StatelessWidget {
76
const ChatNoticeView({
87
Key? key,

openim_live/lib/src/live_controller.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import 'package:uuid/uuid.dart';
1313

1414
import '../openim_live.dart';
1515

16-
/// 信令
1716
mixin OpenIMLive {
1817
final signalingSubject = PublishSubject<CallEvent>();
1918

openim_live/lib/src/pages/single/widgets/call_state.dart

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ abstract class SignalState<T extends SignalView> extends State<T> {
9292
super.dispose();
9393
}
9494

95-
/// 过滤其他房间的信令
96-
Stream<CallEvent> get sameRoomSignalStream => widget.callEventSubject.stream.where((event) => LiveUtils.isSameRoom(event, roomID));
95+
Stream<CallEvent> get sameRoomSignalStream =>
96+
widget.callEventSubject.stream.where((event) => LiveUtils.isSameRoom(event, roomID));
9797

9898
_onUpdateUserInfo(UserInfo? info) {
9999
if (!mounted && null != info) return;
@@ -102,12 +102,10 @@ abstract class SignalState<T extends SignalView> extends State<T> {
102102
});
103103
}
104104

105-
/// 某些信令通过liveKit的监听
106105
_onStateDidUpdate(CallEvent event) {
107-
Logger.print("CallEvent : 当前:$callState 收到:$event");
106+
Logger.print("CallEvent current:$callState event:$event");
108107
if (!mounted) return;
109108

110-
// ui 状态只有 呼叫,被呼叫,通话中,连接中
111109
if (event.state == CallState.call ||
112110
event.state == CallState.beCalled ||
113111
event.state == CallState.connecting ||
@@ -122,11 +120,11 @@ abstract class SignalState<T extends SignalView> extends State<T> {
122120
return;
123121
}
124122
widget.onClose?.call();
125-
IMViews.showToast(sprintf(StrRes.otherCallHandle, [event.state == CallState.otherReject ? StrRes.rejectCall : StrRes.accept]));
123+
IMViews.showToast(
124+
sprintf(StrRes.otherCallHandle, [event.state == CallState.otherReject ? StrRes.rejectCall : StrRes.accept]));
126125
} else if (event.state == CallState.timeout) {
127126
widget.onClose?.call();
128127
} else if (event.state == CallState.beAccepted) {
129-
// 邀请对象比发起对象提前进入房间
130128
if (null != remoteParticipantTrack) {
131129
onParticipantConnected();
132130
}
@@ -142,7 +140,6 @@ abstract class SignalState<T extends SignalView> extends State<T> {
142140
onTapHangup(false);
143141
}
144142

145-
/// 发起者在对方为进入房间都是 等待状态
146143
onDail() async {
147144
if (widget.initState == CallState.call) {
148145
// callStateSubject.add(CallState.connecting);
@@ -159,19 +156,20 @@ abstract class SignalState<T extends SignalView> extends State<T> {
159156
}
160157

161158
onTapPickup() async {
162-
Logger.print('------------onTapPickup---------连接中--------');
159+
Logger.print('connecting');
163160
callStateSubject.add(CallState.connecting);
164161
certificate = await widget.onTapPickup!.call();
165162
widget.onBindRoomID?.call(roomID = certificate.roomID!);
166163
await connect();
167164
callStateSubject.add(CallState.calling);
168165
widget.onStartCalling?.call();
169-
Logger.print('------------onTapPickup---------连接成功--------');
166+
Logger.print('connected');
170167
}
171168

172-
/// [isPositive] 人为挂断行为
173169
onTapHangup(bool isPositive) async {
174-
await widget.onTapHangup?.call(duration, isPositive).whenComplete(() => /*isPositive ? {} : */ widget.onClose?.call());
170+
await widget.onTapHangup
171+
?.call(duration, isPositive)
172+
.whenComplete(() => /*isPositive ? {} : */ widget.onClose?.call());
175173
}
176174

177175
onTapCancel() async {
@@ -254,7 +252,8 @@ abstract class SignalState<T extends SignalView> extends State<T> {
254252
child: SizedBox(
255253
width: 120.w,
256254
height: 180.h,
257-
child: ParticipantWidget.widgetFor(smallScreenIsRemote ? localParticipantTrack! : remoteParticipantTrack!),
255+
child: ParticipantWidget.widgetFor(
256+
smallScreenIsRemote ? localParticipantTrack! : remoteParticipantTrack!),
258257
),
259258
onTap: () {
260259
if (remoteParticipantTrack != null) {

openim_live/lib/src/pages/single/widgets/controls.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import 'package:openim_live/src/widgets/live_button.dart';
2222
import 'package:synchronized/synchronized.dart';
2323

2424
import '../../../live_client.dart';
25+
2526
class ControlsView extends StatefulWidget {
2627
const ControlsView({
2728
Key? key,
@@ -79,10 +80,8 @@ class _ControlsViewState extends State<ControlsView> {
7980
Room? _room;
8081
LocalParticipant? _participant;
8182

82-
/// 默认启用麦克风
8383
bool _enabledMicrophone = true;
8484

85-
/// 默认开启扬声器
8685
bool _enabledSpeaker = true;
8786

8887
final _lockAudio = Lock();
@@ -305,7 +304,8 @@ class _ControlsViewState extends State<ControlsView> {
305304
LiveButton.cancel(onTap: widget.onCancel),
306305
LiveButton.speaker(on: _enabledSpeaker, onTap: _toggleSpeaker),
307306
];
308-
} else if (_callState == CallState.beCalled || _callState == CallState.connecting && widget.initState == CallState.beCalled) {
307+
} else if (_callState == CallState.beCalled ||
308+
_callState == CallState.connecting && widget.initState == CallState.beCalled) {
309309
return [
310310
LiveButton.reject(onTap: widget.onReject),
311311
LiveButton.pickUp(onTap: widget.onPickUp),

0 commit comments

Comments
 (0)