You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

202 lines
6.0 KiB

import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
class SpeakerBottomSheet extends StatelessWidget {
const SpeakerBottomSheet({super.key});
@override
Widget build(BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 12.w),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Container(
padding: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
'命名当前发言者',
style: TextStyle(
fontSize: 16.sp,
color: Colors.black87,
fontWeight: FontWeight.bold,
),
),
GestureDetector(
onTap: () => Get.back(),
child: Container(
width: 26.w,
height: 26.w,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(26.r),
),
child: Icon(
Icons.close,
size: 18.w,
color: Colors.grey[400],
),
),
)
],
),
),
Divider(
height: 1,
color: Colors.grey[300],
),
Container(
height: 46.w,
margin: EdgeInsets.symmetric(vertical: 15.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.r),
),
),
Container(
constraints: BoxConstraints(maxHeight: 1.sh - 390.w),
child: ListView.builder(
itemCount: 30,
shrinkWrap: true,
itemBuilder: (BuildContext context, int index) {
return Container(
padding: EdgeInsets.only(left: 10.w),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(
width: 1,
color: Colors.grey[300]!,
),
),
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
if (index == 0)
Text(
'最近使用过的名称',
style: TextStyle(
fontSize: 12.sp,
color: Colors.grey[600]!,
),
),
SizedBox(
height: 42.w,
child: Align(
alignment: Alignment.centerLeft,
child: Text(
'龙哥',
style: TextStyle(
fontSize: 14.sp,
color: Colors.black87,
),
),
),
),
],
),
);
},
),
),
_row('应用到当前段落', false),
_row('应用到这个发言者的所有段落', true, description: '总结将根据模版自动更新'),
Padding(
padding: EdgeInsets.only(top: 10.w, bottom: 20.w),
child: GestureDetector(
onTap: () {},
child: Container(
height: 48.w,
alignment: Alignment.center,
decoration: BoxDecoration(
color: Colors.black,
borderRadius: BorderRadius.circular(12.r),
),
child: Text(
'保存',
style: TextStyle(
fontSize: 16.sp,
color: Colors.white,
),
),
),
),
),
],
),
);
}
Widget _row(String name, bool isActive, {String? description}) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 10.w),
child: Row(
children: [
isActive ? _round() : _circle(),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
name,
style: TextStyle(
fontSize: 14.sp,
color: Colors.black87,
),
),
if (description != null)
Text(
description,
style: TextStyle(
fontSize: 10.sp,
color: Colors.grey[500]!,
),
),
],
),
),
],
),
);
}
Widget _circle() {
return Container(
width: 18.w,
height: 18.w,
margin: EdgeInsets.only(right: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18.r),
border: Border.all(
width: 1.5,
color: Colors.grey[300]!,
),
),
);
}
Widget _round() {
return Container(
width: 18.w,
height: 18.w,
padding: EdgeInsets.all(2.w),
margin: EdgeInsets.only(right: 6.w),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(18.r),
border: Border.all(
width: 1.5,
color: Colors.black87,
),
),
child: Container(
decoration: BoxDecoration(
color: Colors.black87,
borderRadius: BorderRadius.circular(18.r),
),
),
);
}
}