Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
geek2driod committed Apr 24, 2022
1 parent 4844cc4 commit eb4beb1
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 42 deletions.
10 changes: 4 additions & 6 deletions lib/screens/change_password/change_password.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ class _ChangePasswordPageState extends State<ChangePasswordPage> {
child: TextButton(
onPressed: () async {
if (oldPasswordController.text.isNotEmpty &&
newPasswordController.text.isNotEmpty) {
newPasswordController.text.isNotEmpty &&
oldPasswordController.text !=
newPasswordController.text) {
setState(() {
isLoading = true;
});
Expand All @@ -208,11 +210,6 @@ class _ChangePasswordPageState extends State<ChangePasswordPage> {
widget.userData.userId,
);
if (res != null) {
oldPasswordController.clear();
newPasswordController.clear();
setState(() {
isLoading = false;
});
ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(
content: Text(
Expand All @@ -229,6 +226,7 @@ class _ChangePasswordPageState extends State<ChangePasswordPage> {
backgroundColor:
CustomizedTheme.voucherPaid,
));
isLoading = false;
Navigator.pop(context);
} else {
setState(() {
Expand Down
44 changes: 22 additions & 22 deletions lib/screens/download_pdf/download_pdf.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ class PdfApi {
),
);

selectedLang == 0
? pdf.addPage(
// selectedLang == 0 ?
pdf.addPage(
MultiPage(
theme: myTheme,
build: (context) => [
Expand All @@ -64,27 +64,27 @@ class PdfApi {
),
],
),
)
: pdf.addPage(
MultiPage(
theme: myTheme,
build: (context) => [
buildArabicHeader(
data: vouchers,
font: myFont,
),
spacing(),
buildArabicBody(
data: vouchers,
font: myFont,
),
spacing(),
buildQrImage(
image: image,
),
],
),
);
// : pdf.addPage(
// MultiPage(
// theme: myTheme,
// build: (context) => [
// buildArabicHeader(
// data: vouchers,
// font: myFont,
// ),
// spacing(),
// buildArabicBody(
// data: vouchers,
// font: myFont,
// ),
// spacing(),
// buildQrImage(
// image: image,
// ),
// ],
// ),
// );

return PDFDocument.saveDocument(name: 'L${vouchers.id}', pdf: pdf);
}
Expand Down
10 changes: 7 additions & 3 deletions lib/screens/forget_password/mobile_number.dart
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ class _PhoneNumberPageState extends State<PhoneNumberPage> {
});
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(
"OTP sent!",
AppLocalizations.of(context)!.translate(
TranslationKeys.otpSent,
),
textAlign: TextAlign.center,
),
behavior: SnackBarBehavior.floating,
Expand All @@ -227,8 +229,10 @@ class _PhoneNumberPageState extends State<PhoneNumberPage> {
isLoading = false;
});
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: const Text(
"Invalid Phone Number!",
content: Text(
AppLocalizations.of(context)!.translate(
TranslationKeys.invalidMobileNumber,
),
textAlign: TextAlign.center,
),
behavior: SnackBarBehavior.floating,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:translator/translator.dart';

import 'country.dart';
import 'custom_halper.dart';
Expand Down Expand Up @@ -155,13 +154,4 @@ class _CustomCountryPickerDialogState extends State<CustomCountryPickerDialog> {
);
}

String _getText({required String input }){
String output = '';
final translator = GoogleTranslator();
translator.translate(input, from: 'en',to: 'ar').then((Translation translation){
output = translation.text;
});

return output;
}
}
1 change: 0 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ dependencies:
image_gallery_saver: '^1.7.1'
permission_handler: ^9.0.2
flutter_toggle_tab: ^1.1.7
restart_app: ^1.1.0

dev_dependencies:
flutter_test:
Expand Down

0 comments on commit eb4beb1

Please sign in to comment.