Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

control the alignment of printed widget #25

Open
flutter-max opened this issue Aug 9, 2023 · 1 comment
Open

control the alignment of printed widget #25

flutter-max opened this issue Aug 9, 2023 · 1 comment

Comments

@flutter-max
Copy link

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
Copy link

nicosps commented Sep 21, 2023

try to set Center inside _buildText widget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants