fix:修复切换到俄语文本出现溢出的情况

This commit is contained in:
liyi 2025-03-20 17:54:14 +08:00
parent d3aee05534
commit 8b61e3d5a6
2 changed files with 21 additions and 11 deletions

View File

@ -109,8 +109,10 @@ class _AuthorizedAdministratorListPageState
64.h), 64.h),
Align( Align(
alignment: const Alignment(0.0, 0.2), alignment: const Alignment(0.0, 0.2),
child: SizedBox( child: Container(
width: 360.w, constraints: BoxConstraints(
maxWidth: 0.9.sw,
),
child: SubmitBtn( child: SubmitBtn(
btnName: '添加授权管理员'.tr, btnName: '添加授权管理员'.tr,
onClick: () { onClick: () {

View File

@ -1,4 +1,3 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -9,9 +8,9 @@ import '../app_settings/app_colors.dart';
* */ * */
class SubmitBtn extends StatelessWidget { class SubmitBtn extends StatelessWidget {
SubmitBtn({ SubmitBtn({
required this.btnName, Key? key, required this.btnName,
Key? key,
this.borderRadius, this.borderRadius,
this.color, this.color,
this.padding, this.padding,
@ -49,7 +48,9 @@ class SubmitBtn extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Container( return Container(
width: ScreenUtil().screenWidth - 40.w, width: ScreenUtil().screenWidth - 40.w,
height: 60.h, constraints: BoxConstraints(
minHeight: 60.h, //
),
child: ElevatedButton( child: ElevatedButton(
style: ElevatedButton.styleFrom( style: ElevatedButton.styleFrom(
backgroundColor: isDisabled == false backgroundColor: isDisabled == false
@ -63,7 +64,14 @@ class SubmitBtn extends StatelessWidget {
}, },
child: Text( child: Text(
btnName!, btnName!,
style: TextStyle(color: Colors.white, fontSize: 24.sp), textAlign: TextAlign.center, //
softWrap: true, //
overflow: TextOverflow.visible, //
style: TextStyle(
color: Colors.white,
fontSize: 24.sp,
height: 1.2, //
),
)), )),
); );
/* /*
@ -111,9 +119,9 @@ class SubmitBtn extends StatelessWidget {
* */ * */
class AddBottomWhiteBtn extends StatelessWidget { class AddBottomWhiteBtn extends StatelessWidget {
AddBottomWhiteBtn({ AddBottomWhiteBtn({
required this.btnName, Key? key, required this.btnName,
Key? key,
this.onClick, this.onClick,
}) : super(key: key); }) : super(key: key);
String? btnName; String? btnName;
@ -164,9 +172,9 @@ class AddBottomWhiteBtn extends StatelessWidget {
* */ * */
class OutLineBtn extends StatelessWidget { class OutLineBtn extends StatelessWidget {
OutLineBtn({ OutLineBtn({
required this.btnName, Key? key, required this.btnName,
Key? key,
this.onClick, this.onClick,
}) : super(key: key); }) : super(key: key);
String? btnName; String? btnName;