ekasetiawans / flutter_bluetooth_printer_plugin

MIT License
21 stars 36 forks source link

control the alignment of printed widget #25

Open flutter-max opened 11 months ago

flutter-max commented 11 months 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

nicosps commented 9 months ago

try to set Center inside _buildText widget