@ -67,385 +67,386 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
@ override
Widget build ( BuildContext context ) {
return Container (
decoration: BoxDecoration (
color: AppColors . scaffoldBgColor ,
borderRadius: BorderRadius . only (
topLeft: Radius . circular ( 24. r ) ,
topRight: Radius . circular ( 24. r ) ,
return FractionallySizedBox (
heightFactor: 0.75 ,
alignment: Alignment . bottomCenter ,
child: Container (
decoration: BoxDecoration (
color: AppColors . scaffoldBgColor ,
borderRadius: BorderRadius . only (
topLeft: Radius . circular ( 24. r ) ,
topRight: Radius . circular ( 24. r ) ,
) ,
) ,
) ,
child: SafeArea (
child: Column (
mainAxisSize: MainAxisSize . min ,
children: [
/ / Handle bar
Container (
margin: EdgeInsets . only ( top: 12. h , bottom: 8. h ) ,
width: 40. w ,
height: 4. h ,
decoration: BoxDecoration (
color: AppColors . greyInfoTextColor . withValues ( alpha: 0.3 ) ,
borderRadius: BorderRadius . circular ( 2. r ) ,
child: SafeArea (
child: Column (
mainAxisSize: MainAxisSize . max ,
children: [
/ / Handle bar
Container (
margin: EdgeInsets . only ( top: 12. h , bottom: 8. h ) ,
width: 40. w ,
height: 4. h ,
decoration: BoxDecoration (
color: AppColors . greyInfoTextColor . withValues ( alpha: 0.3 ) ,
borderRadius: BorderRadius . circular ( 2. r ) ,
) ,
) ,
) ,
/ / Title
Padding (
padding: EdgeInsets . symmetric ( horizontal: 24. w , vertical: 16. h ) ,
child: Row (
children: [
Expanded (
child: Text (
LocaleKeys . environmentConfig . tr ( context: context ) ,
style: TextStyle ( fontSize: 20. f , fontWeight: FontWeight . bold ) ,
/ / Title
Padding (
padding: EdgeInsets . symmetric ( horizontal: 24. w , vertical: 16. h ) ,
child: Row (
children: [
Expanded (
child: Text (
LocaleKeys . environmentConfig . tr ( context: context ) ,
style: TextStyle ( fontSize: 20. f , fontWeight: FontWeight . bold ) ,
) ,
) ,
) ,
IconButton (
icon: Icon ( Icons . close , color: AppColors . blackBgColor ) ,
onPressed: ( ) = > Navigator . pop ( context , false ) ,
) ,
] ,
IconButton (
icon: Icon ( Icons . close , color: AppColors . blackBgColor ) ,
onPressed: ( ) = > Navigator . pop ( context , false ) ,
) ,
] ,
) ,
) ,
) ,
Divider ( height: 1 , color: AppColors . greyInfoTextColor . withValues ( alpha: 0.2 ) ) ,
Divider ( height: 1 , color: AppColors . greyInfoTextColor . withValues ( alpha: 0.2 ) ) ,
if ( _isLoading )
Padding (
padding: EdgeInsets . all ( 40. h ) ,
child: const CircularProgressIndicator ( ) ,
)
else
SingleChildScrollView (
padding: EdgeInsets . all ( 24. w ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
/ / Current Environment Info
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . infoColor . withValues ( alpha: 0.1 ) ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . infoColor . withValues ( alpha: 0.3 ) ,
Expanded (
child: _isLoading
? Center (
child: Padding (
padding: EdgeInsets . all ( 40. h ) ,
child: const CircularProgressIndicator ( ) ,
) ,
) ,
child: Row (
children: [
Icon ( Icons . info_outline , color: AppColors . infoColor , size: 24. w ) ,
SizedBox ( width: 12. w ) ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
LocaleKeys . currentEnvironment . tr ( context: context ) ,
style: TextStyle ( fontSize: 14. f , fontWeight: FontWeight . bold , color: AppColors . infoColor ) ,
)
: SingleChildScrollView (
padding: EdgeInsets . all ( 24. w ) ,
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
/ / Current Environment Info
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . infoColor . withValues ( alpha: 0.1 ) ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . infoColor . withValues ( alpha: 0.3 ) ,
) ,
SizedBox ( height: 4. h ) ,
Text (
_isCustomMode
? ' Custom '
: ( _selectedPreset ? . label ? ? LocaleKeys . production . tr ( context: context ) ) ,
style: TextStyle ( fontSize: 12. f , color: AppColors . blackBgColor ) ,
) ,
child: Row (
children: [
Icon ( Icons . info_outline , color: AppColors . infoColor , size: 24. w ) ,
SizedBox ( width: 12. w ) ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text (
LocaleKeys . currentEnvironment . tr ( context: context ) ,
style: TextStyle ( fontSize: 14. f , fontWeight: FontWeight . bold , color: AppColors . infoColor ) ,
) ,
SizedBox ( height: 4. h ) ,
Text (
_isCustomMode ? ' Custom ' : ( _selectedPreset ? . label ? ? LocaleKeys . production . tr ( context: context ) ) ,
style: TextStyle ( fontSize: 12. f , color: AppColors . blackBgColor ) ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
SizedBox ( height: 24. h ) ,
Text ( LocaleKeys . selectEnvironment . tr ( context: context ) , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
/ / Environment Chips
Wrap (
spacing: 8. w ,
runSpacing: 8. h ,
children: [
/ / Preset environment chips
. . . kEnvironmentPresets . map ( ( preset ) {
final isSelected = ! _isCustomMode & & _selectedPreset ? . label = = preset . label ;
return InkWell (
onTap: ( ) {
setState ( ( ) {
_selectedPreset = preset ;
_isCustomMode = false ;
} ) ;
} ,
borderRadius: BorderRadius . circular ( 20. r ) ,
child: Container (
padding: EdgeInsets . symmetric ( horizontal: 16. w , vertical: 10. h ) ,
decoration: BoxDecoration (
color: isSelected ? AppColors . primaryRedColor : AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 20. r ) ,
border: Border . all (
color: isSelected ? AppColors . primaryRedColor : AppColors . greyInfoTextColor . withValues ( alpha: 0.3 ) ,
) ,
) ,
child: Row (
mainAxisSize: MainAxisSize . min ,
children: [
if ( isSelected )
Icon (
Icons . check_circle ,
size: 18. w ,
color: Colors . white ,
) ,
if ( isSelected ) SizedBox ( width: 6. w ) ,
Text (
preset . label ,
style: TextStyle (
fontSize: 14. f ,
color: isSelected ? Colors . white : AppColors . blackBgColor ,
fontWeight: isSelected ? FontWeight . bold : FontWeight . normal ,
) ,
) ,
] ,
) ,
) ,
) ;
} ) . toList ( ) ,
/ / Custom chip
InkWell (
onTap: ( ) {
setState ( ( ) {
_isCustomMode = true ;
_selectedPreset = null ;
} ) ;
} ,
borderRadius: BorderRadius . circular ( 20. r ) ,
child: Container (
padding: EdgeInsets . symmetric ( horizontal: 16. w , vertical: 10. h ) ,
decoration: BoxDecoration (
color: _isCustomMode ? AppColors . infoColor : AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 20. r ) ,
border: Border . all (
color: _isCustomMode ? AppColors . infoColor : AppColors . greyInfoTextColor . withValues ( alpha: 0.3 ) ,
) ,
) ,
child: Row (
mainAxisSize: MainAxisSize . min ,
children: [
if ( _isCustomMode )
Icon (
Icons . check_circle ,
size: 18. w ,
color: Colors . white ,
) ,
if ( _isCustomMode ) SizedBox ( width: 6. w ) ,
Icon (
Icons . edit_outlined ,
size: 16. w ,
color: _isCustomMode ? Colors . white : AppColors . blackBgColor ,
) ,
SizedBox ( width: 4. w ) ,
Text (
' Custom ' ,
style: TextStyle (
fontSize: 14. f ,
color: _isCustomMode ? Colors . white : AppColors . blackBgColor ,
fontWeight: _isCustomMode ? FontWeight . bold : FontWeight . normal ,
) ,
) ,
] ,
) ,
) ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
SizedBox ( height: 24. h ) ,
Text ( LocaleKeys . selectEnvironment . tr ( context: context ) , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
/ / Environment Chips
Wrap (
spacing: 8. w ,
runSpacing: 8. h ,
children: [
/ / Preset environment chips
. . . kEnvironmentPresets . map ( ( preset ) {
final isSelected = ! _isCustomMode & & _selectedPreset ? . label = = preset . label ;
return InkWell (
onTap: ( ) {
setState ( ( ) {
_selectedPreset = preset ;
_isCustomMode = false ;
} ) ;
} ,
borderRadius: BorderRadius . circular ( 20. r ) ,
child: Container (
padding: EdgeInsets . symmetric ( horizontal: 16. w , vertical: 10. h ) ,
SizedBox ( height: 24. h ) ,
/ / Custom URL Input Fields
if ( _isCustomMode ) . . . [
Text ( ' Custom URLs ' , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
/ / Base URL
TextField (
controller: _baseUrlController ,
decoration: InputDecoration (
labelText: ' Base URL ' ,
hintText: ' https://example.com/ ' ,
prefixIcon: Icon ( Icons . link , size: 20. w ) ,
border: OutlineInputBorder (
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
filled: true ,
fillColor: AppColors . whiteColor ,
) ,
style: TextStyle ( fontSize: 14. f ) ,
) ,
SizedBox ( height: 12. h ) ,
/ / RC Base URL
TextField (
controller: _rcBaseUrlController ,
decoration: InputDecoration (
labelText: ' RC Base URL ' ,
hintText: ' https://rc.example.com/ ' ,
prefixIcon: Icon ( Icons . link , size: 20. w ) ,
border: OutlineInputBorder (
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
filled: true ,
fillColor: AppColors . whiteColor ,
) ,
style: TextStyle ( fontSize: 14. f ) ,
) ,
SizedBox ( height: 12. h ) ,
/ / Payment URL
TextField (
controller: _paymentUrlController ,
decoration: InputDecoration (
labelText: ' Payment URL ' ,
hintText: ' https://example.com/payment/SendPayFortRequest.aspx ' ,
prefixIcon: Icon ( Icons . payment , size: 20. w ) ,
border: OutlineInputBorder (
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
filled: true ,
fillColor: AppColors . whiteColor ,
) ,
style: TextStyle ( fontSize: 14. f ) ,
) ,
SizedBox ( height: 24. h ) ,
] ,
/ / Environment Details
if ( _isCustomMode & & _baseUrlController . text . isNotEmpty ) . . . [
Text ( LocaleKeys . environmentDetails . tr ( context: context ) , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . greyInfoTextColor . withValues ( alpha: 0.2 ) ,
) ,
) ,
child: Column (
children: [
_buildDetailRow ( LocaleKeys . baseUrl . tr ( context: context ) , _baseUrlController . text ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . rcUrl . tr ( context: context ) , _rcBaseUrlController . text ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( ' Payment URL ' , _paymentUrlController . text ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . payfortMode . tr ( context: context ) , LocaleKeys . sandbox . tr ( context: context ) ) ,
] ,
) ,
) ,
] else if ( _selectedPreset ! = null ) . . . [
Text ( LocaleKeys . environmentDetails . tr ( context: context ) , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . greyInfoTextColor . withValues ( alpha: 0.2 ) ,
) ,
) ,
child: Column (
children: [
_buildDetailRow ( LocaleKeys . baseUrl . tr ( context: context ) , _selectedPreset ! . baseUrl ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . rcUrl . tr ( context: context ) , _selectedPreset ! . rcBaseUrl ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( ' Payment URL ' , _selectedPreset ! . serviceUrl ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . payfortMode . tr ( context: context ) ,
_selectedPreset ! . payFortEnvironment = = FortEnvironment . production ? LocaleKeys . production . tr ( context: context ) : LocaleKeys . sandbox . tr ( context: context ) ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . applePayMerchant . tr ( context: context ) , _selectedPreset ! . applePayMerchantId ) ,
] ,
) ,
) ,
] ,
SizedBox ( height: 24. h ) ,
/ / Warning
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: isSelected ? AppColors . primaryRedColor : AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 20. r ) ,
color: AppColors. warningColor . withValues ( alpha: 0.1 ) ,
borderRadius: BorderRadius . circular ( 1 2.r ) ,
border: Border . all (
color: isSelected ? AppColors . primaryRedColor : AppColors . greyInfoTextColor . withValues ( alpha: 0.3 ) ,
color: AppColors. warning Color. withValues ( alpha: 0.3 ) ,
) ,
) ,
child: Row (
mainAxisSize: MainAxisSize . min ,
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
if ( isSelected )
Icon (
Icons . check_circle ,
size: 18. w ,
color: Colors . white ,
) ,
if ( isSelected ) SizedBox ( width: 6. w ) ,
Text (
preset . label ,
style: TextStyle (
fontSize: 14. f ,
color: isSelected ? Colors . white : AppColors . blackBgColor ,
fontWeight: isSelected ? FontWeight . bold : FontWeight . normal ,
Icon ( Icons . warning_amber_rounded , color: AppColors . warningColor , size: 24. w ) ,
SizedBox ( width: 12. w ) ,
Expanded (
child: Column (
c rossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text ( LocaleKeys . important . tr ( context: context ) , style: TextStyle ( fontSize: 14. f , fontWeight: FontWeight . bold , color: AppColors . warningColor ) ) ,
SizedBox ( height: 4. h ) ,
Text (
LocaleKeys . envChangeWarning . tr ( context: context ) ,
style: TextStyle ( fontSize: 12. f , color: AppColors . blackBgColor ) ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
) ;
} ) . toList ( ) ,
/ / Custom chip
InkWell (
onTap: ( ) {
setState ( ( ) {
_isCustomMode = true ;
_selectedPreset = null ;
} ) ;
} ,
borderRadius: BorderRadius . circular ( 20. r ) ,
child: Container (
padding: EdgeInsets . symmetric ( horizontal: 16. w , vertical: 10. h ) ,
decoration: BoxDecoration (
color: _isCustomMode ? AppColors . infoColor : AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 20. r ) ,
border: Border . all (
color: _isCustomMode ? AppColors . infoColor : AppColors . greyInfoTextColor . withValues ( alpha: 0.3 ) ,
) ,
) ,
child: Row (
mainAxisSize: MainAxisSize . min ,
SizedBox ( height: 24. h ) ,
/ / Action Buttons
Row (
children: [
if ( _isCustomMode )
Icon (
Icons . check_circle ,
size: 18. w ,
color: Colors . white ,
Expanded (
child: CustomButton (
height: 50. h ,
text: LocaleKeys . resetToDefault . tr ( context: context ) ,
icon: AppAssets . cancel ,
iconColor: AppColors . errorColor ,
iconSize: 20. w ,
textColor: AppColors . errorColor ,
borderColor: AppColors . errorColor . withValues ( alpha: 0.3 ) ,
backgroundColor: AppColors . errorColor . withValues ( alpha: 0.1 ) ,
onPressed: ( ) = > _showResetConfirmation ( ) ,
) ,
if ( _isCustomMode ) SizedBox ( width: 6. w ) ,
Icon (
Icons . edit_outlined ,
size: 16. w ,
color: _isCustomMode ? Colors . white : AppColors . blackBgColor ,
) ,
SizedBox ( width: 4. w ) ,
Text (
' Custom ' ,
style: TextStyle (
fontSize: 14. f ,
color: _isCustomMode ? Colors . white : AppColors . blackBgColor ,
fontWeight: _isCustomMode ? FontWeight . bold : FontWeight . normal ,
SizedBox ( width: 12. w ) ,
Expanded (
child: CustomButton (
height: 50. h ,
text: LocaleKeys . saveAndRestart . tr ( context: context ) ,
icon: AppAssets . confirm ,
iconSize: 20. w ,
onPressed: ( _selectedPreset ! = null | | _isCustomMode ) ? _saveAndRestart : null ,
) ,
) ,
] ,
) ,
) ,
) ,
] ,
) ,
SizedBox ( height: 24. h ) ,
/ / Custom URL Input Fields
if ( _isCustomMode ) . . . [
Text ( ' Custom URLs ' , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
/ / Base URL
TextField (
controller: _baseUrlController ,
decoration: InputDecoration (
labelText: ' Base URL ' ,
hintText: ' https://example.com/ ' ,
prefixIcon: Icon ( Icons . link , size: 20. w ) ,
border: OutlineInputBorder (
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
filled: true ,
fillColor: AppColors . whiteColor ,
) ,
style: TextStyle ( fontSize: 14. f ) ,
) ,
SizedBox ( height: 12. h ) ,
/ / RC Base URL
TextField (
controller: _rcBaseUrlController ,
decoration: InputDecoration (
labelText: ' RC Base URL ' ,
hintText: ' https://rc.example.com/ ' ,
prefixIcon: Icon ( Icons . link , size: 20. w ) ,
border: OutlineInputBorder (
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
filled: true ,
fillColor: AppColors . whiteColor ,
) ,
style: TextStyle ( fontSize: 14. f ) ,
) ,
SizedBox ( height: 12. h ) ,
/ / Payment URL
TextField (
controller: _paymentUrlController ,
decoration: InputDecoration (
labelText: ' Payment URL ' ,
hintText: ' https://example.com/payment/SendPayFortRequest.aspx ' ,
prefixIcon: Icon ( Icons . payment , size: 20. w ) ,
border: OutlineInputBorder (
borderRadius: BorderRadius . circular ( 12. r ) ,
) ,
filled: true ,
fillColor: AppColors . whiteColor ,
) ,
style: TextStyle ( fontSize: 14. f ) ,
) ,
SizedBox ( height: 24. h ) ,
] ,
/ / Environment Details
if ( _isCustomMode & & _baseUrlController . text . isNotEmpty ) . . . [
Text ( LocaleKeys . environmentDetails . tr ( context: context ) , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . greyInfoTextColor . withValues ( alpha: 0.2 ) ,
) ,
) ,
child: Column (
children: [
_buildDetailRow ( LocaleKeys . baseUrl . tr ( context: context ) , _baseUrlController . text ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . rcUrl . tr ( context: context ) , _rcBaseUrlController . text ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( ' Payment URL ' , _paymentUrlController . text ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . payfortMode . tr ( context: context ) , LocaleKeys . sandbox . tr ( context: context ) ) ,
] ,
) ,
) ,
] else if ( _selectedPreset ! = null ) . . . [
Text ( LocaleKeys . environmentDetails . tr ( context: context ) , style: TextStyle ( fontSize: 16. f , fontWeight: FontWeight . bold ) ) ,
SizedBox ( height: 12. h ) ,
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . whiteColor ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . greyInfoTextColor . withValues ( alpha: 0.2 ) ,
) ,
) ,
child: Column (
children: [
_buildDetailRow ( LocaleKeys . baseUrl . tr ( context: context ) , _selectedPreset ! . baseUrl ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . rcUrl . tr ( context: context ) , _selectedPreset ! . rcBaseUrl ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( ' Payment URL ' , _selectedPreset ! . serviceUrl ) ,
Divider ( height: 20. h ) ,
_buildDetailRow (
LocaleKeys . payfortMode . tr ( context: context ) ,
_selectedPreset ! . payFortEnvironment = = FortEnvironment . production
? LocaleKeys . production . tr ( context: context )
: LocaleKeys . sandbox . tr ( context: context ) ) ,
Divider ( height: 20. h ) ,
_buildDetailRow ( LocaleKeys . applePayMerchant . tr ( context: context ) , _selectedPreset ! . applePayMerchantId ) ,
] ,
) ,
) ,
] ,
SizedBox ( height: 24. h ) ,
/ / Warning
Container (
padding: EdgeInsets . all ( 16. w ) ,
decoration: BoxDecoration (
color: AppColors . warningColor . withValues ( alpha: 0.1 ) ,
borderRadius: BorderRadius . circular ( 12. r ) ,
border: Border . all (
color: AppColors . warningColor . withValues ( alpha: 0.3 ) ,
) ,
) ,
child: Row (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Icon ( Icons . warning_amber_rounded , color: AppColors . warningColor , size: 24. w ) ,
SizedBox ( width: 12. w ) ,
Expanded (
child: Column (
crossAxisAlignment: CrossAxisAlignment . start ,
children: [
Text ( LocaleKeys . important . tr ( context: context ) ,
style: TextStyle ( fontSize: 14. f , fontWeight: FontWeight . bold , color: AppColors . warningColor ) ) ,
SizedBox ( height: 4. h ) ,
Text (
LocaleKeys . envChangeWarning . tr ( context: context ) ,
style: TextStyle ( fontSize: 12. f , color: AppColors . blackBgColor ) ,
) ,
] ,
) ,
) ,
] ,
) ,
) ,
SizedBox ( height: 24. h ) ,
/ / Action Buttons
Row (
children: [
Expanded (
child: CustomButton (
height: 50. h ,
text: LocaleKeys . resetToDefault . tr ( context: context ) ,
icon: AppAssets . cancel ,
iconColor: AppColors . errorColor ,
iconSize: 20. w ,
textColor: AppColors . errorColor ,
borderColor: AppColors . errorColor . withValues ( alpha: 0.3 ) ,
backgroundColor: AppColors . errorColor . withValues ( alpha: 0.1 ) ,
onPressed: ( ) = > _showResetConfirmation ( ) ,
) ,
) ,
SizedBox ( width: 12. w ) ,
Expanded (
child: CustomButton (
height: 50. h ,
text: LocaleKeys . saveAndRestart . tr ( context: context ) ,
icon: AppAssets . confirm ,
iconSize: 20. w ,
onPressed: ( _selectedPreset ! = null | | _isCustomMode ) ? _saveAndRestart : null ,
) ,
) ,
] ,
) ,
] ,
) ,
) ,
] ,
] ,
) ,
) ,
) ,
) ;
@ -490,9 +491,7 @@ class _EnvironmentConfigSheetState extends State<EnvironmentConfigSheet> {
try {
if ( _isCustomMode ) {
/ / Validate custom URLs
if ( _baseUrlController . text . trim ( ) . isEmpty | |
_rcBaseUrlController . text . trim ( ) . isEmpty | |
_paymentUrlController . text . trim ( ) . isEmpty ) {
if ( _baseUrlController . text . trim ( ) . isEmpty | | _rcBaseUrlController . text . trim ( ) . isEmpty | | _paymentUrlController . text . trim ( ) . isEmpty ) {
Utils . showToast ( ' Please enter all custom URLs ' ) ;
return ;
}