Files
tongxunruanjian/mobile-next/openim_live/lib/src/widgets/live_button.dart
T
编码工程师andmultica-agent 8046ec7483 feat(mobile-next): 导入官方 openim-flutter-demo 固定基线 3.8.3-patch.3 并完成双构建
- 上游: github.com/OpenIMSDK/openim-flutter-demo tag 3.8.3-patch.3
  commit b3dfdb1e8aaeaaf6f0793e10cadd20d5c184a31f
- 并行目录 mobile-next/ 原样导入(含 LICENSE),不覆盖现网 mobile/
- 锁定 Flutter 3.24.5 / Dart 3.5.4 / JDK 17 / Gradle 7.6.3 / AGP 7.3.1
- 实测 Android debug 与 release 构建均成功(见 docs/mobile-next-baseline-import.md)
- 本提交可单独回退:git revert 1db1229(重写前)

Co-authored-by: multica-agent <github@multica.ai>
2026-08-19 15:24:33 +08:00

68 lines
1.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:openim_common/openim_common.dart';
class LiveButton extends StatelessWidget {
const LiveButton({
Key? key,
required this.text,
required this.icon,
this.onTap,
}) : super(key: key);
final String text;
final String icon;
final Function()? onTap;
@override
Widget build(BuildContext context) {
return Column(
children: [
icon.toImage
..width = 62.w
..height = 62.h
..onTap = onTap,
10.verticalSpace,
text.toText..style = Styles.ts_FFFFFF_opacity70_14sp,
],
);
}
LiveButton.microphone({
super.key,
this.onTap,
bool on = true,
}) : text = StrRes.microphone,
icon = on ? ImageRes.liveMicOn : ImageRes.liveMicOff;
LiveButton.speaker({
super.key,
this.onTap,
bool on = true,
}) : text = StrRes.speaker,
icon = on ? ImageRes.liveSpeakerOn : ImageRes.liveSpeakerOff;
LiveButton.hungUp({
super.key,
this.onTap,
}) : text = StrRes.hangUp,
icon = ImageRes.liveHangUp;
LiveButton.reject({
super.key,
this.onTap,
}) : text = StrRes.reject,
icon = ImageRes.liveHangUp;
LiveButton.cancel({
super.key,
this.onTap,
}) : text = StrRes.cancel,
icon = ImageRes.liveHangUp;
LiveButton.pickUp({
super.key,
this.onTap,
}) : text = StrRes.pickUp,
icon = ImageRes.livePicUp;
}