| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- import 'package:electronic_assistant/utils/expand.dart';
- import 'package:flutter/cupertino.dart';
- import 'package:flutter/material.dart';
- import 'package:flutter_screenutil/flutter_screenutil.dart';
- import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
- import 'package:get/get.dart';
- import '../resource/colors.gen.dart';
- import '../resource/string.gen.dart';
- typedef TalkDeleteBuilder = void Function();
- void talkDeleteDialog(String? talkId, String? talkTitle,
- {TalkDeleteBuilder? returnBuilder}) {
- SmartDialog.show(
- builder: (_) {
- return Container(
- padding: EdgeInsets.all(16.w),
- width: 280.w,
- decoration: BoxDecoration(
- color: Colors.white,
- borderRadius: BorderRadius.circular(12),
- ),
- child: IntrinsicHeight(
- child: Column(
- children: [
- SizedBox(height: 24.h),
- Text(
- StringName.talkRenameDeletePrompt.tr
- .replacePlaceholders([talkTitle]),
- style: TextStyle(
- fontSize: 15.sp,
- color: ColorName.primaryTextColor,
- fontWeight: FontWeight.bold),
- ),
- SizedBox(height: 35.h),
- Row(
- children: [
- Expanded(
- child: GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- },
- child: Container(
- padding: EdgeInsets.symmetric(vertical: 8.h),
- decoration: BoxDecoration(
- color: '#F0F0F0'.toColor(),
- borderRadius: BorderRadius.circular(8),
- ),
- child: Center(
- child: Text(
- StringName.cancel.tr,
- style: TextStyle(
- fontSize: 16.sp,
- color: ColorName.secondaryTextColor),
- ),
- ),
- ),
- )),
- SizedBox(width: 12.w),
- Expanded(
- child: GestureDetector(
- onTap: () {
- SmartDialog.dismiss();
- if (returnBuilder != null) {
- returnBuilder.call();
- }
- },
- child: Container(
- padding: EdgeInsets.symmetric(vertical: 8.h),
- decoration: BoxDecoration(
- color: ColorName.colorPrimary,
- borderRadius: BorderRadius.circular(8),
- ),
- child: Center(
- child: Text(
- StringName.sure.tr,
- style: TextStyle(
- fontSize: 16.sp, color: ColorName.white),
- ),
- ),
- ),
- )),
- ],
- ),
- SizedBox(height: 4.h),
- ],
- ),
- ),
- );
- },
- clickMaskDismiss: false);
- }
|