Compare commits

..

No commits in common. "5ccb5adb79ed0a65eae4767fdac2baa1fa4efa31" and "1271c27b41b0a4db8d6e5e02dbc2712332750e1a" have entirely different histories.

5 changed files with 28 additions and 91 deletions

View File

@ -1,26 +0,0 @@
# 这是一个顶级配置文件,停止向父目录查找
root = true
# === 全局通用设置 (所有文件) ===
[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# === Dart 文件专用设置 ===
[*.dart]
# SDK 原始代码使用较长的行宽,设置为 120 以保持一致
max_line_length = 120
indent_size = 2
# === YAML/JSON 文件 (配置文件) ===
[*.{yaml,yml,json}]
indent_size = 2
# === Markdown 文件 (文档) ===
[*.md]
trim_trailing_whitespace = false
max_line_length = 0

View File

@ -62,12 +62,6 @@ class TUISearchViewModel extends ChangeNotifier {
}
void searchFriendByKey(String searchKey) async {
// API
if (searchKey.trim().isEmpty) {
friendList = [];
notifyListeners();
return;
}
final searchResult =
await _friendshipServices.searchFriends(searchParam: V2TimFriendSearchParam(keywordList: [searchKey]));
friendList = searchResult;
@ -75,12 +69,6 @@ class TUISearchViewModel extends ChangeNotifier {
}
void searchGroupByKey(String searchKey) async {
// API
if (searchKey.trim().isEmpty) {
groupList = [];
notifyListeners();
return;
}
final searchResult =
await _groupServices.searchGroups(searchParam: V2TimGroupSearchParam(keywordList: [searchKey]));
groupList = searchResult.data ?? [];
@ -123,14 +111,6 @@ class TUISearchViewModel extends ChangeNotifier {
}
void searchMsgByKey(String searchKey, bool isFirst) async {
// API
if (searchKey.trim().isEmpty) {
msgPage = 0;
msgList = [];
totalMsgCount = 0;
notifyListeners();
return;
}
if (isFirst == true) {
msgPage = 0;
msgList = [];

View File

@ -683,7 +683,7 @@ class _InputTextFieldState extends TIMUIKitState<TIMUIKitInputTextField> {
isAddingAtSearchWords = false;
}
} else if (textLength > 0 && text[textLength - 1] == "@" && lastText.length < textLength) {
List<V2TimGroupMemberFullInfo>? selectedAtMemberList = await Navigator.push(
List<V2TimGroupMemberFullInfo> selectedAtMemberList = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => AtText(
@ -695,7 +695,6 @@ class _InputTextFieldState extends TIMUIKitState<TIMUIKitInputTextField> {
),
);
if (selectedAtMemberList == null) return;
for (int i = 0; i < selectedAtMemberList.length; ++i) {
V2TimGroupMemberFullInfo memberInfo = selectedAtMemberList[i];
final showName = _getShowName(memberInfo);

View File

@ -23,6 +23,7 @@ class TUIKitColumnMenu extends StatefulWidget {
}
class TUIKitColumnMenuState extends TIMUIKitState<TUIKitColumnMenu> {
List<Widget> renderMenuItems(TUITheme theme) {
return widget.data
.map(
@ -38,8 +39,7 @@ class TUIKitColumnMenuState extends TIMUIKitState<TUIKitColumnMenu> {
mainAxisSize: MainAxisSize.min,
children: [
if (item.icon != null) item.icon!,
if (item.icon != null)
const SizedBox(
if (item.icon != null) const SizedBox(
height: 4,
width: 6,
),
@ -73,11 +73,18 @@ class TUIKitColumnMenuState extends TIMUIKitState<TUIKitColumnMenu> {
constraints: BoxConstraints(
maxWidth: min(MediaQuery.of(context).size.width * 0.7, 350),
),
child: Table(columnWidths: const <int, TableColumnWidth>{
child: Table(
columnWidths: const <int, TableColumnWidth>{
0: IntrinsicColumnWidth(),
}, children: <TableRow>[
...renderMenuItems(theme).map((e) => TableRow(children: <Widget>[e]))
]),
},
children: <TableRow>[
...renderMenuItems(theme).map((e) => TableRow(
children: <Widget>[
e
]
))
]
),
),
);
}

View File

@ -16,8 +16,7 @@ import 'package:video_player/video_player.dart';
import 'center_play_button.dart';
class VideoCustomControls extends StatefulWidget {
const VideoCustomControls({required this.downloadFn, Key? key})
: super(key: key);
const VideoCustomControls({required this.downloadFn, Key? key}) : super(key: key);
final Future<void> Function() downloadFn;
@override
@ -26,8 +25,7 @@ class VideoCustomControls extends StatefulWidget {
}
}
class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls>
with SingleTickerProviderStateMixin {
class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls> with SingleTickerProviderStateMixin {
late VideoPlayerValue _latestValue;
bool _hideStuff = true;
Timer? _hideTimer;
@ -76,18 +74,11 @@ class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls>
child: Stack(
alignment: Alignment.center,
children: <Widget>[
if (_latestValue.isBuffering)
const Center(
child: CircularProgressIndicator(color: Colors.white))
else
_buildHitArea(),
if (_latestValue.isBuffering) const Center(child: CircularProgressIndicator(color: Colors.white)) else _buildHitArea(),
Positioned(
bottom: 0,
width: MediaQuery.of(context).size.width,
child: Column(children: [
_buildVideoControlBar(context),
_buildBottomBar()
]),
child: Column(children: [_buildVideoControlBar(context), _buildBottomBar()]),
),
if (isLoading)
Container(
@ -207,14 +198,8 @@ class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls>
child: Row(
children: <Widget>[
_buildPlayPause(controller, iconColor),
if (chewieController.isLive)
const Expanded(child: Text('LIVE'))
else
_buildPositionStart(iconColor),
if (chewieController.isLive)
const SizedBox()
else
_buildProgressBar(),
if (chewieController.isLive) const Expanded(child: Text('LIVE')) else _buildPositionStart(iconColor),
if (chewieController.isLive) const SizedBox() else _buildProgressBar(),
if (!chewieController.isLive) _buildPositionEnd(iconColor),
],
),
@ -250,8 +235,7 @@ class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls>
));
}
GestureDetector _buildPlayPause(
VideoPlayerController controller, Color color) {
GestureDetector _buildPlayPause(VideoPlayerController controller, Color color) {
return GestureDetector(
onTap: _playPause,
child: Container(
@ -327,8 +311,7 @@ class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls>
_hideStuff = true;
chewieController.toggleFullScreen();
_showAfterExpandCollapseTimer =
Timer(const Duration(milliseconds: 300), () {
_showAfterExpandCollapseTimer = Timer(const Duration(milliseconds: 300), () {
setState(() {
_cancelAndRestartTimer();
});
@ -396,12 +379,7 @@ class _VideoCustomControlsState extends TIMUIKitState<VideoCustomControls>
_startHideTimer();
},
colors: chewieController.materialProgressColors ??
ChewieProgressColors(
playedColor: Colors.white,
handleColor: Colors.white,
bufferedColor: Colors.white38,
backgroundColor: Colors.white24),
colors: chewieController.materialProgressColors ?? ChewieProgressColors(playedColor: Colors.white, handleColor: Colors.white, bufferedColor: Colors.white38, backgroundColor: Colors.white24),
),
),
);
@ -424,8 +402,7 @@ class _PlaybackSpeedDialog extends TIMUIKitStatelessWidget {
Widget tuiBuild(BuildContext context, TUIKitBuildValue value) {
final TUITheme theme = value.theme;
final Color selectedColor =
theme.primaryColor ?? Theme.of(context).primaryColor;
final Color selectedColor = theme.primaryColor ?? Theme.of(context).primaryColor;
return ListView.builder(
shrinkWrap: true,