63 lines
1.6 KiB
Dart
63 lines
1.6 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:trans_lark/widget/t_divider_widget.dart';
|
|
|
|
class TPhotoPickerBottomSheet extends StatelessWidget {
|
|
const TPhotoPickerBottomSheet({super.key, required this.funCamera, required this.funGallery});
|
|
|
|
final Function() funCamera;
|
|
final Function() funGallery;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return SafeArea(
|
|
child: Container(
|
|
width: MediaQuery.of(context).size.width,
|
|
height: 120,
|
|
clipBehavior: Clip.antiAlias,
|
|
decoration: BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.circular(26),
|
|
),
|
|
child: Column(
|
|
children: [
|
|
Expanded(
|
|
child: _buildItem('Open camera', funCamera),
|
|
),
|
|
const TDividerWidget(),
|
|
Expanded(
|
|
child: _buildItem('Open gallery', funGallery),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
|
|
Widget _buildItem(String text, Function() function) {
|
|
return Material(
|
|
color: Colors.transparent,
|
|
child: InkWell(
|
|
onTap: () {
|
|
Get.back();
|
|
function();
|
|
},
|
|
child: SizedBox(
|
|
width: double.infinity,
|
|
child: Center(
|
|
child: Text(
|
|
text,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
style: const TextStyle(
|
|
color: Color(0xFF333333),
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.w600,
|
|
)
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
} |