107 lines
3.7 KiB
Dart
107 lines
3.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter/services.dart';
|
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
|
|
|
import '../generated/l10n.dart';
|
|
|
|
class InfluentialPromptDialog extends StatefulWidget {
|
|
Function onTap;
|
|
String prompt;
|
|
|
|
InfluentialPromptDialog({required this.prompt, required this.onTap});
|
|
|
|
@override
|
|
State<InfluentialPromptDialog> createState() => _InfluentialPromptDialogState();
|
|
}
|
|
|
|
class _InfluentialPromptDialogState extends State<InfluentialPromptDialog> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final size = MediaQuery.of(context).size;
|
|
|
|
|
|
|
|
return Material(
|
|
type: MaterialType.transparency, //透明类型
|
|
color: const Color(0x00000000),
|
|
child: Container(
|
|
width: size.width,
|
|
color: const Color(0x70000000),
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
Container(
|
|
alignment: Alignment.centerLeft,
|
|
margin: const EdgeInsets.only(top: 20, left: 14),
|
|
child: Text(
|
|
S.of(context).Painting_parameters,
|
|
style: const TextStyle(color: Color(0xFFC4C4C4)),
|
|
),
|
|
),
|
|
Container(
|
|
alignment: Alignment.centerLeft,
|
|
margin: const EdgeInsets.only(left: 15, right: 15, top: 13),
|
|
child: Text(
|
|
widget.prompt,
|
|
style: const TextStyle(color: Colors.white),
|
|
),
|
|
),
|
|
Container(height: 22),
|
|
Row(
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
children: [
|
|
///复制提示词
|
|
GestureDetector(
|
|
onTap: () {
|
|
EasyLoading.showToast(S.of(context).Already_copied);
|
|
Clipboard.setData(ClipboardData(text: widget.prompt));
|
|
},
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
margin: const EdgeInsets.only(left: 16),
|
|
width: 154.67,
|
|
height: 32,
|
|
decoration: const BoxDecoration(
|
|
color: Colors.white,
|
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
|
),
|
|
child: Text(
|
|
S.of(context).copy_prompt_word,
|
|
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w600),
|
|
),
|
|
),
|
|
),
|
|
|
|
///画同款
|
|
GestureDetector(
|
|
onTap: () {
|
|
widget.onTap();
|
|
},
|
|
child: Container(
|
|
alignment: Alignment.center,
|
|
margin: const EdgeInsets.only(right: 16),
|
|
width: 154.67,
|
|
height: 32,
|
|
decoration: const BoxDecoration(
|
|
gradient: LinearGradient(
|
|
begin: Alignment.centerLeft, //渐变开始于上面的中间开始
|
|
end: Alignment.centerRight, //渐变结束于下面的中间
|
|
colors: [Color(0xFF808EEF), Color(0xFFBE6FDF)]),
|
|
borderRadius: BorderRadius.all(Radius.circular(16)),
|
|
),
|
|
child: Text(
|
|
S.of(context).Draw_the_same,
|
|
style: const TextStyle(fontSize: 13, fontWeight: FontWeight.w600, color: Colors.white),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
Container(height: 22),
|
|
],
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|