import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:huixiang/generated/l10n.dart'; import 'package:huixiang/view_widget/border_text.dart'; import 'package:huixiang/view_widget/round_button.dart'; class RequestPermission extends StatefulWidget { final src; final mainText; final subText; final leftText; final rightText; final Function(bool) open; RequestPermission(this.src,this.mainText,this.subText,this.rightText, this.open, {this.leftText,}); @override State createState() { return _RequestPermission(); } } class _RequestPermission extends State { @override Widget build(BuildContext context) { return Material( type: MaterialType.transparency, child: Center( child: Container( width: 0.7867.sw, padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 24.w), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), ), child: AspectRatio( aspectRatio: 0.9, child: Column( children: [ Image.asset( widget.src, width: 0.7867.sw * 0.6, height: 0.7867.sw * 0.6 * 0.7, fit: BoxFit.fill, ), SizedBox( height: 20.w, ), Text( widget.mainText, style: TextStyle( fontSize: 14.sp, fontWeight: FontWeight.bold, color: Colors.black, ), ), SizedBox( height: 3.w, ), Text( widget.subText, style: TextStyle( fontSize: 12.sp, color: Color(0xFF727272), ), ), SizedBox( height: 20.w, ), Row( mainAxisSize: MainAxisSize.max, children: [ Expanded( child: InkWell( onTap: (){ widget.open(false); Navigator.of(context).pop("cancel"); }, child: BorderText( text: S.of(context).quxiao, textColor: Color(0xFF32A060), borderWidth: 1.w, borderColor: Color(0xFF32A060), padding: EdgeInsets.all(12.w), fontSize: 16.sp, fontWeight: FontWeight.bold, radius: 4, ), ), flex: 1, ), SizedBox( width: 13.w, ), Expanded( child: InkWell( onTap: (){ widget.open(true); Navigator.of(context).pop("open"); }, child: RoundButton( text: widget.rightText, textColor: Colors.white, padding: EdgeInsets.all(12.w), fontSize: 16.sp, backgroup: Color(0xFF32A060), fontWeight: FontWeight.bold, radius: 4, ), ), flex: 1, ), ], ), ], ), ), ), ), ); } }