Open flutter-max opened 1 year ago
This is my code : Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( child: Receipt( backgroundColor: AppColors.white, onInitialized: (ctr) { controller = ctr; }, builder: (context) => Container( padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 48.h), child: Column( children: [ SizedBox( width: 250.w, child: QrImage( data: jsonEncode(qrJson), version: QrVersions.auto, backgroundColor: AppColors.white, ), ), SizedBox(height: 24.h), _buildText( isEnglish ? event.nameEn : event.nameAr, ), SizedBox(height: 12.h), _buildText(phoneNumber), SizedBox(height: 12.h), _buildText( DateFormatter.getDDMMYYYY2(eventDay, code: code)), SizedBox(height: 12.h), _buildText(isEnglish ? event.locationNameEn : event.locationNameAr), ], ), ), ), ), ], ),
the widget is printed in leftCenter of papper. how can align it in the center? , as the widget in the center of screen. thanks
try to set Center inside _buildText widget
This is my code : Column( mainAxisAlignment: MainAxisAlignment.center, children: [ Expanded( child: Receipt( backgroundColor: AppColors.white, onInitialized: (ctr) { controller = ctr; }, builder: (context) => Container( padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 48.h), child: Column( children: [ SizedBox( width: 250.w, child: QrImage( data: jsonEncode(qrJson), version: QrVersions.auto, backgroundColor: AppColors.white, ), ), SizedBox(height: 24.h), _buildText( isEnglish ? event.nameEn : event.nameAr, ), SizedBox(height: 12.h), _buildText(phoneNumber), SizedBox(height: 12.h), _buildText( DateFormatter.getDDMMYYYY2(eventDay, code: code)), SizedBox(height: 12.h), _buildText(isEnglish ? event.locationNameEn : event.locationNameAr), ], ), ), ), ), ], ),
the widget is printed in leftCenter of papper. how can align it in the center? , as the widget in the center of screen. thanks