84 lines
3.1 KiB
Dart
84 lines
3.1 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../common/models/meeting_room_user.dart';
|
|
import '../../../utils/color_util.dart';
|
|
import '../../../utils/cus_behavior.dart';
|
|
import 'meeting_main_voice_logic.dart';
|
|
import 'meeting_main_voice_state.dart';
|
|
|
|
class MeetingMainVoiceComponent extends StatelessWidget {
|
|
MeetingMainVoiceComponent({super.key, required this.users});
|
|
|
|
final List<MeetingRoomUser> users;
|
|
|
|
final MeetingMainVoiceLogic logic = Get.put(MeetingMainVoiceLogic());
|
|
final MeetingMainVoiceState state = Get.find<MeetingMainVoiceLogic>().state;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Container(
|
|
alignment: Alignment.center,
|
|
padding: const EdgeInsets.only(left: 22, right: 22),
|
|
color: ColorUtil.Color_57_57_57,
|
|
child: ScrollConfiguration(
|
|
behavior: CusBehavior(),
|
|
child: GridView.builder(
|
|
gridDelegate:
|
|
const SliverGridDelegateWithFixedCrossAxisCount(
|
|
crossAxisCount: 3,
|
|
childAspectRatio: 0.7,
|
|
crossAxisSpacing: 20),
|
|
itemCount: users.length,
|
|
itemBuilder: (BuildContext ctx, index) {
|
|
return Column(
|
|
children: [
|
|
SizedBox(height: 20.h),
|
|
Container(
|
|
decoration: BoxDecoration(
|
|
borderRadius: BorderRadius.circular(99),
|
|
color: ColorUtil.Color_85_117_242
|
|
),
|
|
width: 76.w,
|
|
height: 76.h,
|
|
alignment: Alignment.center,
|
|
child: Text(
|
|
users[index].userName.length > 3
|
|
? users[index].userName.substring(users[index].userName.length - 2,users[index].userName.length)
|
|
: users[index].userName,
|
|
style: TextStyle(
|
|
fontSize: 22.sp,
|
|
color: ColorUtil.Color_244_244_244
|
|
),
|
|
),
|
|
),
|
|
SizedBox(height: 6.h),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
children: [
|
|
Image.asset(
|
|
users[index].enableMicr == true ? 'assets/images/meeting_main_speak1.png' : 'assets/images/meeting_main_microphone_open.png',
|
|
width: 22.w,
|
|
height: 22.h,
|
|
),
|
|
Text(
|
|
users[index].userName,
|
|
style: TextStyle(
|
|
fontSize: 12.sp,
|
|
color: ColorUtil.Color_255_255_255),
|
|
)
|
|
],
|
|
),
|
|
],
|
|
);
|
|
})),
|
|
);
|
|
}
|
|
|
|
@override
|
|
void dispose() {
|
|
Get.delete<MeetingMainVoiceLogic>();
|
|
}
|
|
}
|