AI_Drawing/lib/dialog/free_upper_limit_dialog.dart
2024-06-03 15:30:15 +08:00

108 lines
4.3 KiB
Dart

import 'package:flutter/material.dart';
import '../generated/l10n.dart';
///免费保存上限
class FreeUpperLimitDialog extends StatefulWidget {
Function onTap;
FreeUpperLimitDialog({Key? key, required this.onTap}) : super(key: key);
@override
State<FreeUpperLimitDialog> createState() => _FreeUpperLimitDialogState();
}
class _FreeUpperLimitDialogState extends State<FreeUpperLimitDialog> {
@override
Widget build(BuildContext context) {
final size = MediaQuery.of(context).size;
final h20 = size.width / 18; //20
final b25 = size.width / 14.4; //25
final t30 = size.width / 12; //30
final t27 = size.width / 13.33333333; //27
final w132 = size.width / 2.7272727272; //132
final h37 = size.width / 9.7297297297; //37
return Material(
type: MaterialType.transparency, //透明类型
color: const Color(0x00000000),
child: Container(
alignment: Alignment.center,
child: Container(
margin: EdgeInsets.only(left: 15, right: 15),
padding: EdgeInsets.only(left: h20, right: h20, bottom: b25),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(13))),
child: Column(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.only(top: t30),
child: Text(
S.of(context).Save_picture,
style: TextStyle(fontSize: h20),
),
),
Container(
margin: EdgeInsets.only(top: h20),
child: Text(
S.of(context).Free_users,
style: TextStyle(fontSize: 14),
),
),
Container(
margin: EdgeInsets.only(top: 10),
child: Text(
S.of(context).More_pictures,
style: TextStyle(fontSize: 14),
),
),
Container(
margin: EdgeInsets.only(top: t27, bottom: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GestureDetector(
onTap: () {
Navigator.pop(context);
},
child: Container(
width: w132,
height: h37,
alignment: Alignment.center,
decoration: BoxDecoration(color: Color(0xFFEEE3FF), borderRadius: BorderRadius.all(Radius.circular(7))),
child: Text(
S.of(context).Cancel,
style: TextStyle(color: Color(0xFF8841FF)),
),
),
),
GestureDetector(
onTap: () {
Navigator.pop(context);
widget.onTap(1);
},
child: Container(
width: w132,
height: h37,
alignment: Alignment.center,
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.centerLeft, //渐变开始于上面的中间开始
end: Alignment.centerRight, //渐变结束于下面的中间
colors: [Color(0xFF808EEF), Color(0xFFBE6FDF)]),
borderRadius: BorderRadius.all(Radius.circular(7))),
child: Text(
S.of(context).to_pay,
style: TextStyle(color: Colors.white),
),
),
),
],
),
),
],
),
)));
}
}