diff --git a/android/.gitignore b/android/.gitignore deleted file mode 100644 index 1fd9325..0000000 --- a/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -*.iml -.gradle -/local.properties -/.idea/workspace.xml -/.idea/libraries -.DS_Store -/build -/captures -GeneratedPluginRegistrant.java - -/gradle -/gradlew -/gradlew.bat diff --git a/android/.hgignore b/android/.hgignore new file mode 100644 index 0000000..62794a1 --- /dev/null +++ b/android/.hgignore @@ -0,0 +1,14 @@ +android.iml +app/app.iml +.gradle +local.properties +.idea/workspace.xml +.idea/libraries +.DS_Store +build +captures +GeneratedPluginRegistrant.java + +/gradle +gradlew +gradlew.bat diff --git a/android/app/src/autobonus/res/values-ru/strings.xml b/android/app/src/autobonus/res/values-ru/strings.xml deleted file mode 100644 index f4d6be5..0000000 --- a/android/app/src/autobonus/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AutoBonus - diff --git a/android/app/src/autobonus/res/values-ua/strings.xml b/android/app/src/autobonus/res/values-ua/strings.xml deleted file mode 100644 index f4d6be5..0000000 --- a/android/app/src/autobonus/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - AutoBonus - diff --git a/android/app/src/crypto/res/values-ru/strings.xml b/android/app/src/crypto/res/values-ru/strings.xml deleted file mode 100644 index ee90d67..0000000 --- a/android/app/src/crypto/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect Crypto - diff --git a/android/app/src/crypto/res/values-ua/strings.xml b/android/app/src/crypto/res/values-ua/strings.xml deleted file mode 100644 index ee90d67..0000000 --- a/android/app/src/crypto/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect Crypto - diff --git a/android/app/src/dinect_INT/res/values-ru/strings.xml b/android/app/src/dinect_INT/res/values-ru/strings.xml deleted file mode 100644 index 907af77..0000000 --- a/android/app/src/dinect_INT/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (INT) - diff --git a/android/app/src/dinect_INT/res/values-ua/strings.xml b/android/app/src/dinect_INT/res/values-ua/strings.xml deleted file mode 100644 index 907af77..0000000 --- a/android/app/src/dinect_INT/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (INT) - diff --git a/android/app/src/dinect_OTE/res/values-ru/strings.xml b/android/app/src/dinect_OTE/res/values-ru/strings.xml deleted file mode 100644 index 054dd0e..0000000 --- a/android/app/src/dinect_OTE/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (OTE) - diff --git a/android/app/src/dinect_OTE/res/values-ua/strings.xml b/android/app/src/dinect_OTE/res/values-ua/strings.xml deleted file mode 100644 index 054dd0e..0000000 --- a/android/app/src/dinect_OTE/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (OTE) - diff --git a/android/app/src/dinect_STAGING/res/values-ru/strings.xml b/android/app/src/dinect_STAGING/res/values-ru/strings.xml deleted file mode 100644 index 466ff48..0000000 --- a/android/app/src/dinect_STAGING/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (STAGING) - diff --git a/android/app/src/dinect_STAGING/res/values-ua/strings.xml b/android/app/src/dinect_STAGING/res/values-ua/strings.xml deleted file mode 100644 index 466ff48..0000000 --- a/android/app/src/dinect_STAGING/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (STAGING) - diff --git a/android/app/src/dinect_TESTING/res/values-ru/strings.xml b/android/app/src/dinect_TESTING/res/values-ru/strings.xml deleted file mode 100644 index 5a838f9..0000000 --- a/android/app/src/dinect_TESTING/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (TESTING) - diff --git a/android/app/src/dinect_TESTING/res/values-ua/strings.xml b/android/app/src/dinect_TESTING/res/values-ua/strings.xml deleted file mode 100644 index 5a838f9..0000000 --- a/android/app/src/dinect_TESTING/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - Dinect (TESTING) - diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f778661..b6654cc 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="5" + android:versionName="1.1.7"> + + + + + + + diff --git a/android/app/src/main/res/layout/f_logout_dialog.xml b/android/app/src/main/res/layout/f_logout_dialog.xml deleted file mode 100644 index e318ba1..0000000 --- a/android/app/src/main/res/layout/f_logout_dialog.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/android/app/src/main/res/layout/v_custom_toolbar.xml b/android/app/src/main/res/layout/v_custom_toolbar.xml index ce083dc..14ea12a 100644 --- a/android/app/src/main/res/layout/v_custom_toolbar.xml +++ b/android/app/src/main/res/layout/v_custom_toolbar.xml @@ -14,18 +14,16 @@ android:id="@+id/cardPhoneButton" android:layout_width="wrap_content" android:layout_marginRight="12dp" - android:layout_height="wrap_content" - /> + android:layout_height="wrap_content" /> + android:textColorHint="@android:color/white" /> diff --git a/android/app/src/main/res/menu/menu.xml b/android/app/src/main/res/menu/menu.xml index 6562c33..5d4235a 100644 --- a/android/app/src/main/res/menu/menu.xml +++ b/android/app/src/main/res/menu/menu.xml @@ -12,15 +12,15 @@ diff --git a/android/app/src/main/res/values-ru/strings.xml b/android/app/src/main/res/values-ru/strings.xml deleted file mode 100644 index 4f5a97b..0000000 --- a/android/app/src/main/res/values-ru/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - Dinect - Сканер карты - Сканировать - Справка - Закрыть приложение - Настройки - "Идентификатор %s не найден" - Введите номер карты - Телефон 79XXXXXXXXX - Можете воспользоваться ручным вводом или позвонить на номер:%s - diff --git a/android/app/src/main/res/values-ua/strings.xml b/android/app/src/main/res/values-ua/strings.xml deleted file mode 100644 index 805694c..0000000 --- a/android/app/src/main/res/values-ua/strings.xml +++ /dev/null @@ -1,12 +0,0 @@ - - Dinect - Сканер карти - Сканувати - Допомога - Закрыть приложение - Налаштування - "Ідентифікатор %s не знайден" - Введіть штрихкод вручну - Телефон 79XXXXXXXXX - Можете скористатися ручним введенням або зателефонувати на номер:\n%s - diff --git a/android/app/src/main/res/values/strings.xml b/android/app/src/main/res/values/strings.xml index 0b7e185..9aad28f 100644 --- a/android/app/src/main/res/values/strings.xml +++ b/android/app/src/main/res/values/strings.xml @@ -1,12 +1,3 @@ Dinect - Card Scanner - Scan - Help - Exit - Settings - "Identifier %s is not found" - Enter the card number - Phone 79XXXXXXXXX - You can use manual input or call the number:\n%s diff --git a/android/app/src/pip/res/values-ru/strings.xml b/android/app/src/pip/res/values-ru/strings.xml deleted file mode 100644 index 67af2f6..0000000 --- a/android/app/src/pip/res/values-ru/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - PIP - diff --git a/android/app/src/pip/res/values-ua/strings.xml b/android/app/src/pip/res/values-ua/strings.xml deleted file mode 100644 index 67af2f6..0000000 --- a/android/app/src/pip/res/values-ua/strings.xml +++ /dev/null @@ -1,3 +0,0 @@ - - PIP - diff --git a/assets/values-en/strings.xml b/assets/values-en/strings.xml new file mode 100644 index 0000000..8e2a6af --- /dev/null +++ b/assets/values-en/strings.xml @@ -0,0 +1,117 @@ + + Dinect + Card Scanner + Scan + Help + Exit + Settings + "Identifier %s is not found" + Enter the card number + Phone 79XXXXXXXXX + You can use manual input or call the number:\n%s + Store ID + Identifier %s is not found + The application is activated + Do you really want to log out and enter a different store number? + Buyer + Card + Card Scanner + Create a purchase + Complete registration + Complete the purchase + You confirm the purchase for %s %s + Сonfirmation + No + A purchase of %s %s was completed + Registration + Usage + Support contacts + General information + Activation request for the application has been sent, please wait for administrator approval + Reward + Bonus on account + Dicount Rate + Dicount Sum + Bonus points + Bonus was charged + Points to charge + Coupons were used + Select coupons for using in purchase + If not set, points will be added + Scan + Sign Up + Specify the store ID + Sum + Update activation status + Yes + Settings + Help + Exit + Log Out + Currency + Language + Ruble + Ruble + Rubles + US Dollar + US Dollar + US Dollars + Hryvnia + Hryvnia + Hryvnia + Tenge + Tenge + Tenge + Euro + Euro + Euro + User with card number %@ not found + User with phone number %@ not found + Error + Dismiss + +Store log in screen is the first thing you will see after starting the application. + +Enter the store number (ID). You can look it up in the loyalty program control panel. If you do not have access to the control panel, ask the administrator. + +Click the ""Login"" button. + +Please wait while the administrator activates your request. You can refresh your store activation status by pressing the "Update activation status" button. + +After the administrator activates your request, click the ""Complete activation"" button. The application is ready to use. + +If you want to log in as another store, click the Menu button (upper right corner of the screen) and select "Exit". + + + +Step 1: + +Launch this application and scan your customer's loyalty card using the built in scanner. + +If the scan is successful, the customer's information will appear on the screen. + +Step 2: + +Enter the purchase amount and click the ""Create a purchase"" button. + +In a pop-up window press ""YES"" to confirm the amount and allot the points to a customer. + +If you want to correct the amount, press ""NO"" and you will return back to the purchase screen where you can adjust the amount. + + + +Always recommend your customers to install your loyalty card app, so they can participate in your loyalty program. + +If you have any problems with the application, feel free to contact the support. + +Phone: +%s +Our website: +%s + + + +To improve barcode scanning quality, adjust the distance between the camera and the barcode so that the border around the barcode (if any) is not visible. Otherwise the vertical lines of the border could be wrongly considered as part of the code. + + + diff --git a/assets/values-es/strings.xml b/assets/values-es/strings.xml new file mode 100644 index 0000000..0b4900f --- /dev/null +++ b/assets/values-es/strings.xml @@ -0,0 +1,109 @@ + + ID del negocio + ID %s no está encontrado + Aplicación está activada + Os realmente quiereis acabarse una sesión y dar otro DIN del negocio + El comprador + Tarjeta + El escaneo de tarjeta + Realizar la compra + Terminar el registro + Terminar la compra + Confirmais la compra por %s %s + Confirmacón + No + La compra por %s %s está realizada + El registro + Explotación + Los contactos del soporte técnico + El requieremento de activación de aplicación esta mandado, esperad la activación por el administrador + Gratificación + Bono por cuenta + Tasa de descuento + El monto del descuento + Puntos de bonificación + El bono fue cobrado + Cuántas puntuaciones se cancelan + Los cupones fueron canjeados + Si no especifica cuántos puntos cancelar, se agregarán puntos + Escanear + Registrarse + Hay que dar ID del negocio + Suma + Actualizar la condición de activación + Un nombre de usario + Si + Las configuraciones + La Ayuda + Salir + Log Out + La Moneda + La lengua + Rublo + Rublo + Rublos + Dólar Dolares + Dólar Dolares + Dólar Dolares + Hryvnia + Hryvnia + Hryvnia + Tenge + Tenge + Tenge + Euro + Euro + Euro + User with card number %@ not found + User with phone number %@ not found + Error + Dismiss + +Store log in screen is the first thing you will see after starting the application. + +Enter the store number (DIN). You can look it up in the loyalty program control panel. If you do +not have access to the control panel, ask the administrator. + +Click the ""Login"" button. + +Please wait while the administrator activates your request. You can refresh your store activation +status by pressing the ""Update activation status"" button. + +After the administrator activates your request, click the ""Complete activation"" button. The +application is ready to use. + +If you want to log in as another store, click the Menu button (upper right corner of the screen) +and select "Exit". + + +Step 1: + +Launch this application and scan your customer's loyalty card using the built in scanner. + +If the scan is successful, the customer's information will appear on the screen. + +Step 2: + +Enter the purchase amount and click the ""Create a purchase"" button. + +In a pop-up window press ""YES"" to confirm the amount and allot the points to a customer. + +If you want to correct the amount, press ""NO"" and you will return back to the purchase screen +where you can adjust the amount. + + +Always recommend your customers to install your loyalty card app, so they can participate in your +loyalty program. + +If you have any problems with the application, feel free to contact the support. + +Phone: +%s +Our website: +%s + + +To improve barcode scanning quality, adjust the distance between the camera and the barcode so +that the border around the barcode (if any) is not visible. Otherwise the vertical lines of the +border could be wrongly considered as part of the code. + diff --git a/assets/values-ru/strings.xml b/assets/values-ru/strings.xml new file mode 100644 index 0000000..39182dc --- /dev/null +++ b/assets/values-ru/strings.xml @@ -0,0 +1,115 @@ + + Dinect + Сканер карты + Сканировать + Справка + Закрыть приложение + Настройки + "Идентификатор %s не найден" + Введите номер карты + Телефон 79XXXXXXXXX + Можете воспользоваться ручным вводом или позвонить на номер:%s + ID магазина + Идентификатор %s не найден + Приложение активировано + Вы действительно хотите выйти и ввести другой номер магазина? + Покупатель + Карта + Сканер карты + Проведение покупки + Завершить регистрацию + Завершить покупку + Вы подтверждаете покупку на %s %s + Подтверждение + Нет + Покупка на сумму %s %s проведена + Регистрация + Использование + Контакты поддержки + Общая информация + Запрос на активацию приложения отправлен, дождитесь подтверждения активации администратором + Вознаграждение + Бонусов на счету + Процент скидки + Сумма скидки + Бонусов начислено + Бонусов списано + Сколько баллов списать? + Были погашены купоны + Выберите купоны для гашения + Если не указано сколько баллов списать, баллы будут начислены + Сканировать + Зарегистрироваться + Необходимо указать ID магазина + Сумма + Обновить статус активации + Да + Настройки + Справка + Закрыть приложение + Отозвать токен + Валюта + Язык + Рубль + Рубля + Рублей + Доллар США + Доллара США + Долларов США + Гривна + Гривны + Гривен + Тенге + Тенге + Тенге + Евро + Евро + Евро + Пользователь с номером карты %@ не найден + Пользователь с номером телефона %@ не найден + Ошибка + Скрыть + +После запуска приложения вы окажетесь на странице регистрации магазина. + +Введите ID код магазина (выдается при подключении к системе лояльности) + +Кликните по кнопке: «Зарегистрировать» +Дождитесь подтверждение активации программы, нажатием по кнопке «Обновите статус активации» обновите статус. + +После подтверждения запроса на активацию программы Партнером/менеджером кликните по кнопке «Завершить регистрацию», приложение готово к использованию. + +При желании изменить ID магазина, необходимо нажать на кнопку Меню (верхний правый угол экрана) и выбрать "Выход". + + + +Шаг 1: + +Запустите приложение для сканирования карты участника системы лояльности. + +При успешном сканировании на вашем экране появятся данные покупателя. + +Шаг 2: + +Введите сумму покупки данного покупателя и нажмите на кнопку «Проведение покупки». + +Во всплывающем окне нажмите ""ДА"", для подтверждения суммы покупки + +Если вы хотите поправить сумму, нажмите «НЕТ» и Вы вернетесь на экран покупки и сможете её скорректировать. + + + +Рекомендуйте покупателям установить мобильное приложение дисконтной системы и получайте новых лояльных покупателей. + +При некорректной работе приложения просьба сразу обратиться по телефону нашей технической поддержки. + +Телефон: +%s +Наш сайт: +%s + + + +Для эффективного считывания штрих-кода карты участника системы лояльности необходимо камеру сканера поднести так, чтобы в неё не попадали вертикальные полосы рамки (если они есть). Они расцениваются сканером как часть штрих-кода. + + diff --git a/assets/values-ua/strings.xml b/assets/values-ua/strings.xml new file mode 100644 index 0000000..b1509d0 --- /dev/null +++ b/assets/values-ua/strings.xml @@ -0,0 +1,113 @@ + + Dinect + Сканер карти + Сканувати + Допомога + Закрыть приложение + Налаштування + "Ідентифікатор %s не знайден + Введіть штрихкод вручну + Телефон 79XXXXXXXXX + Можете скористатися ручним введенням або зателефонувати на номер:\n%s + ID магазину + Ідентифікатор %s не знайден + Додаток активований + Ви дійсно хочете вийти і ввести інший номер магазину + Покупець + Карта + Сканер карти + Проведення покупки + Завершити реєстрацію + Завершити купівлю + Ви підтверджуєте покупку на %s %s + Підтвердження + Ні + Купівля на суму %s %s проведена + Реєстрація + Використання + Контакти підтримки + Загальна інформація + Запит на активацію додатку відправлений, дочекайтеся підтвердження активації адміністратором + Винагорода + Бонусів на рахунку + Відсоток знижки + Сума знижки + Бонусів нараховано + Бонусів списано + Скільки балів списати? + Були погашені купони + Якщо не вказано скільки балів списати, бали будуть нараховані + Сканувати + Зареєструватися + Необхідно вказати ID магазину + Сума + Оновити статус активації + Так + Налаштування + Допомога + Вихід + Log Out + Валюта + Мова + Рубль + Рубль + Рубль + Доллар США + Доллар США + Доллар США + Гривня + Гривня + Гривня + Тенге + Тенге + Тенге + Євро + Євро + Євро + User with card number %@ not found + User with phone number %@ not found + Error + Dismiss + +Після запуску програми ви опинитеся на сторінці реєстрації магазина. + +Введіть DIN код магазину (видається при підключенні до системи лояльності) + +Натисніть на кнопку «Зареєструвати» +Дочекайтеся підтвердження активації програми, натисканням на кнопку «Оновлення статус активації» поновіть статус. +     +Після підтвердження запиту на активацію програми Партнером / менеджером клікніть по кнопці «Завершити реєстрацію», додаток готове до використання. + +При бажанні змінити номер каси, необхідно натиснути на кнопку Меню (верхній правий кут екрану) і вибрати "Вихід". + + +Крок 1: +     +При пред'явленні покупцем картки учасника системи лояльності, запустіть цю програму. + +На екрані з'явиться сканер штрих кодів. Відскануте штрих-код карти сканером. + +При успішному скануванні на вашому екрані з'являться дані покупця. +     +Крок 2: +     +Необхідно ввести суму покупки даного покупця і клікнути на кнопку «Проведення покупки». + +Спливе вікно підтвердження правильності введення суми. У разі правильного введення суми, натисніть «ТАК», сума буде проведена і винагороду буде нараховано учаснику системи лояльності. + +Якщо сума введена з помилкою, натисніть «НІ» і Ви повернетеся на крок введення суми і зможете її скорегувати. + + +Рекомендуйте покупцям встановити мобільний додаток дисконтної системи і отримуйте нових лояльних покупців. + +При некоректній роботі програми прохання відразу звернутися за телефоном нашої технічної підтримки. + +Телефон: +%s +Наш сайт: +%s + + +Для ефективного зчитування штрих-коду карти учасника системи лояльності необхідно камеру сканера піднести так, щоб в неї не потрапляли вертикальні смуги рамки. Вони розцінюються сканером як частина штрих-коду. + + diff --git a/ios/.gitignore b/ios/.hgignore similarity index 50% rename from ios/.gitignore rename to ios/.hgignore index 38864ee..c631b1f 100644 --- a/ios/.gitignore +++ b/ios/.hgignore @@ -4,7 +4,6 @@ .svn/ .DS_Store -*.swp profile DerivedData/ @@ -12,30 +11,22 @@ build/ GeneratedPluginRegistrant.h GeneratedPluginRegistrant.m -*.pbxuser -*.mode1v3 -*.mode2v3 -*.perspectivev3 - !default.pbxuser !default.mode1v3 !default.mode2v3 !default.perspectivev3 -xcuserdata +Runner.xcodeproj/xcuserdata +Runner.xcworkspace/xcuserdata -*.moved-aside - -*.pyc -*sync/ Icon? .tags* -/Flutter/app.flx -/Flutter/app.zip -/Flutter/App.framework -/Flutter/Flutter.framework -/Flutter/Generated.xcconfig -/ServiceDefinitions.json +Flutter/app.flx +Flutter/app.zip +Flutter/App.framework +Flutter/Flutter.framework +Flutter/Generated.xcconfig +ServiceDefinitions.json Pods/ diff --git a/ios/Flutter/App.framework/App b/ios/Flutter/App.framework/App index e83845c..9ad365c 100755 Binary files a/ios/Flutter/App.framework/App and b/ios/Flutter/App.framework/App differ diff --git a/ios/Flutter/Flutter.framework/Flutter b/ios/Flutter/Flutter.framework/Flutter index e334c5c..f602ec9 100755 Binary files a/ios/Flutter/Flutter.framework/Flutter and b/ios/Flutter/Flutter.framework/Flutter differ diff --git a/ios/Flutter/Flutter.framework/Headers/Flutter.h b/ios/Flutter/Flutter.framework/Headers/Flutter.h index 87604cf..5ce388d 100644 --- a/ios/Flutter/Flutter.framework/Headers/Flutter.h +++ b/ios/Flutter/Flutter.framework/Headers/Flutter.h @@ -8,6 +8,26 @@ /** BREAKING CHANGES: + January 15, 2018: Marked "initWithFLXArchive" and + "initWithFLXArchiveWithScriptSnapshot" as unavailable following the + deprecation from December 11, 2017. Scheduled to be removed on February + 19, 2018. + + January 09, 2018: Deprecated "FlutterStandardBigInteger" and its use in + "FlutterStandardMessageCodec" and "FlutterStandardMethodCodec". Scheduled to + be marked as unavailable once the deprecation has been available on the + flutter/flutter alpha branch for four weeks. "FlutterStandardBigInteger" was + needed because the Dart 1.0 int type had no size limit. With Dart 2.0, the + int type is a fixed-size, 64-bit signed integer. If you need to communicate + larger integers, use NSString encoding instead. + + December 11, 2017: Deprecated "initWithFLXArchive" and + "initWithFLXArchiveWithScriptSnapshot" and scheculed the same to be marked as + unavailable on January 15, 2018. Instead, "initWithFlutterAssets" and + "initWithFlutterAssetsWithScriptSnapshot" should be used. The reason for this + change is that the FLX archive will be deprecated and replaced with a flutter + assets directory containing the same files as the FLX did. + November 29, 2017: Added a BREAKING CHANGES section. */ diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h b/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h index 0d191db..2d65967 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterCodecs.h @@ -91,7 +91,6 @@ FLUTTER_EXPORT - `nil` or `NSNull` - `NSNumber` (including their representation of Boolean values) - - `FlutterStandardBigInteger` - `NSString` - `FlutterStandardTypedData` - `NSArray` of supported values @@ -101,11 +100,17 @@ FLUTTER_EXPORT - `nil` or `NSNull`: null - `NSNumber`: `bool`, `int`, or `double`, depending on the contained value. - - `FlutterStandardBigInteger`: `int` - `NSString`: `String` - `FlutterStandardTypedData`: `Uint8List`, `Int32List`, `Int64List`, or `Float64List` - `NSArray`: `List` - `NSDictionary`: `Map` + + Support for `FlutterStandardBigInteger` has been deprecated on 2018-01-09 to be + made unavailable four weeks after this change is available on the Flutter alpha + branch. `FlutterStandardBigInteger` were needed because the Dart 1.0 `int` type + had no size limit. With Dart 2.0, the `int` type is a fixed-size, 64-bit signed + integer. If you need to communicate larger integers, use `NSString` encoding + instead. */ FLUTTER_EXPORT @interface FlutterStandardMessageCodec : NSObject @@ -253,6 +258,13 @@ FLUTTER_EXPORT and `FlutterStandardMethodCodec`. */ FLUTTER_EXPORT +FLUTTER_DEPRECATED( + "Deprecated on 2018-01-09 to be made unavailable four weeks after the " + "deprecation is available on the flutter/flutter alpha branch. " + "FlutterStandardBigInteger was needed because the Dart 1.0 int type had no " + "size limit. With Dart 2.0, the int type is a fixed-size, 64-bit signed " + "integer. If you need to communicate larger integers, use NSString encoding " + "instead.") @interface FlutterStandardBigInteger : NSObject /** Creates a `FlutterStandardBigInteger` from a hexadecimal representation. diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h b/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h index 79c7a7a..7752ab9 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterDartProject.h @@ -16,9 +16,22 @@ FLUTTER_EXPORT - (instancetype)initWithFLXArchive:(NSURL*)archiveURL dartMain:(NSURL*)dartMainURL - packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER; + packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER + FLUTTER_UNAVAILABLE( + "This initializer is no longer available. See the deprecation message from " + "December 11, 2017 in Flutter.h. Instead, use [initWithFlutterAssets]."); -- (instancetype)initWithFLXArchiveWithScriptSnapshot:(NSURL*)archiveURL NS_DESIGNATED_INITIALIZER; +- (instancetype)initWithFLXArchiveWithScriptSnapshot:(NSURL*)archiveURL NS_DESIGNATED_INITIALIZER + FLUTTER_UNAVAILABLE( + "This initializer is no longer available. See the deprecation message from " + "December 11, 2017 in Flutter.h. Instead, use [initWithFlutterAssetsWithScriptSnapshot]."); + +- (instancetype)initWithFlutterAssets:(NSURL*)flutterAssetsURL + dartMain:(NSURL*)dartMainURL + packages:(NSURL*)dartPackages NS_DESIGNATED_INITIALIZER; + +- (instancetype)initWithFlutterAssetsWithScriptSnapshot:(NSURL*)flutterAssetsURL + NS_DESIGNATED_INITIALIZER; - (instancetype)initFromDefaultSourceForConfiguration; diff --git a/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h b/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h index fece7fe..396d8d9 100644 --- a/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h +++ b/ios/Flutter/Flutter.framework/Headers/FlutterPlugin.h @@ -127,7 +127,8 @@ NS_ASSUME_NONNULL_BEGIN */ - (BOOL)application:(UIApplication*)application performActionForShortcutItem:(UIApplicationShortcutItem*)shortcutItem - completionHandler:(void (^)(BOOL succeeded))completionHandler; + completionHandler:(void (^)(BOOL succeeded))completionHandler + API_AVAILABLE(ios(9.0)); @end diff --git a/ios/Flutter/Generated.xcconfig b/ios/Flutter/Generated.xcconfig index 9bd4244..1962428 100644 --- a/ios/Flutter/Generated.xcconfig +++ b/ios/Flutter/Generated.xcconfig @@ -1,9 +1,9 @@ // This is a generated file; do not edit or check into version control. -FLUTTER_ROOT=/Users/dinect/projects/flutter -FLUTTER_APPLICATION_PATH=/Users/dinect/projects/checker +FLUTTER_ROOT=/Users/kifio/flutter +FLUTTER_APPLICATION_PATH=/Users/kifio/Desktop/FlutterProjects/checker FLUTTER_TARGET=lib/main.dart -FLUTTER_BUILD_MODE=release +FLUTTER_BUILD_MODE=debug FLUTTER_BUILD_DIR=build SYMROOT=${SOURCE_ROOT}/../build/ios -FLUTTER_FRAMEWORK_DIR=/Users/dinect/projects/flutter/bin/cache/artifacts/engine/ios-release +FLUTTER_FRAMEWORK_DIR=/Users/kifio/flutter/bin/cache/artifacts/engine/ios #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" diff --git a/ios/Flutter/app.flx b/ios/Flutter/app.flx index 99718cc..715a55e 100644 Binary files a/ios/Flutter/app.flx and b/ios/Flutter/app.flx differ diff --git a/ios/Podfile b/ios/Podfile index 90b5f65..136a877 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,5 +1,6 @@ # Uncomment this line to define a global platform for your project # platform :ios, '9.0' +pod 'ZXingObjC', '~> 3.2.2' if ENV['FLUTTER_FRAMEWORK_DIR'] == nil abort('Please set FLUTTER_FRAMEWORK_DIR to the directory containing Flutter.framework') diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 23ae2c7..b17ac6e 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -10,30 +10,35 @@ PODS: - sqflite (0.0.1): - Flutter - FMDB + - ZXingObjC (3.2.2): + - ZXingObjC/All (= 3.2.2) + - ZXingObjC/All (3.2.2) DEPENDENCIES: - - Flutter (from `/Users/dinect/projects/flutter/bin/cache/artifacts/engine/ios-release`) - - image_picker (from `/Users/dinect/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios`) - - path_provider (from `/Users/dinect/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios`) - - sqflite (from `/Users/dinect/.pub-cache/hosted/pub.dartlang.org/sqflite-0.6.2/ios`) + - Flutter (from `/Users/kifio/flutter/bin/cache/artifacts/engine/ios`) + - image_picker (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios`) + - path_provider (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios`) + - sqflite (from `/Users/kifio/.pub-cache/hosted/pub.dartlang.org/sqflite-0.6.2+2/ios`) + - ZXingObjC (~> 3.2.2) EXTERNAL SOURCES: Flutter: - :path: /Users/dinect/projects/flutter/bin/cache/artifacts/engine/ios-release + :path: /Users/kifio/flutter/bin/cache/artifacts/engine/ios image_picker: - :path: /Users/dinect/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios + :path: /Users/kifio/.pub-cache/hosted/pub.dartlang.org/image_picker-0.1.5/ios path_provider: - :path: /Users/dinect/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios + :path: /Users/kifio/.pub-cache/hosted/pub.dartlang.org/path_provider-0.2.2/ios sqflite: - :path: /Users/dinect/.pub-cache/hosted/pub.dartlang.org/sqflite-0.6.2/ios + :path: /Users/kifio/.pub-cache/hosted/pub.dartlang.org/sqflite-0.6.2+2/ios SPEC CHECKSUMS: - Flutter: d674e78c937094a75ac71dd77e921e840bea3dbf + Flutter: 7eb41cd1fd524b90d7f22bceb20da2c39338b089 FMDB: 6198a90e7b6900cfc046e6bc0ef6ebb7be9236aa - image_picker: a211f28b95a560433c00f5cd3773f4710a20404d - path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259 - sqflite: 8e2d9fe1e7cdc95d4d537fc7eb2d23c8dc428e3c + image_picker: ee00aab0487cedc80a304085219503cc6d0f2e22 + path_provider: 09407919825bfe3c2deae39453b7a5b44f467873 + sqflite: edb0e4df7640c26fea6a107c21ed1542219e761a + ZXingObjC: 2c95a0dc52daac69b23ec78fad8fa2fec05f8981 -PODFILE CHECKSUM: 351e02e34b831289961ec3558a535cbd2c4965d2 +PODFILE CHECKSUM: 9f4cf0c4c102f6176b37e2c4c913e0544612cec5 -COCOAPODS: 1.4.0.beta.2 +COCOAPODS: 1.4.0 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 2644e61..65f28d2 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378251FAA1A9400D5DBA9 /* flutter_assets */; }; ACE8612B1F9F745B006FEF38 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; ACE8612C1F9F745B006FEF38 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; ACE8612D1F9F745B006FEF38 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; @@ -20,22 +21,15 @@ ACE861361F9F745B006FEF38 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BBA9BB311F1792570053B6EA /* AVFoundation.framework */; }; ACE861371F9F745B006FEF38 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; ACE861381F9F745B006FEF38 /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; - ACE861391F9F745B006FEF38 /* libzbar.a in Frameworks */ = {isa = PBXBuildFile; fileRef = ACE103AB1F8FCC6000D17794 /* libzbar.a */; }; ACE8613A1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 28B464359F9DDCC3EF756D7D /* libPods-Runner.a */; }; ACE8613B1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; }; - ACE8613C1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; }; ACE8613E1F9F745B006FEF38 /* app.flx in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB71CF902C7004384FC /* app.flx */; }; ACE8613F1F9F745B006FEF38 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; - ACE861401F9F745B006FEF38 /* Generated.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB31CF90195004384FC /* Generated.xcconfig */; }; ACE861411F9F745B006FEF38 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - ACE861421F9F745B006FEF38 /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; ACE861431F9F745B006FEF38 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; ACE861441F9F745B006FEF38 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; ACE861461F9F745B006FEF38 /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; ACE861471F9F745B006FEF38 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - AFFEFA1AD31BC8D9EA04CFCB /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; }; - BAE7FF4D875B996672385844 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AC45BF661F9E3F97009713E2 /* libPods-Runner.a */; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */ = {isa = PBXBuildFile; fileRef = 2D5378261FAA1A9400D5DBA9 /* flutter_assets */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -66,8 +60,8 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 2D5378261FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 28B464359F9DDCC3EF756D7D /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 2D5378251FAA1A9400D5DBA9 /* flutter_assets */ = {isa = PBXFileReference; lastKnownFileType = folder; name = flutter_assets; path = Flutter/flutter_assets; sourceTree = SOURCE_ROOT; }; 32DA147B1FBC3DCE008F0388 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; @@ -85,27 +79,6 @@ AC45BF661F9E3F97009713E2 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; AC45BF911F9E408E009713E2 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = /Users/ntrlab/semyon/apps/checker/ios/Runner/Info.plist; sourceTree = ""; }; AC73A4241F9F7F920026EBA4 /* Dinect.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Dinect.plist; path = /Users/ntrlab/semyon/apps/checker/ios/Runner/Dinect.plist; sourceTree = ""; }; - ACE103AB1F8FCC6000D17794 /* libzbar.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libzbar.a; path = ZBarSDK/libzbar.a; sourceTree = ""; }; - ACE103AD1F8FCC6F00D17794 /* zbar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zbar.h; path = ZBarSDK/Headers/zbar.h; sourceTree = ""; }; - ACE103AE1F8FCC6F00D17794 /* ZBarCaptureReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarCaptureReader.h; path = ZBarSDK/Headers/ZBarCaptureReader.h; sourceTree = ""; }; - ACE103AF1F8FCC6F00D17794 /* ZBarReaderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarReaderViewController.h; path = ZBarSDK/Headers/ZBarReaderViewController.h; sourceTree = ""; }; - ACE103B01F8FCC6F00D17794 /* ZBarImage.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarImage.h; path = ZBarSDK/Headers/ZBarImage.h; sourceTree = ""; }; - ACE103B11F8FCC7000D17794 /* ZBarCameraSimulator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarCameraSimulator.h; path = ZBarSDK/Headers/ZBarCameraSimulator.h; sourceTree = ""; }; - ACE103B21F8FCC7000D17794 /* ZBarReaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarReaderView.h; path = ZBarSDK/Headers/ZBarReaderView.h; sourceTree = ""; }; - ACE103B31F8FCC7000D17794 /* ZBarSDK.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarSDK.h; path = ZBarSDK/Headers/ZBarSDK.h; sourceTree = ""; }; - ACE103B41F8FCC7000D17794 /* ZBarHelpController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarHelpController.h; path = ZBarSDK/Headers/ZBarHelpController.h; sourceTree = ""; }; - ACE103B51F8FCC7000D17794 /* ZBarImageScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarImageScanner.h; path = ZBarSDK/Headers/ZBarImageScanner.h; sourceTree = ""; }; - ACE103B61F8FCC7100D17794 /* ZBarReaderController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarReaderController.h; path = ZBarSDK/Headers/ZBarReaderController.h; sourceTree = ""; }; - ACE103B71F8FCC7100D17794 /* ZBarSymbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ZBarSymbol.h; path = ZBarSDK/Headers/ZBarSymbol.h; sourceTree = ""; }; - ACE103BE1F8FCD1400D17794 /* Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Window.h; path = ZBarSDK/Headers/zbar/Window.h; sourceTree = ""; }; - ACE103BF1F8FCD1500D17794 /* Decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Decoder.h; path = ZBarSDK/Headers/zbar/Decoder.h; sourceTree = ""; }; - ACE103C01F8FCD1500D17794 /* Processor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Processor.h; path = ZBarSDK/Headers/zbar/Processor.h; sourceTree = ""; }; - ACE103C11F8FCD1500D17794 /* Exception.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Exception.h; path = ZBarSDK/Headers/zbar/Exception.h; sourceTree = ""; }; - ACE103C21F8FCD1500D17794 /* Symbol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Symbol.h; path = ZBarSDK/Headers/zbar/Symbol.h; sourceTree = ""; }; - ACE103C31F8FCD1500D17794 /* Image.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Image.h; path = ZBarSDK/Headers/zbar/Image.h; sourceTree = ""; }; - ACE103C41F8FCD1500D17794 /* Video.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Video.h; path = ZBarSDK/Headers/zbar/Video.h; sourceTree = ""; }; - ACE103C51F8FCD1500D17794 /* ImageScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ImageScanner.h; path = ZBarSDK/Headers/zbar/ImageScanner.h; sourceTree = ""; }; - ACE103C61F8FCD1500D17794 /* Scanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Scanner.h; path = ZBarSDK/Headers/zbar/Scanner.h; sourceTree = ""; }; ACE861531F9F745B006FEF38 /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; BBA9BAFD1F176DD10053B6EA /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; BBA9BAFE1F176DD10053B6EA /* ScannerViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ScannerViewController.swift; sourceTree = ""; }; @@ -132,12 +105,8 @@ ACE861361F9F745B006FEF38 /* AVFoundation.framework in Frameworks */, ACE861371F9F745B006FEF38 /* Flutter.framework in Frameworks */, ACE861381F9F745B006FEF38 /* App.framework in Frameworks */, - ACE861391F9F745B006FEF38 /* libzbar.a in Frameworks */, ACE8613A1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */, ACE8613B1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */, - ACE8613C1F9F745B006FEF38 /* libPods-Runner.a in Frameworks */, - BAE7FF4D875B996672385844 /* libPods-Runner.a in Frameworks */, - AFFEFA1AD31BC8D9EA04CFCB /* libPods-Runner.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -154,6 +123,7 @@ 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( + 2D5378251FAA1A9400D5DBA9 /* flutter_assets */, 9740EEB71CF902C7004384FC /* app.flx */, 3B80C3931E831B6300D905FE /* App.framework */, 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, @@ -161,7 +131,6 @@ 9740EEB21CF90195004384FC /* Debug.xcconfig */, 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 9740EEB31CF90195004384FC /* Generated.xcconfig */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets */, ); name = Flutter; sourceTree = ""; @@ -169,7 +138,6 @@ 97C146E51CF9000F007C117D = { isa = PBXGroup; children = ( - ACE103BB1F8FCCA500D17794 /* ZBarSDK */, 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, 97C146EF1CF9000F007C117D /* Products */, @@ -214,50 +182,6 @@ name = "Supporting Files"; sourceTree = ""; }; - ACE103BB1F8FCCA500D17794 /* ZBarSDK */ = { - isa = PBXGroup; - children = ( - ACE103AB1F8FCC6000D17794 /* libzbar.a */, - ACE103BC1F8FCCD000D17794 /* Headers */, - ); - name = ZBarSDK; - sourceTree = ""; - }; - ACE103BC1F8FCCD000D17794 /* Headers */ = { - isa = PBXGroup; - children = ( - ACE103BD1F8FCCF300D17794 /* zbar */, - ACE103AD1F8FCC6F00D17794 /* zbar.h */, - ACE103AE1F8FCC6F00D17794 /* ZBarCaptureReader.h */, - ACE103AF1F8FCC6F00D17794 /* ZBarReaderViewController.h */, - ACE103B31F8FCC7000D17794 /* ZBarSDK.h */, - ACE103B71F8FCC7100D17794 /* ZBarSymbol.h */, - ACE103B11F8FCC7000D17794 /* ZBarCameraSimulator.h */, - ACE103B41F8FCC7000D17794 /* ZBarHelpController.h */, - ACE103B01F8FCC6F00D17794 /* ZBarImage.h */, - ACE103B51F8FCC7000D17794 /* ZBarImageScanner.h */, - ACE103B61F8FCC7100D17794 /* ZBarReaderController.h */, - ACE103B21F8FCC7000D17794 /* ZBarReaderView.h */, - ); - name = Headers; - sourceTree = ""; - }; - ACE103BD1F8FCCF300D17794 /* zbar */ = { - isa = PBXGroup; - children = ( - ACE103BF1F8FCD1500D17794 /* Decoder.h */, - ACE103C11F8FCD1500D17794 /* Exception.h */, - ACE103C31F8FCD1500D17794 /* Image.h */, - ACE103C51F8FCD1500D17794 /* ImageScanner.h */, - ACE103C01F8FCD1500D17794 /* Processor.h */, - ACE103C61F8FCD1500D17794 /* Scanner.h */, - ACE103C21F8FCD1500D17794 /* Symbol.h */, - ACE103C41F8FCD1500D17794 /* Video.h */, - ACE103BE1F8FCD1400D17794 /* Window.h */, - ); - name = zbar; - sourceTree = ""; - }; BBA9BB001F1786510053B6EA /* Frameworks */ = { isa = PBXGroup; children = ( @@ -308,11 +232,11 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0900; - LastUpgradeCheck = 0830; + LastUpgradeCheck = 0920; ORGANIZATIONNAME = "The Chromium Authors"; TargetAttributes = { ACE861271F9F745B006FEF38 = { - DevelopmentTeam = 926V94K5Q8; + DevelopmentTeam = SU33AJBF5T; ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.Push = { @@ -345,14 +269,12 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, ACE8613E1F9F745B006FEF38 /* app.flx in Resources */, ACE8613F1F9F745B006FEF38 /* LaunchScreen.storyboard in Resources */, - ACE861401F9F745B006FEF38 /* Generated.xcconfig in Resources */, ACE861411F9F745B006FEF38 /* AppFrameworkInfo.plist in Resources */, - ACE861421F9F745B006FEF38 /* Debug.xcconfig in Resources */, ACE861431F9F745B006FEF38 /* Assets.xcassets in Resources */, ACE861441F9F745B006FEF38 /* Main.storyboard in Resources */, - 2D5378261FAA1A9400D5DBA9 /* flutter_assets in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -412,7 +334,7 @@ ); inputPaths = ( "${SRCROOT}/Pods/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh", - "${PODS_ROOT}/../../../flutter/bin/cache/artifacts/engine/ios-release/Flutter.framework", + "${PODS_ROOT}/../../../../../flutter/bin/cache/artifacts/engine/ios/Flutter.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( @@ -484,14 +406,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -532,14 +460,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -559,6 +493,7 @@ IPHONEOS_DEPLOYMENT_TARGET = 8.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; }; @@ -569,12 +504,6 @@ baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ARCHS = ( - "$(ARCHS_STANDARD)", - arm7s, - armv7, - arm64, - ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -582,7 +511,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 926V94K5Q8; + DEVELOPMENT_TEAM = SU33AJBF5T; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -593,7 +522,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", - "$(PROJECT_DIR)/ZBarSDK", ); ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = com.dinect.checker.autoclub.app; @@ -613,12 +541,6 @@ baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; - ARCHS = ( - "$(ARCHS_STANDARD)", - arm7s, - armv7, - arm64, - ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; @@ -626,7 +548,7 @@ "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = 926V94K5Q8; + DEVELOPMENT_TEAM = SU33AJBF5T; ENABLE_BITCODE = NO; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -637,7 +559,6 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "$(PROJECT_DIR)/Flutter", - "$(PROJECT_DIR)/ZBarSDK", ); PRODUCT_BUNDLE_IDENTIFIER = com.dinect.checker.autoclub.app; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/kifio.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/kifio.xcuserdatad/UserInterfaceState.xcuserstate index c6d86d5..133e97a 100644 Binary files a/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/kifio.xcuserdatad/UserInterfaceState.xcuserstate and b/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/kifio.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/ntrlab.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/ntrlab.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index f0c18ca..0000000 Binary files a/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/ntrlab.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/ntrlab.xcuserdatad/WorkspaceSettings.xcsettings b/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/ntrlab.xcuserdatad/WorkspaceSettings.xcsettings deleted file mode 100644 index a8f6112..0000000 --- a/ios/Runner.xcodeproj/project.xcworkspace/xcuserdata/ntrlab.xcuserdatad/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - BuildLocationStyle - UseTargetSettings - - diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index db500b5..a57af15 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - - - SuppressBuildableAutocreation - - ACE861271F9F745B006FEF38 - - primary - - - - - diff --git a/ios/Runner.xcodeproj/xcuserdata/ntrlab.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/Runner.xcodeproj/xcuserdata/ntrlab.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 73c1cbd..0000000 --- a/ios/Runner.xcodeproj/xcuserdata/ntrlab.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,72 +0,0 @@ - - - - - SchemeUserState - - Autobonus copy.xcscheme - - orderHint - 4 - - Dinect copy.xcscheme - - orderHint - 5 - - Runner copy.xcscheme - - orderHint - 13 - - Runner.xcscheme_^#shared#^_ - - orderHint - 4 - - - SuppressBuildableAutocreation - - 97C146ED1CF9000F007C117D - - primary - - - AC45BF1B1F9E386C009713E2 - - primary - - - AC45BF691F9E408E009713E2 - - primary - - - AC45BF921F9E574C009713E2 - - primary - - - AC73A3CE1F9F79760026EBA4 - - primary - - - AC73A3F61F9F7F910026EBA4 - - primary - - - ACE860F91F9F716A006FEF38 - - primary - - - ACE861271F9F745B006FEF38 - - primary - - - - - diff --git a/ios/Runner.xcodeproj/xcuserdata/sozinov_work.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/Runner.xcodeproj/xcuserdata/sozinov_work.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index eadd907..0000000 --- a/ios/Runner.xcodeproj/xcuserdata/sozinov_work.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,14 +0,0 @@ - - - - - SchemeUserState - - Runner.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/ios/Runner.xcworkspace/xcuserdata/dinect.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcworkspace/xcuserdata/dinect.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index cb3bfc5..0000000 Binary files a/ios/Runner.xcworkspace/xcuserdata/dinect.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/IDEFindNavigatorScopes.plist b/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/IDEFindNavigatorScopes.plist deleted file mode 100644 index 5dd5da8..0000000 --- a/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/IDEFindNavigatorScopes.plist +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 532613d..0000000 Binary files a/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index 20a7918..0000000 --- a/ios/Runner.xcworkspace/xcuserdata/ntrlab.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,151 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/Runner.xcworkspace/xcuserdata/sozinov_work.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcworkspace/xcuserdata/sozinov_work.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index be99069..0000000 Binary files a/ios/Runner.xcworkspace/xcuserdata/sozinov_work.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/ios/Runner.xcworkspace/xcuserdata/sozinov_work.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios/Runner.xcworkspace/xcuserdata/sozinov_work.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index ed9a9b4..0000000 --- a/ios/Runner.xcworkspace/xcuserdata/sozinov_work.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/UserInterfaceState.xcuserstate b/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index abe3a42..0000000 Binary files a/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/UserInterfaceState.xcuserstate and /dev/null differ diff --git a/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist deleted file mode 100644 index ed9a9b4..0000000 --- a/ios/Runner.xcworkspace/xcuserdata/supermyon.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ /dev/null @@ -1,5 +0,0 @@ - - - diff --git a/ios/Runner/AppDelegate.m b/ios/Runner/AppDelegate.m index aa9c019..b0ea311 100644 --- a/ios/Runner/AppDelegate.m +++ b/ios/Runner/AppDelegate.m @@ -1,8 +1,6 @@ #include "AppDelegate.h" #include "GeneratedPluginRegistrant.h" #import "Autobonus-Swift.h" -#import "ZBarSDK.h" - @implementation AppDelegate @@ -90,14 +88,9 @@ } else if ([@"getCurrency" isEqualToString:call.method]) { result(buildSettings[@"currency"]); } else if ([@"startScanner" isEqualToString:call.method]) { - NSString *locale = call.arguments[@"locale"]; - NSLog(@"locale is %@", locale); - ScannerViewController *modalViewController = [[ScannerViewController alloc] initWithLocale:locale]; + ScannerViewController *modalViewController = [[ScannerViewController alloc] initWithStrings:call.arguments]; modalViewController.platformChannel = weekPlatformChannel; [controller presentViewController:modalViewController animated:YES completion:nil]; -// [weekPlatformChannel invokeMethod:(@"findUserAndPurchase") arguments: @[@"79039441628", @"phone"]]; - - } else if ([@"isOnline" isEqualToString:call.method]) { result(@YES); } else if ([@"getSupportPhone" isEqualToString:call.method]) { diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json new file mode 100644 index 0000000..14e5217 --- /dev/null +++ b/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json @@ -0,0 +1,23 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "LaunchImage.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@2x.png", + "scale" : "2x" + }, + { + "idiom" : "universal", + "filename" : "LaunchImage@3x.png", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png differ diff --git a/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png new file mode 100644 index 0000000..9da19ea Binary files /dev/null and b/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png differ diff --git a/ios/Runner/Runner-Bridging-Header.h b/ios/Runner/Runner-Bridging-Header.h index aac9a81..f0cb9d3 100644 --- a/ios/Runner/Runner-Bridging-Header.h +++ b/ios/Runner/Runner-Bridging-Header.h @@ -2,5 +2,4 @@ // Use this file to import your target's public headers that you would like to expose to Swift. // -#import "ZBarSDK.h" -#import "ZBarImageScanner.h" +#import "ZXingObjC/ZXingObjC.h" diff --git a/ios/Runner/ScannerViewController.swift b/ios/Runner/ScannerViewController.swift index fa704af..fd381fc 100644 --- a/ios/Runner/ScannerViewController.swift +++ b/ios/Runner/ScannerViewController.swift @@ -1,250 +1,308 @@ -// -// ScannerViewController.swift -// Runner -// -// Created by Ivan Murashov on 13/07/2017. -// Copyright © 2017 The Chromium Authors. All rights reserved. -// - import UIKit import Flutter -extension ZBarSymbolSet: Sequence { - //public typealias Element = ZBarSymbol - //public typealias Iterator = NSFastEnumerationIterator - - public func makeIterator() -> NSFastEnumerationIterator { - return NSFastEnumerationIterator(self) - } -} - -@objc class ScannerViewController: UIViewController, ZBarReaderDelegate, UITextFieldDelegate { - +@objc class ScannerViewController: UIViewController, ZXCaptureDelegate, UITextFieldDelegate { + enum AppLocale { - case ru - case en + case ru + case en } - + enum ButtonState { case card case phone - + var icon: UIImage { - + switch self { - case .card: return UIImage(named: "card")! - case .phone: return UIImage(named: "phone")! + case .card: return UIImage(named: "card")! + case .phone: return UIImage(named: "phone")! } } - + var searchType: String { switch self { - case .card: return "card" - case .phone: return "phone" + case .card: return "card" + case .phone: return "phone" } } } - - var appLocale: AppLocale + + // @IBOutlet weak var decodedLabel: UILabel! + + private var captureSizeTransform: CGAffineTransform? + var buttonState: ButtonState = .card - + var platformChannel: FlutterMethodChannel? - let readerViewController = ZBarReaderViewController() - - + + // Квадрат для наведения на цель (надеюсь) + let scanRectView = UIView() + //Вьюшка для верхнего меню let topView = UIView() - + //Окно ввода кода let textField = UITextField() - + //Кнопка настроек var settingButton: UIButton! - + + var strings = [String:String]() + required init?(coder aDecoder: NSCoder) { - self.appLocale = .en super.init(coder: aDecoder) } - - init(locale: String) { - switch locale { - case "ru": self.appLocale = .ru; break - default: self.appLocale = .en - } + + init(strings: [String: String]) { super.init(nibName: nil, bundle: nil) + strings.forEach { (k,v) in self.strings[k] = v } } - - func getCardHint() -> String { - switch self.appLocale { - case .ru: return "Ввести номер карты" - default: return "Enter the barcode" - } - } - - func getPhoneHint() -> String { - switch self.appLocale { - case .ru: return "Телефон 79XXXXXXXXX" - default: return "Phone 79XXXXXXXXX" - } - } - + func getInputHint() -> String { switch self.buttonState { - case .card: return self.getCardHint() - case .phone: return self.getPhoneHint() + case .card: return strings["enter_manual"]! + case .phone: return strings["enter_phone"]! } } - - func getErrorTitle() -> String { - switch self.appLocale { - case .ru: return "Ошибка" - default: return "Error" - } - } - - func getCardErrorText() -> String { - switch self.appLocale { - case .ru: return "Пользователь с номером карты %@ не найден" - default: return "User with card number %@ not found" - } - } - - func getPhoneErrorText() -> String { - switch self.appLocale { - case .ru: return "Пользователь с номером телефона %@ не найден" - default: return "User with phone number %@ not found" - } - } - + func getErrorText() -> String { switch self.buttonState { - case .card: return self.getCardErrorText() - case .phone: return self.getPhoneErrorText() + case .card: return strings["user_card_not_found"]! + case .phone: return strings["user_phone_not_found"]! } } - - func getDismissText() -> String { - switch self.appLocale { - case .ru: return "Скрыть" - default: return "Dismiss" - } - } - + + let capture: ZXCapture = ZXCapture() + override func viewDidLoad() { super.viewDidLoad() - - readerViewController.readerDelegate = self - readerViewController.readerView.zoom = 1.0 - readerViewController.showsZBarControls = false - + capture.camera = capture.back() + capture.focusMode = .continuousAutoFocus + view.layer.addSublayer((capture.layer)!) + view.addSubview(scanRectView) + settingButton = UIButton(type: .system) settingButton.addTarget(self, action: #selector(ScannerViewController.buttonTouch), for: .touchUpInside) - - self.addChildViewController(readerViewController) - self.view.addSubview(readerViewController.view) - readerViewController.didMove(toParentViewController: self) - - readerViewController.view.addSubview(topView) + topView.addSubview(textField) topView.addSubview(settingButton) - + view.addSubview(topView) + view.bringSubview(toFront: topView) + textField.delegate = self - //textField.keyboardType = .numberPad - - //Looks for single or multiple taps. + let tap = UITapGestureRecognizer(target: self, action: #selector(ScannerViewController.hideKeyboard)) - readerViewController.view.addGestureRecognizer(tap) - + view.addGestureRecognizer(tap) + settingButton.setImage(self.buttonState.icon, for: .normal) textField.placeholder = self.getInputHint() - + } - + + override func viewWillAppear(_ animated: Bool) { + super.viewWillAppear(animated) + topView.backgroundColor = UIColor.white + textField.borderStyle = .roundedRect + capture.delegate = self + applyOrientation() + } + + override func viewWillLayoutSubviews() { + scanRectView.frame = view.bounds + topView.frame = CGRect(x: 0, y: 0, width: view.frame.size.width, height: 56) + settingButton.frame = CGRect(x: 8, y: 26, width: 20, height: 20) + textField.frame = CGRect(x: settingButton.frame.maxX + 8, y: 21, + width: view.frame.size.width - settingButton.frame.maxX - 16, height: 30) + } + func hideKeyboard() { view.endEditing(false) } - + func buttonTouch(){ - + switch self.buttonState { - case .card: self.buttonState = .phone - case .phone: self.buttonState = .card + case .card: self.buttonState = .phone + case .phone: self.buttonState = .card } settingButton.setImage(self.buttonState.icon, for: .normal) textField.placeholder = self.getInputHint() } - + func textFieldShouldReturn(_ textField: UITextField) -> Bool { - + sendResult(textField.text!) - + return true } - + func sendResult(_ str: String) { platformChannel?.invokeMethod("findUser", arguments: [str, buttonState.searchType], result: { (result: Any?) in if result is FlutterError { self.showErrorAlert(str) } else { - + self.dismiss(animated: true) { self.platformChannel?.invokeMethod("purchase", arguments: [result, str]) } } print("result: \(result.debugDescription )") }) - + } - + func showErrorAlert(_ str: String) { let alertController = UIAlertController( - title: self.getErrorTitle(), + title: strings["error"]!, message: String(format: self.getErrorText(), str), preferredStyle: UIAlertControllerStyle.alert ) - alertController.addAction(UIAlertAction(title: self.getDismissText(), style: UIAlertActionStyle.default,handler: nil)) - -// if let appDelegate = UIApplication.shared.delegate as? FlutterAppDelegate { -// appDelegate.window.rootViewController?.present(alertController, animated: true, completion: nil) -// } + alertController.addAction(UIAlertAction(title: strings["dismiss"]!, style: UIAlertActionStyle.default,handler: nil)) self.present(alertController, animated: true, completion: nil) - } - - override func viewWillAppear(_ animated: Bool) { - topView.backgroundColor = UIColor.white - textField.borderStyle = .roundedRect - super.viewWillAppear(animated) - } - - override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - } - - override func viewWillLayoutSubviews() { - - readerViewController.view.frame = view.bounds - topView.frame = CGRect(x: 0, y: 0, width: readerViewController.view.frame.size.width, height: 40) - textField.frame = CGRect(x: settingButton.frame.maxX + 8 + 20 + 5, y: 5, width: readerViewController.view.frame.size.width - 50, height: 30) - settingButton.frame = CGRect(x: 8, y: 10, width: 20, height: 20) - - } - - func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String : Any]) { - guard let symbols = info[ZBarReaderControllerResults] as? ZBarSymbolSet else { return } - - for symbol in symbols { - - if let symbol = symbol as? ZBarSymbol, let data = symbol.data { - sendResult(data) - - } - } - } - - + override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() } - + + deinit { + capture.layer.removeFromSuperlayer() + } + + override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) { + super.viewWillTransition(to: size, with: coordinator) + coordinator.animate(alongsideTransition: {(_ context: UIViewControllerTransitionCoordinatorContext) -> Void in + }, completion: {(_ context: UIViewControllerTransitionCoordinatorContext) -> Void in + self.applyOrientation() + }) + } + + func applyOrientation() { + print("APPLY ORIENTATION") + let orientation: UIInterfaceOrientation = UIApplication.shared.statusBarOrientation + var scanRectRotation: Float + var captureRotation: Float + switch orientation { + case .portrait: + captureRotation = 0 + scanRectRotation = 90 + case .landscapeLeft: + captureRotation = 90 + scanRectRotation = 180 + case .landscapeRight: + captureRotation = 270 + scanRectRotation = 0 + case .portraitUpsideDown: + captureRotation = 180 + scanRectRotation = 270 + default: + captureRotation = 0 + scanRectRotation = 90 + } + applyRectOfInterest(orientation) + let transform = CGAffineTransform(rotationAngle: CGFloat(captureRotation / 180 * .pi)) + capture.transform = transform + capture.rotation = CGFloat(scanRectRotation) + capture.layer.frame = view.frame + } + + func applyRectOfInterest(_ orientation: UIInterfaceOrientation) { + var scaleVideo: CGFloat + var scaleVideoX: CGFloat + var scaleVideoY: CGFloat + var videoSizeX: CGFloat + var videoSizeY: CGFloat + var transformedVideoRect: CGRect = scanRectView.frame + videoSizeX = 720 + videoSizeY = 1280 + if UIInterfaceOrientationIsPortrait(orientation) { + scaleVideoX = view.frame.size.width / videoSizeX + scaleVideoY = view.frame.size.height / videoSizeY + scaleVideo = max(scaleVideoX, scaleVideoY) + if scaleVideoX > scaleVideoY { + transformedVideoRect.origin.y += (scaleVideo * videoSizeY - view.frame.size.height) / 2 + } + else { + transformedVideoRect.origin.x += (scaleVideo * videoSizeX - view.frame.size.width) / 2 + } + } + else { + scaleVideoX = view.frame.size.width / videoSizeY + scaleVideoY = view.frame.size.height / videoSizeX + scaleVideo = max(scaleVideoX, scaleVideoY) + if scaleVideoX > scaleVideoY { + transformedVideoRect.origin.y += (scaleVideo * videoSizeX - view.frame.size.height) / 2 + } + else { + transformedVideoRect.origin.x += (scaleVideo * videoSizeY - view.frame.size.width) / 2 + } + } + captureSizeTransform = CGAffineTransform(scaleX: 1 / scaleVideo, y: 1 / scaleVideo) + capture.scanRect = transformedVideoRect.applying(captureSizeTransform!) + } + + // MARK: - Private Methods + func barcodeFormat(toString format: ZXBarcodeFormat) -> String { + switch format { + case kBarcodeFormatAztec: + return "Aztec" + case kBarcodeFormatCodabar: + return "CODABAR" + case kBarcodeFormatCode39: + return "Code 39" + case kBarcodeFormatCode93: + return "Code 93" + case kBarcodeFormatCode128: + return "Code 128" + case kBarcodeFormatDataMatrix: + return "Data Matrix" + case kBarcodeFormatEan8: + return "EAN-8" + case kBarcodeFormatEan13: + return "EAN-13" + case kBarcodeFormatITF: + return "ITF" + case kBarcodeFormatPDF417: + return "PDF417" + case kBarcodeFormatQRCode: + return "QR Code" + case kBarcodeFormatRSS14: + return "RSS 14" + case kBarcodeFormatRSSExpanded: + return "RSS Expanded" + case kBarcodeFormatUPCA: + return "UPCA" + case kBarcodeFormatUPCE: + return "UPCE" + case kBarcodeFormatUPCEANExtension: + return "UPC/EAN extension" + default: + return "Unknown" + } + } + + // MARK: - ZXCaptureDelegate Methods + func captureResult(_ capture: ZXCapture, result: ZXResult) { + let inverse: CGAffineTransform = captureSizeTransform!.inverted() + var points = [AnyHashable]() + var location = "" + for resultPoint in result.resultPoints { + let p = resultPoint as! ZXResultPoint + let cgPoint = CGPoint(x: CGFloat(p.x), y: CGFloat(p.y)) + var transformedPoint: CGPoint = cgPoint.applying(inverse) + transformedPoint = scanRectView.convert(transformedPoint, to: scanRectView.window) + let windowPointValue = NSValue(cgPoint: transformedPoint) + location = "\(location) (\(transformedPoint.x), \(transformedPoint.y))" + points.append(windowPointValue) + } + // We got a result. Display information about the result onscreen. + let formatString: String = barcodeFormat(toString: result.barcodeFormat) + sendResult(result.text) + print(result.text) + self.capture.stop() + DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + Double(2 * Double(NSEC_PER_SEC)) / Double(NSEC_PER_SEC), execute: {() -> Void in + self.capture.start() + }) + } } diff --git a/lib/base/base_state.dart b/lib/base/base_state.dart index f0f4205..827d7eb 100644 --- a/lib/base/base_state.dart +++ b/lib/base/base_state.dart @@ -69,10 +69,12 @@ abstract class BaseState extends State { child: getMenuItem(help_png, StringsLocalization.help()) )); - menuItemList.add(new PopupMenuItem( - value: 2, - child: getMenuItem(exit_png, StringsLocalization.exit()) - )); + if (Theme.of(context).platform != TargetPlatform.iOS) { + menuItemList.add(new PopupMenuItem( + value: 2, + child: getMenuItem(exit_png, StringsLocalization.exit()) + )); + } return [ new PopupMenuButton( @@ -87,7 +89,7 @@ abstract class BaseState extends State { void onOptionsItemClick(int index) { switch (index) { case 0: { - pushRoute(context, new SettingsScreen(helper, app, false)); + pushRoute(context, new SettingsScreen(helper, app, false)); break; } case 1: { diff --git a/lib/base/settings_base_state.dart b/lib/base/settings_base_state.dart index 1ca0aae..33f9274 100644 --- a/lib/base/settings_base_state.dart +++ b/lib/base/settings_base_state.dart @@ -4,7 +4,8 @@ import 'package:checker/db.dart'; import 'package:checker/strings.dart'; import 'package:flutter/material.dart'; -abstract class SettingsBaseState extends BaseState { +abstract class SettingsBaseState + extends BaseState { SettingsBaseState(SqliteHelper helper, String app) { this.helper = helper; @@ -15,7 +16,7 @@ abstract class SettingsBaseState extends BaseState @override Widget build(BuildContext context) { return new Scaffold(appBar: getAppBar(), - body: getScreenContent()); + body: getScreenContent()); } @override @@ -43,26 +44,27 @@ abstract class SettingsBaseState extends BaseState Widget getItem(String option) { return new Container( - height: 56.0, - child: (new FlatButton(onPressed: () { + height: 56.0, + child: (new FlatButton(onPressed: () { + setState(() { saveOption(); - setState(() { - selectedItem = getOptions().indexOf(option); - }); - }, - child: new Row(children: [ - new Expanded(child: new Text(option)), - getCheckMark(getOptions().indexOf(option))])))); + selectedItem = getOptions().indexOf(option); + }); + }, + child: new Row(children: [ + new Expanded(child: new Text(option)), + getCheckMark(getOptions().indexOf(option)) + ])))); } Widget getCheckMark(int index) { return index == selectedItem ? new Image.asset(check_png, - width: 28.0, - height: 28.0) : new Image.asset(check_png, color: new Color(0xffffff)); + width: 28.0, + height: 28.0) : new Image.asset(check_png, color: new Color(0xffffff)); } @override String getTitle() { return StringsLocalization.settings(); } -} \ No newline at end of file +} diff --git a/lib/common.dart b/lib/common.dart index 6035ed0..075ffd2 100644 --- a/lib/common.dart +++ b/lib/common.dart @@ -5,7 +5,6 @@ import 'package:checker/screens/splash.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:image_picker/image_picker.dart'; -import 'package:intl/intl.dart'; import 'db.dart'; import 'dart:convert'; @@ -46,9 +45,8 @@ logout(BuildContext context, SqliteHelper helper) async { helper.clear().then((result) { // helper.close().then((_) { // Navigator.of(context).pop(); -// Navigator.of(context).pop(); - pushRouteReplacement( - context, new SplashScreen()); // Запускаем регистрацию + // Navigator.of(context).pop(); + pushRouteReplacement(context, new SplashScreen()); // Запускаем регистрацию // }); }); }).catchError((error) { @@ -162,13 +160,16 @@ startScanner(BuildContext context, String app, SqliteHelper helper) async { } }); - platform.invokeMethod('startScanner', { + Map args = StringsLocalization.strings; + args.addAll({ 'token': token, 'url': await platform.invokeMethod('getEndpoint'), 'appToken': await platform.invokeMethod('getAppToken'), - 'locale': Intl.defaultLocale, - 'color': Resources.getPrimaryColor(app).value + 'localeCode': StringsLocalization.localeCode, + 'color': Resources.getPrimaryColor(app).value.toString() }); + + platform.invokeMethod('startScanner', args); } } } diff --git a/lib/i18n/messages_all.dart b/lib/i18n/messages_all.dart deleted file mode 100644 index 7e32ab7..0000000 --- a/lib/i18n/messages_all.dart +++ /dev/null @@ -1,62 +0,0 @@ -// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart -// This is a library that looks up messages for specific locales by -// delegating to the appropriate library. - -import 'dart:async'; - -import 'package:intl/intl.dart'; -import 'package:intl/message_lookup_by_library.dart'; -import 'package:intl/src/intl_helpers.dart'; - -import 'messages_en.dart' as messages_messages_en; -import 'messages_es.dart' as messages_messages_es; -import 'messages_ru.dart' as messages_messages_ru; -import 'messages_ua.dart' as messages_messages_ua; - -typedef Future LibraryLoader(); -Map _deferredLibraries = { - 'en': () => new Future.value(null), - 'es': () => new Future.value(null), - 'ru': () => new Future.value(null), - 'ua': () => new Future.value(null), -}; - -MessageLookupByLibrary _findExact(localeName) { - switch (localeName) { - case 'en': - return messages_messages_en.messages; - case 'es': - return messages_messages_es.messages; - case 'ru': - return messages_messages_ru.messages; - case 'ua': - return messages_messages_ua.messages; - default: - return null; - } -} - -/// User programs should call this before using [localeName] for messages. -Future initializeMessages(String localeName) { - var lib = _deferredLibraries[Intl.canonicalizedLocale(localeName)]; - var load = lib == null ? new Future.value(false) : lib(); - return load.then((_) { - initializeInternalMessageLookup(() => new CompositeMessageLookup()); - messageLookup.addLocale(localeName, _findGeneratedMessagesFor); - }); -} - -bool _messagesExistFor(String locale) { - var messages; - try { - messages = _findExact(locale); - } catch (e) {} - return messages != null; -} - -MessageLookupByLibrary _findGeneratedMessagesFor(locale) { - var actualLocale = Intl.verifiedLocale(locale, _messagesExistFor, - onFailure: (_) => null); - if (actualLocale == null) return null; - return _findExact(actualLocale); -} diff --git a/lib/i18n/messages_en.dart b/lib/i18n/messages_en.dart deleted file mode 100644 index 405a6be..0000000 --- a/lib/i18n/messages_en.dart +++ /dev/null @@ -1,112 +0,0 @@ -// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart -// This is a library that provides messages for a messages_en locale. All the -// messages from the main program should be duplicated here with the same -// function name. - -import 'package:intl/intl.dart'; -import 'package:intl/message_lookup_by_library.dart'; - -final messages = new MessageLookup(); - -final _keepAnalysisHappy = Intl.defaultLocale; - -class MessageLookup extends MessageLookupByLibrary { - get localeName => 'messages_en'; - - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "ID_Store" : MessageLookupByLibrary.simpleMessage("Store ID"), - "ID_not_found" : MessageLookupByLibrary.simpleMessage("Identifier %s is not found"), - "app_activ" : MessageLookupByLibrary.simpleMessage("The application is activated"), - "ask_change_store" : MessageLookupByLibrary.simpleMessage("Do you really want to log out and enter a different store number?"), - "buyer" : MessageLookupByLibrary.simpleMessage("Buyer"), - "card" : MessageLookupByLibrary.simpleMessage("Card"), - "card_scaner" : MessageLookupByLibrary.simpleMessage("Card Scanner"), - "carry_purchase" : MessageLookupByLibrary.simpleMessage("Create a purchase"), - "complite_activ" : MessageLookupByLibrary.simpleMessage("Complete registration"), - "complite_purchase" : MessageLookupByLibrary.simpleMessage("Complete the purchase"), - "confirm_purchase" : MessageLookupByLibrary.simpleMessage("You confirm the purchase for %s %s"), - "confirmation" : MessageLookupByLibrary.simpleMessage("Сonfirmation"), - "no" : MessageLookupByLibrary.simpleMessage("No"), - "purchase_complite" : MessageLookupByLibrary.simpleMessage("A purchase of %s %s was completed"), - "registration" : MessageLookupByLibrary.simpleMessage("Registration"), - "usage" : MessageLookupByLibrary.simpleMessage("Usage"), - "support" : MessageLookupByLibrary.simpleMessage("Support contacts"), - "common" : MessageLookupByLibrary.simpleMessage("General information"), - "request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("Activation request for the application has been sent, please wait for administrator approval"), - "reward" : MessageLookupByLibrary.simpleMessage("Reward"), - "bonus" : MessageLookupByLibrary.simpleMessage("Bonus on account"), - "discount_rate" : MessageLookupByLibrary.simpleMessage("Dicount Rate"), - "discount_sum" : MessageLookupByLibrary.simpleMessage("Dicount Sum"), - "bonus_plus" : MessageLookupByLibrary.simpleMessage("Bonus points"), - "bonus_minus" : MessageLookupByLibrary.simpleMessage("Bonus was charged"), - "bonus_hint" : MessageLookupByLibrary.simpleMessage("Points to charge"), - "coupons_used" : MessageLookupByLibrary.simpleMessage("Coupons were used"), - "select_coupons" : MessageLookupByLibrary.simpleMessage("Select coupons for using in purchase"), - "bonus_explanation" : MessageLookupByLibrary.simpleMessage("If not set, points will be added"), - "scan" : MessageLookupByLibrary.simpleMessage("Scan"), - "sign_up" : MessageLookupByLibrary.simpleMessage("Sign Up"), - "specify_din_store" : MessageLookupByLibrary.simpleMessage("Specify the store ID"), - "sum" : MessageLookupByLibrary.simpleMessage("Sum"), - "update_activ_status" : MessageLookupByLibrary.simpleMessage("Update activation status"), - "yes" : MessageLookupByLibrary.simpleMessage("Yes"), - "settings" : MessageLookupByLibrary.simpleMessage("Settings"), - "help" : MessageLookupByLibrary.simpleMessage("Help"), - "exit" : MessageLookupByLibrary.simpleMessage("Exit"), - "logout" : MessageLookupByLibrary.simpleMessage("Log Out"), - "currency" : MessageLookupByLibrary.simpleMessage("Currency"), - "locale" : MessageLookupByLibrary.simpleMessage("Language"), - "nominative_ruble": MessageLookupByLibrary.simpleMessage("Ruble"), - "singular_ruble": MessageLookupByLibrary.simpleMessage("Ruble"), - "plural_ruble": MessageLookupByLibrary.simpleMessage("Rubles"), - "nominative_dollar": MessageLookupByLibrary.simpleMessage("US Dollar"), - "singular_dollar": MessageLookupByLibrary.simpleMessage("US Dollar"), - "plural_dollar": MessageLookupByLibrary.simpleMessage("US Dollars"), - "nominative_hryvna": MessageLookupByLibrary.simpleMessage("Hryvnia"), - "singular_hryvna": MessageLookupByLibrary.simpleMessage("Hryvnia"), - "plural_hryvna": MessageLookupByLibrary.simpleMessage("Hryvnia"), - "nominative_tenge": MessageLookupByLibrary.simpleMessage("Tenge"), - "singular_tenge": MessageLookupByLibrary.simpleMessage("Tenge"), - "plural_tenge": MessageLookupByLibrary.simpleMessage("Tenge"), - "nominative_euro": MessageLookupByLibrary.simpleMessage("Euro"), - "singular_euro": MessageLookupByLibrary.simpleMessage("Euro"), - "plural_euro": MessageLookupByLibrary.simpleMessage("Euro"), - "registration_guide": MessageLookupByLibrary.simpleMessage(''' -Store log in screen is the first thing you will see after starting the application. - -Enter the store number (ID). You can look it up in the loyalty program control panel. If you do not have access to the control panel, ask the administrator. - -Click the ""Login"" button. - -Please wait while the administrator activates your request. You can refresh your store activation status by pressing the ""Update activation status"" button. - -After the administrator activates your request, click the ""Complete activation"" button. The application is ready to use. - -If you want to log in as another store, click the Menu button (upper right corner of the screen) and select "Exit". -'''), - "usage_guide": MessageLookupByLibrary.simpleMessage(''' -Step 1: - -Launch this application and scan your customer's loyalty card using the built in scanner. - -If the scan is successful, the customer's information will appear on the screen. - -Step 2: - -Enter the purchase amount and click the ""Create a purchase"" button. - -In a pop-up window press ""YES"" to confirm the amount and allot the points to a customer. - -If you want to correct the amount, press ""NO"" and you will return back to the purchase screen where you can adjust the amount. -'''), - "support_guide": MessageLookupByLibrary.simpleMessage(''' -Always recommend your customers to install your loyalty card app, so they can participate in your loyalty program. - -If you have any problems with the application, feel free to contact the support. - -Phone:\n%s\n -Our website:\n%s'''), - "common_guide": MessageLookupByLibrary.simpleMessage(''' -To improve barcode scanning quality, adjust the distance between the camera and the barcode so that the border around the barcode (if any) is not visible. Otherwise the vertical lines of the border could be wrongly considered as part of the code.''') - }; -} diff --git a/lib/i18n/messages_es.dart b/lib/i18n/messages_es.dart deleted file mode 100644 index 33e18c2..0000000 --- a/lib/i18n/messages_es.dart +++ /dev/null @@ -1,111 +0,0 @@ -// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart -// This is a library that provides messages for a messages_es locale. All the -// messages from the main program should be duplicated here with the same -// function name. - -import 'package:intl/intl.dart'; -import 'package:intl/message_lookup_by_library.dart'; - -final messages = new MessageLookup(); - -final _keepAnalysisHappy = Intl.defaultLocale; - -class MessageLookup extends MessageLookupByLibrary { - get localeName => 'messages_es'; - - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "ID_Store" : MessageLookupByLibrary.simpleMessage("ID del negocio "), - "ID_not_found" : MessageLookupByLibrary.simpleMessage("ID %s no está encontrado"), - "app_activ" : MessageLookupByLibrary.simpleMessage("Aplicación está activada"), - "ask_change_store" : MessageLookupByLibrary.simpleMessage("¿Os realmente quiereis acabarse una sesión y dar otro DIN del negocio?"), - "buyer" : MessageLookupByLibrary.simpleMessage("El comprador"), - "card" : MessageLookupByLibrary.simpleMessage("Tarjeta"), - "card_scaner" : MessageLookupByLibrary.simpleMessage("El escaneo de tarjeta"), - "carry_purchase" : MessageLookupByLibrary.simpleMessage("Realizar la compra"), - "complite_activ" : MessageLookupByLibrary.simpleMessage("Terminar el registro"), - "complite_purchase" : MessageLookupByLibrary.simpleMessage("Terminar la compra"), - "confirm_purchase" : MessageLookupByLibrary.simpleMessage("¿Confirmais la compra por %s %s"), - "confirmation" : MessageLookupByLibrary.simpleMessage("Confirmacón"), - "no" : MessageLookupByLibrary.simpleMessage("No"), - "purchase_complite" : MessageLookupByLibrary.simpleMessage("La compra por %s %s está realizada"), - "registration" : MessageLookupByLibrary.simpleMessage("El registro"), - "usage" : MessageLookupByLibrary.simpleMessage("Explotación"), - "support" : MessageLookupByLibrary.simpleMessage("Los contactos del soporte técnico"), - "request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("El requieremento de activación de aplicación esta mandado, esperad la activación por el administrador."), - "reward" : MessageLookupByLibrary.simpleMessage("Gratificación"), - "bonus" : MessageLookupByLibrary.simpleMessage("Bono por cuenta"), - "discount_rate" : MessageLookupByLibrary.simpleMessage("Tasa de descuento"), - "discount_sum" : MessageLookupByLibrary.simpleMessage("El monto del descuento"), - "bonus_plus" : MessageLookupByLibrary.simpleMessage("Puntos de bonificación"), - "bonus_minus" : MessageLookupByLibrary.simpleMessage("El bono fue cobrado"), - "bonus_hint" : MessageLookupByLibrary.simpleMessage("¿Cuántas puntuaciones se cancelan?"), - "coupons_used" : MessageLookupByLibrary.simpleMessage("Los cupones fueron canjeados"), - "bonus_explanation" : MessageLookupByLibrary.simpleMessage("Si no especifica cuántos puntos cancelar, se agregarán puntos"), - "scan" : MessageLookupByLibrary.simpleMessage("Escanear"), - "sign_up" : MessageLookupByLibrary.simpleMessage("Registrarse"), - "specify_din_store" : MessageLookupByLibrary.simpleMessage("Hay que dar ID del negocio"), - "sum" : MessageLookupByLibrary.simpleMessage("Suma"), - "update_activ_status" : MessageLookupByLibrary.simpleMessage("Actualizar la condición de activación"), - "user_name" : MessageLookupByLibrary.simpleMessage("Un nombre de usario"), - "yes" : MessageLookupByLibrary.simpleMessage("Si"), - "settings" : MessageLookupByLibrary.simpleMessage("Las configuraciones"), - "help" : MessageLookupByLibrary.simpleMessage("La Ayuda"), - "exit" : MessageLookupByLibrary.simpleMessage("Salir"), - "logout" : MessageLookupByLibrary.simpleMessage("Log Out"), - "currency" : MessageLookupByLibrary.simpleMessage("La Moneda"), - "locale" : MessageLookupByLibrary.simpleMessage("La lengua"), - "nominative_ruble": MessageLookupByLibrary.simpleMessage("Rublo"), - "singular_ruble": MessageLookupByLibrary.simpleMessage("Rublo"), - "plural_ruble": MessageLookupByLibrary.simpleMessage("Rublos"), - "nominative_dollar": MessageLookupByLibrary.simpleMessage("Dólar Dolares"), - "singular_dollar": MessageLookupByLibrary.simpleMessage("Dólar Dolares"), - "plural_dollar": MessageLookupByLibrary.simpleMessage("Dólar Dolares"), - "nominative_hryvna": MessageLookupByLibrary.simpleMessage("Hryvnia"), - "singular_hryvna": MessageLookupByLibrary.simpleMessage("Hryvnia"), - "plural_hryvna": MessageLookupByLibrary.simpleMessage("Hryvnia"), - "nominative_tenge": MessageLookupByLibrary.simpleMessage("Tenge"), - "singular_tenge": MessageLookupByLibrary.simpleMessage("Tenge"), - "plural_tenge": MessageLookupByLibrary.simpleMessage("Tenge"), - "nominative_euro": MessageLookupByLibrary.simpleMessage("Euro"), - "singular_euro": MessageLookupByLibrary.simpleMessage("Euro"), - "plural_euro": MessageLookupByLibrary.simpleMessage("Euro"), - "registration_guide": MessageLookupByLibrary.simpleMessage(''' -Store log in screen is the first thing you will see after starting the application. - -Enter the store number (DIN). You can look it up in the loyalty program control panel. If you do not have access to the control panel, ask the administrator. - -Click the ""Login"" button. - -Please wait while the administrator activates your request. You can refresh your store activation status by pressing the ""Update activation status"" button. - -After the administrator activates your request, click the ""Complete activation"" button. The application is ready to use. - -If you want to log in as another store, click the Menu button (upper right corner of the screen) and select "Exit". -'''), - "usage_guide": MessageLookupByLibrary.simpleMessage(''' -Step 1: - -Launch this application and scan your customer's loyalty card using the built in scanner. - -If the scan is successful, the customer's information will appear on the screen. - -Step 2: - -Enter the purchase amount and click the ""Create a purchase"" button. - -In a pop-up window press ""YES"" to confirm the amount and allot the points to a customer. - -If you want to correct the amount, press ""NO"" and you will return back to the purchase screen where you can adjust the amount. -'''), - "support_guide": MessageLookupByLibrary.simpleMessage(''' -Always recommend your customers to install your loyalty card app, so they can participate in your loyalty program. - -If you have any problems with the application, feel free to contact the support. - -Phone:\n%s\n -Our website:\n%s'''), - "common_guide": MessageLookupByLibrary.simpleMessage(''' -To improve barcode scanning quality, adjust the distance between the camera and the barcode so that the border around the barcode (if any) is not visible. Otherwise the vertical lines of the border could be wrongly considered as part of the code.''') - }; -} diff --git a/lib/i18n/messages_ru.dart b/lib/i18n/messages_ru.dart deleted file mode 100644 index 4fb408a..0000000 --- a/lib/i18n/messages_ru.dart +++ /dev/null @@ -1,113 +0,0 @@ -// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart -// This is a library that provides messages for a messages_ru locale. All the -// messages from the main program should be duplicated here with the same -// function name. - -import 'package:intl/intl.dart'; -import 'package:intl/message_lookup_by_library.dart'; - -final messages = new MessageLookup(); - -final _keepAnalysisHappy = Intl.defaultLocale; - -class MessageLookup extends MessageLookupByLibrary { - get localeName => 'messages_ru'; - - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "ID_Store" : MessageLookupByLibrary.simpleMessage("ID магазина"), - "ID_not_found" : MessageLookupByLibrary.simpleMessage("Идентификатор %s не найден"), - "app_activ" : MessageLookupByLibrary.simpleMessage("Приложение активировано"), - "ask_change_store" : MessageLookupByLibrary.simpleMessage("Вы действительно хотите выйти и ввести другой номер магазина?"), - "buyer" : MessageLookupByLibrary.simpleMessage("Покупатель"), - "card" : MessageLookupByLibrary.simpleMessage("Карта"), - "card_scaner" : MessageLookupByLibrary.simpleMessage("Сканер карты"), - "carry_purchase" : MessageLookupByLibrary.simpleMessage("Проведение покупки"), - "complite_activ" : MessageLookupByLibrary.simpleMessage("Завершить регистрацию"), - "complite_purchase" : MessageLookupByLibrary.simpleMessage("Завершить покупку"), - "confirm_purchase" : MessageLookupByLibrary.simpleMessage("Вы подтверждаете покупку на %s %s"), - "confirmation" : MessageLookupByLibrary.simpleMessage("Подтверждение"), - "no" : MessageLookupByLibrary.simpleMessage("Нет"), - "purchase_complite" : MessageLookupByLibrary.simpleMessage("Покупка на сумму %s %s проведена"), - "registration" : MessageLookupByLibrary.simpleMessage("Регистрация"), - "usage" : MessageLookupByLibrary.simpleMessage("Использование"), - "support" : MessageLookupByLibrary.simpleMessage("Контакты поддержки"), - "common" : MessageLookupByLibrary.simpleMessage("Общая информация"), - "request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("Запрос на активацию приложения отправлен, дождитесь подтверждения активации администратором"), - "reward" : MessageLookupByLibrary.simpleMessage("Вознаграждение"), - "bonus" : MessageLookupByLibrary.simpleMessage("Бонусов на счету"), - "discount_rate" : MessageLookupByLibrary.simpleMessage("Процент скидки"), - "discount_sum" : MessageLookupByLibrary.simpleMessage("Сумма скидки"), - "bonus_plus" : MessageLookupByLibrary.simpleMessage("Бонусов начислено"), - "bonus_minus" : MessageLookupByLibrary.simpleMessage("Бонусов списано"), - "bonus_hint" : MessageLookupByLibrary.simpleMessage("Сколько баллов списать?"), - "coupons_used" : MessageLookupByLibrary.simpleMessage("Были погашены купоны"), - "select_coupons" : MessageLookupByLibrary.simpleMessage("Выберите купоны для гашения"), - "bonus_explanation" : MessageLookupByLibrary.simpleMessage("Если не указано сколько баллов списать, баллы будут начислены"), - "scan" : MessageLookupByLibrary.simpleMessage("Сканировать"), - "sign_up" : MessageLookupByLibrary.simpleMessage("Зарегистрироваться"), - "specify_din_store" : MessageLookupByLibrary.simpleMessage("Необходимо указать ID магазина"), - "sum" : MessageLookupByLibrary.simpleMessage("Сумма"), - "update_activ_status" : MessageLookupByLibrary.simpleMessage("Обновить статус активации"), - "yes" : MessageLookupByLibrary.simpleMessage("Да"), - "settings" : MessageLookupByLibrary.simpleMessage("Настройки"), - "help" : MessageLookupByLibrary.simpleMessage("Справка"), - "exit" : MessageLookupByLibrary.simpleMessage("Закрыть приложение"), - "logout" : MessageLookupByLibrary.simpleMessage("Выйти из аккаунта"), - "currency" : MessageLookupByLibrary.simpleMessage("Валюта"), - "locale" : MessageLookupByLibrary.simpleMessage("Язык"), - "nominative_ruble": MessageLookupByLibrary.simpleMessage("Рубль"), - "singular_ruble": MessageLookupByLibrary.simpleMessage("Рубля"), - "plural_ruble": MessageLookupByLibrary.simpleMessage("Рублей"), - "nominative_dollar": MessageLookupByLibrary.simpleMessage("Доллар США"), - "singular_dollar": MessageLookupByLibrary.simpleMessage("Доллара США"), - "plural_dollar": MessageLookupByLibrary.simpleMessage("Долларов США"), - "nominative_hryvna": MessageLookupByLibrary.simpleMessage("Гривна"), - "singular_hryvna": MessageLookupByLibrary.simpleMessage("Гривны"), - "plural_hryvna": MessageLookupByLibrary.simpleMessage("Гривен"), - "nominative_tenge": MessageLookupByLibrary.simpleMessage("Тенге"), - "singular_tenge": MessageLookupByLibrary.simpleMessage("Тенге"), - "plural_tenge": MessageLookupByLibrary.simpleMessage("Тенге"), - "nominative_euro": MessageLookupByLibrary.simpleMessage("Евро"), - "singular_euro": MessageLookupByLibrary.simpleMessage("Евро"), - "plural_euro": MessageLookupByLibrary.simpleMessage("Евро"), - "registration_guide": MessageLookupByLibrary.simpleMessage(''' -После запуска приложения вы окажетесь на странице регистрации магазина. - -Введите ID код магазина (выдается при подключении к системе лояльности) - -Кликните по кнопке: «Зарегистрировать» -Дождитесь подтверждение активации программы, нажатием по кнопке «Обновите статус активации» обновите статус. - -После подтверждения запроса на активацию программы Партнером/менеджером кликните по кнопке «Завершить регистрацию», приложение готово к использованию. - -При желании изменить ID магазина, необходимо нажать на кнопку Меню (верхний правый угол экрана) и выбрать ""Выход"". -'''), - "usage_guide": MessageLookupByLibrary.simpleMessage(''' -Шаг 1: - -Запустите приложение для сканирования карты участника системы лояльности. - -При успешном сканировании на вашем экране появятся данные покупателя. - -Шаг 2: - -Введите сумму покупки данного покупателя и нажмите на кнопку «Проведение покупки». - -Во всплывающем окне нажмите ""ДА"", для подтверждения суммы покупки - -Если вы хотите поправить сумму, нажмите «НЕТ» и Вы вернетесь на экран покупки и сможете её скорректировать. -'''), - "support_guide": MessageLookupByLibrary.simpleMessage(''' -Рекомендуйте покупателям установить мобильное приложение дисконтной системы и получайте новых лояльных покупателей. - -При некорректной работе приложения просьба сразу обратиться по телефону нашей технической поддержки. - -Телефон:\n%s\n -Наш сайт:\n%s -'''), - "common_guide": MessageLookupByLibrary.simpleMessage(''' - Для эффективного считывания штрих-кода карты участника системы лояльности необходимо камеру сканера поднести так, чтобы в неё не попадали вертикальные полосы рамки (если они есть). Они расцениваются сканером как часть штрих-кода. -''') - }; -} diff --git a/lib/i18n/messages_ua.dart b/lib/i18n/messages_ua.dart deleted file mode 100644 index 9e956d3..0000000 --- a/lib/i18n/messages_ua.dart +++ /dev/null @@ -1,114 +0,0 @@ -// DO NOT EDIT. This is code generated via package:intl/generate_localized.dart -// This is a library that provides messages for a messages_ua locale. All the -// messages from the main program should be duplicated here with the same -// function name. - -import 'package:intl/intl.dart'; -import 'package:intl/message_lookup_by_library.dart'; - -final messages = new MessageLookup(); - -final _keepAnalysisHappy = Intl.defaultLocale; - -class MessageLookup extends MessageLookupByLibrary { - get localeName => 'messages_ua'; - - final messages = _notInlinedMessages(_notInlinedMessages); - static _notInlinedMessages(_) => { - "ID_Store" : MessageLookupByLibrary.simpleMessage("ID магазину"), - "ID_not_found" : MessageLookupByLibrary.simpleMessage("Ідентифікатор %s не знайден"), - "app_activ" : MessageLookupByLibrary.simpleMessage("Додаток активований"), - "ask_change_store" : MessageLookupByLibrary.simpleMessage("Ви дійсно хочете вийти і ввести інший номер магазину"), - "buyer" : MessageLookupByLibrary.simpleMessage("Покупець"), - "card" : MessageLookupByLibrary.simpleMessage("Карта"), - "card_scaner" : MessageLookupByLibrary.simpleMessage("Сканер карти"), - "carry_purchase" : MessageLookupByLibrary.simpleMessage("Проведення покупки"), - "complite_activ" : MessageLookupByLibrary.simpleMessage("Завершити реєстрацію"), - "complite_purchase" : MessageLookupByLibrary.simpleMessage("Завершити купівлю"), - "confirm_purchase" : MessageLookupByLibrary.simpleMessage("Ви підтверджуєте покупку на %s %s"), - "confirmation" : MessageLookupByLibrary.simpleMessage("Підтвердження"), - "no" : MessageLookupByLibrary.simpleMessage("Ні"), - "purchase_complite" : MessageLookupByLibrary.simpleMessage("Купівля на суму %s %s проведена"), - "registration" : MessageLookupByLibrary.simpleMessage("Реєстрація"), - "usage" : MessageLookupByLibrary.simpleMessage("Використання"), - "support" : MessageLookupByLibrary.simpleMessage("Контакти підтримки"), - "common" : MessageLookupByLibrary.simpleMessage("Загальна інформація"), - "request_sent_wait_activ" : MessageLookupByLibrary.simpleMessage("Запит на активацію додатку відправлений, дочекайтеся підтвердження активації адміністратором"), - "reward" : MessageLookupByLibrary.simpleMessage("Винагорода"), - "bonus" : MessageLookupByLibrary.simpleMessage("Бонусів на рахунку"), - "discount_rate" : MessageLookupByLibrary.simpleMessage("Відсоток знижки"), - "discount_sum" : MessageLookupByLibrary.simpleMessage("Сума знижки"), - "bonus_plus" : MessageLookupByLibrary.simpleMessage("Бонусів нараховано"), - "bonus_minus" : MessageLookupByLibrary.simpleMessage("Бонусів списано"), - "bonus_hint" : MessageLookupByLibrary.simpleMessage("Скільки балів списати?"), - "coupons_used" : MessageLookupByLibrary.simpleMessage("Були погашені купони"), - "bonus_explanation" : MessageLookupByLibrary.simpleMessage("Якщо не вказано скільки балів списати, бали будуть нараховані"), - "scan" : MessageLookupByLibrary.simpleMessage("Сканувати"), - "sign_up" : MessageLookupByLibrary.simpleMessage("Зареєструватися"), - "specify_din_store" : MessageLookupByLibrary.simpleMessage("Необхідно вказати ID магазину"), - "sum" : MessageLookupByLibrary.simpleMessage("Сума"), - "update_activ_status" : MessageLookupByLibrary.simpleMessage("Оновити статус активації"), - "yes" : MessageLookupByLibrary.simpleMessage("Так"), - "settings" : MessageLookupByLibrary.simpleMessage("Налаштування"), - "help" : MessageLookupByLibrary.simpleMessage("Допомога"), - "exit" : MessageLookupByLibrary.simpleMessage("Вихід"), - "logout" : MessageLookupByLibrary.simpleMessage("Log Out"), - "currency" : MessageLookupByLibrary.simpleMessage("Валюта"), - "locale" : MessageLookupByLibrary.simpleMessage("Мова"), - "nominative_ruble": MessageLookupByLibrary.simpleMessage("Рубль"), - "singular_ruble": MessageLookupByLibrary.simpleMessage("Рубль"), - "plural_ruble": MessageLookupByLibrary.simpleMessage("Рубль"), - "nominative_dollar": MessageLookupByLibrary.simpleMessage("Доллар США"), - "singular_dollar": MessageLookupByLibrary.simpleMessage("Доллар США"), - "plural_dollar": MessageLookupByLibrary.simpleMessage("Доллар США"), - "nominative_hryvna": MessageLookupByLibrary.simpleMessage("Гривня"), - "singular_hryvna": MessageLookupByLibrary.simpleMessage("Гривня"), - "plural_hryvna": MessageLookupByLibrary.simpleMessage("Гривня"), - "nominative_tenge": MessageLookupByLibrary.simpleMessage("Тенге"), - "singular_tenge": MessageLookupByLibrary.simpleMessage("Тенге"), - "plural_tenge": MessageLookupByLibrary.simpleMessage("Тенге"), - "nominative_euro": MessageLookupByLibrary.simpleMessage("Євро"), - "singular_euro": MessageLookupByLibrary.simpleMessage("Євро"), - "plural_euro": MessageLookupByLibrary.simpleMessage("Євро"), - "registration_guide": MessageLookupByLibrary.simpleMessage(''' -Після запуску програми ви опинитеся на сторінці реєстрації магазина. - -Введіть DIN код магазину (видається при підключенні до системи лояльності) - -Натисніть на кнопку «Зареєструвати» -Дочекайтеся підтвердження активації програми, натисканням на кнопку «Оновлення статус активації» поновіть статус. -     -Після підтвердження запиту на активацію програми Партнером / менеджером клікніть по кнопці «Завершити реєстрацію», додаток готове до використання. - -При бажанні змінити номер каси, необхідно натиснути на кнопку Меню (верхній правий кут екрану) і вибрати "Вихід". -'''), - "usage_guide": MessageLookupByLibrary.simpleMessage(''' -Крок 1: -     -При пред'явленні покупцем картки учасника системи лояльності, запустіть цю програму. - -На екрані з'явиться сканер штрих кодів. Відскануте штрих-код карти сканером. - -При успішному скануванні на вашому екрані з'являться дані покупця. -     -Крок 2: -     -Необхідно ввести суму покупки даного покупця і клікнути на кнопку «Проведення покупки». - -Спливе вікно підтвердження правильності введення суми. У разі правильного введення суми, натисніть «ТАК», сума буде проведена і винагороду буде нараховано учаснику системи лояльності. - -Якщо сума введена з помилкою, натисніть «НІ» і Ви повернетеся на крок введення суми і зможете її скорегувати. -'''), - "support_guide": MessageLookupByLibrary.simpleMessage(''' -Рекомендуйте покупцям встановити мобільний додаток дисконтної системи і отримуйте нових лояльних покупців. - -При некоректній роботі програми прохання відразу звернутися за телефоном нашої технічної підтримки. - -Телефон:\n%s\n -Наш сайт:\n%s -'''), - "common_guide": MessageLookupByLibrary.simpleMessage(''' -Для ефективного зчитування штрих-коду карти учасника системи лояльності необхідно камеру сканера піднести так, щоб в неї не потрапляли вертикальні смуги рамки. Вони розцінюються сканером як частина штрих-коду. -''') - }; -} diff --git a/lib/main.dart b/lib/main.dart index 1281b64..c0dd821 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,16 +1,9 @@ import 'package:flutter/material.dart'; import 'package:checker/screens/splash.dart'; -import 'package:checker/consts.dart'; import 'package:flutter/services.dart'; const platform = const MethodChannel('com.dinect.checker/instance_id'); -/// Точка входа в приложение. - - -/// -/// some changes - void main() { platform.invokeMethod('getAppTitle').then((title) { runApp(new Checker(appName: title)); @@ -22,7 +15,6 @@ class Checker extends StatelessWidget { final String appName; @override Widget build (BuildContext context) { - print('app name = ${appName}'); return new MaterialApp( title: appName, home: new SplashScreen() diff --git a/lib/network.dart b/lib/network.dart index 0def3df..5a30c58 100644 --- a/lib/network.dart +++ b/lib/network.dart @@ -1,6 +1,5 @@ -import 'package:checker/db.dart'; +import 'package:checker/strings.dart'; import 'package:flutter/services.dart'; -import 'package:intl/intl.dart'; import 'common.dart'; @@ -14,7 +13,7 @@ getCreateTokenRequest(Map httpBody) async { return httpClient.post( await getEndpoint() + 'tokens/?_dmapptoken=' + await getToken(), body: httpBody, - headers: {'Accept-Language': Intl.defaultLocale}); + headers: {'Accept-Language': StringsLocalization.localeCode}); } // Проверка статуса токена. В ответе приходит параметр active, который может быть либо true, либо false,. @@ -25,21 +24,21 @@ getCheckTokenStatusRequest(String token) async { token + '?_dmapptoken=' + await getToken(), - headers: {'Accept-Language': Intl.defaultLocale}); + headers: {'Accept-Language': StringsLocalization.localeCode}); } // Удаление токена на сервере. getDeleteTokenRequest(String token) async { return httpClient.delete( await getEndpoint() + 'tokens/' + token + '?_dmapptoken=' + - await getToken(), headers: {'Accept-Language': Intl.defaultLocale}); + await getToken(), headers: {'Accept-Language': StringsLocalization.localeCode}); } getLoyaltyRequest(String endpoint, String token) async { var headers = { 'DM-Authorization': 'dmapptoken ${await getToken()}', - 'Authorization': 'dmtoken ${token}', - 'Accept-Language': Intl.defaultLocale + 'Authorization': 'dmtoken $token', + 'Accept-Language': StringsLocalization.localeCode }; return httpClient.get(endpoint, headers: headers); @@ -49,8 +48,8 @@ getPurchaseRequest(String endpoint, Map body, String token) async { var headers = { 'DM-Authorization': 'dmapptoken ${await getToken()}', - 'Authorization': 'dmtoken ${token}', - 'Accept-Language': Intl.defaultLocale + 'Authorization': 'dmtoken $token', + 'Accept-Language': StringsLocalization.localeCode }; return httpClient.post(endpoint, body: body, headers: headers); @@ -60,8 +59,8 @@ getCouponsRequest(String endpoint, String token) async { var headers = { 'DM-Authorization': 'dmapptoken ${await getToken()}', - 'Authorization': 'dmtoken ${token}', - 'Accept-Language': Intl.defaultLocale + 'Authorization': 'dmtoken $token', + 'Accept-Language': StringsLocalization.localeCode }; print(headers); @@ -73,8 +72,8 @@ getUserByCard(String card, String token) async { var headers = { 'DM-Authorization': 'dmapptoken ${await getToken()}', - 'Authorization': 'dmtoken ${token}', - 'Accept-Language': Intl.defaultLocale + 'Authorization': 'dmtoken $token', + 'Accept-Language': StringsLocalization.localeCode }; @@ -88,8 +87,8 @@ getUserByPhone(String phone, String token) async { var headers = { 'DM-Authorization': 'dmapptoken ${await getToken()}', - 'Authorization': 'dmtoken ${token}', - 'Accept-Language': Intl.defaultLocale + 'Authorization': 'dmtoken $token', + 'Accept-Language': StringsLocalization.localeCode }; diff --git a/lib/screens/finish_registration.dart b/lib/screens/finish_registration.dart index 7919515..a7da747 100644 --- a/lib/screens/finish_registration.dart +++ b/lib/screens/finish_registration.dart @@ -8,8 +8,6 @@ import 'package:checker/db.dart'; import 'package:checker/network.dart'; import 'package:checker/strings.dart'; import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; -import 'package:intl/intl.dart'; class FinishRegistrationScreen extends BaseScreen { diff --git a/lib/screens/languages.dart b/lib/screens/languages.dart index 4f101b9..e7d90c1 100644 --- a/lib/screens/languages.dart +++ b/lib/screens/languages.dart @@ -4,7 +4,6 @@ import 'package:checker/db.dart'; import 'package:flutter/material.dart'; import 'package:checker/strings.dart'; import 'package:checker/common.dart'; -import 'package:intl/intl.dart'; class LanguagesScreen extends BaseScreen { @@ -39,14 +38,13 @@ class LanguagesState extends SettingsBaseState { @override saveOption() async { await helper.saveLocale(languages[selectedItem]); - Intl.defaultLocale = languages[selectedItem]; await StringsLocalization.load(languages[selectedItem]); } @override void getSelectedValue() { setState(() { - selectedItem = getOptions().indexOf(getLocaleTitle(Intl.defaultLocale)); + selectedItem = getOptions().indexOf(getLocaleTitle(StringsLocalization.localeCode)); }); } -} \ No newline at end of file +} diff --git a/lib/screens/purchase.dart b/lib/screens/purchase.dart index 32e0522..29591b0 100644 --- a/lib/screens/purchase.dart +++ b/lib/screens/purchase.dart @@ -274,7 +274,7 @@ class PurchaseScreenState extends BaseState { if (fractionalPart.length > 2) { fractionalPart = fractionalPart.substring(0, 2); } - return '${integerPart}.${fractionalPart}'; + return '$integerPart.$fractionalPart'; } catch (exception) { print(exception); } diff --git a/lib/screens/settings.dart b/lib/screens/settings.dart index 8786c2f..bf966af 100644 --- a/lib/screens/settings.dart +++ b/lib/screens/settings.dart @@ -7,7 +7,6 @@ import 'package:checker/screens/currencies.dart'; import 'package:checker/screens/languages.dart'; import 'package:checker/strings.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; class SettingsScreen extends BaseScreen { @@ -51,7 +50,7 @@ class SettingsState extends BaseState { menuItems[2].title = StringsLocalization.logout(); menuItems[0].selectedValue = info['currency'].toString(); menuItems[1].selectedValue = - info['locale'] == null ? Intl.defaultLocale : info['locale']; + info['locale'] == null ? StringsLocalization.localeCode : info['locale']; menuItems[2].selectedValue = info['token'] == null ? '' : getTokenSuffix(info['token']); }); @@ -84,6 +83,7 @@ class SettingsState extends BaseState { List widgets = new List(); for (int i = 0; i < menuItems.length; i++) { if (menuItems[i].selectedValue.toString() != '') { + print('title : ${menuItems[i].title}'); widgets.add( getSettingsItem(() => onPressed(menuItems.indexOf(menuItems[i])), menuItems[i].title, @@ -98,6 +98,7 @@ class SettingsState extends BaseState { case 0 : return getCurrencyTitle(int.parse(menuItems[position].selectedValue)); case 1 : + print('val : ${menuItems[position].selectedValue}'); return getLocaleTitle(menuItems[position].selectedValue); default : return null; diff --git a/lib/screens/splash.dart b/lib/screens/splash.dart index b007733..41ced61 100644 --- a/lib/screens/splash.dart +++ b/lib/screens/splash.dart @@ -12,7 +12,6 @@ import 'package:checker/screens/registration.dart'; import 'package:checker/strings.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart'; -import 'package:intl/intl.dart'; class SplashScreen extends StatefulWidget { @override @@ -78,7 +77,6 @@ class _SplashScreenState extends BaseState { } void initLocale(String locale, Future onValue()) { - Intl.defaultLocale = locale; StringsLocalization.load(locale).then((_) { onValue(); }); diff --git a/lib/strings.dart b/lib/strings.dart index 9d2cc33..3a0fa47 100644 --- a/lib/strings.dart +++ b/lib/strings.dart @@ -1,18 +1,31 @@ -import 'package:intl/intl.dart'; -import 'i18n/messages_all.dart'; -import 'package:sprintf/sprintf.dart'; import 'dart:async'; +import 'package:sprintf/sprintf.dart'; +import 'package:xml/xml.dart' as xml; +import 'package:flutter/services.dart'; class StringsLocalization { - static Future load(String locale) async { - return initializeMessages(locale); + static String localeCode; + static Map strings = new Map(); + + static Future load(String l) async { + localeCode = l; + var document = xml.parse(await loadStrings(l)); + strings.clear(); + document.findAllElements('string').forEach((node) { + print("${node.attributes} : ${node.text.toString()}"); + strings[node.attributes[0].value] = node.text.toString(); + }); + return strings; } - static String declineCurrency(int num, int code) { + static Future loadStrings(String locale) async { + return await rootBundle.loadString('assets/values-$locale/strings.xml'); + } + static String declineCurrency(int num, int code) { int residual = num % 100; - if (residual >= 20) { + if (residual >= 20) { residual %= 10; } @@ -31,7 +44,6 @@ class StringsLocalization { } static List currencies(int code) { - String nominative, singular, plural; switch (code) { @@ -62,88 +74,76 @@ class StringsLocalization { break; } - return [nominative, singular, plural]; } static String confirmPurchase(String val, int code) { - String trimmedVal =val.substring(0, val.length - 3); - return sprintf(Intl.message('confirm_purchase', name: 'confirm_purchase', locale: Intl.defaultLocale), [val, declineCurrency(int.parse(trimmedVal), code)]); + String trimmedVal = val.substring(0, val.length - 3); + return sprintf(strings['confirm_purchase'], [val, declineCurrency(int.parse(trimmedVal), code)]); } static String purchaseCompleted(String val, int code) { - String trimmedVal =val.substring(0, val.length - 3); - return sprintf(Intl.message('purchase_complite', name: 'purchase_complite', locale: Intl.defaultLocale), [val, declineCurrency(int.parse(trimmedVal), code)]); + String trimmedVal = val.substring(0, val.length - 3); + return sprintf(strings['purchase_complite'], [val, declineCurrency(int.parse(trimmedVal), code)]); } - static String registration() => Intl.message('registration', name: 'registration', locale: Intl.defaultLocale); - static String usage() => Intl.message('usage', name: 'usage', locale: Intl.defaultLocale); - static String support() => Intl.message('support', name: 'support', locale: Intl.defaultLocale); - static String common() => Intl.message('common', name: 'common', locale: Intl.defaultLocale); - static String idStore() => Intl.message('ID_Store', name: 'ID_Store', locale: Intl.defaultLocale); - static String signUp() => Intl.message('sign_up', name: 'sign_up', locale: Intl.defaultLocale); - static String specifyDinStore() => Intl.message('specify_din_store', name: 'specify_din_store', locale: Intl.defaultLocale); - static String confirmation() => Intl.message('confirmation', name: 'confirmation', locale: Intl.defaultLocale); - static String askChangeStore() => Intl.message('ask_change_store', name: 'ask_change_store', locale: Intl.defaultLocale); - static String yes() => Intl.message('yes', name: 'yes', locale: Intl.defaultLocale); - static String no() => Intl.message('no', name: 'no', locale: Intl.defaultLocale); - static String requestSentWaitActivation() => Intl.message('request_sent_wait_activ', name: 'request_sent_wait_activ', locale: Intl.defaultLocale); - static String refreshActivationStatus() => Intl.message('update_activ_status', name: 'update_activ_status', locale: Intl.defaultLocale); - static String appActivated() => Intl.message('app_activ', name: 'app_activ', locale: Intl.defaultLocale); - static String completeRegistration() => Intl.message('complite_activ', name: 'complite_activ', locale: Intl.defaultLocale); - static String cardScanner() => Intl.message('card_scaner', name: 'card_scaner', locale: Intl.defaultLocale); - static String card() => Intl.message('card', name: 'card', locale: Intl.defaultLocale); - static String reward() => Intl.message('reward', name: 'reward', locale: Intl.defaultLocale); - static String sum() => Intl.message('sum', name: 'sum', locale: Intl.defaultLocale); - static String bonus() => Intl.message('bonus', name: 'bonus', locale: Intl.defaultLocale); - static String couponsUsed() => Intl.message('coupons_used', name: 'coupons_used', locale: Intl.defaultLocale); - static String selectCoupons() => Intl.message('select_coupons', name: 'select_coupons', locale: Intl.defaultLocale); - static String carryingPurchase() => Intl.message('carry_purchase', name: 'carry_purchase', locale: Intl.defaultLocale); - static String completePurchase() => Intl.message('complite_purchase', name: 'complite_purchase', locale: Intl.defaultLocale); - static String scan() => Intl.message('scan', name: 'scan', locale: Intl.defaultLocale); - static String buyer() => Intl.message('buyer', name: 'buyer', locale: Intl.defaultLocale); - static String bonusHint() => Intl.message('bonus_hint', name: 'bonus_hint', locale: Intl.defaultLocale); - static String bonusExplanation() => Intl.message('bonus_explanation', name: 'bonus_explanation', locale: Intl.defaultLocale); - static String discountRate() => Intl.message('discount_rate', name: 'discount_rate', locale: Intl.defaultLocale); - static String discountSum() => Intl.message('discount_sum', name: 'discount_sum', locale: Intl.defaultLocale); - static String bonusPlus() => Intl.message('bonus_plus', name: 'bonus_plus', locale: Intl.defaultLocale); - static String bonusMinus() => Intl.message('bonus_minus', name: 'bonus_minus', locale: Intl.defaultLocale); - static String idNotFound() => Intl.message('ID_not_found', name: 'ID_not_found', locale: Intl.defaultLocale); - static String settings() => Intl.message('settings', name: 'settings', locale: Intl.defaultLocale); - static String help() => Intl.message('help', name: 'help', locale: Intl.defaultLocale); - static String exit() => Intl.message('exit', name: 'exit', locale: Intl.defaultLocale); - static String logout() => Intl.message('logout', name: 'logout', locale: Intl.defaultLocale); - static String currency() => Intl.message('currency', name: 'currency', locale: Intl.defaultLocale); - static String locale() => Intl.message('locale', name: 'locale', locale: Intl.defaultLocale); - - // Валюты - static String nominativeRuble() => Intl.message('nominative_ruble', name: 'nominative_ruble', locale: Intl.defaultLocale); - static String singularRuble() => Intl.message('singular_ruble', name: 'singular_ruble', locale: Intl.defaultLocale); - static String pluralRuble() => Intl.message('plural_ruble', name: 'plural_ruble', locale: Intl.defaultLocale); - - static String nominativeEuro() => Intl.message('nominative_euro', name: 'nominative_euro', locale: Intl.defaultLocale); - static String singularEuro() => Intl.message('singular_euro', name: 'singular_euro', locale: Intl.defaultLocale); - static String pluralEuro() => Intl.message('plural_euro', name: 'plural_euro', locale: Intl.defaultLocale); - - - static String nominativeDollar() => Intl.message('nominative_dollar', name: 'nominative_dollar', locale: Intl.defaultLocale); - static String singularDollar() => Intl.message('singular_dollar', name: 'singular_dollar', locale: Intl.defaultLocale); - static String pluralDollar() => Intl.message('plural_dollar', name: 'plural_dollar', locale: Intl.defaultLocale); - - static String nominativeHryvna() => Intl.message('nominative_hryvna', name: 'nominative_hryvna', locale: Intl.defaultLocale); - static String singularHryvna() => Intl.message('singular_hryvna', name: 'singular_hryvna', locale: Intl.defaultLocale); - static String pluralHryvna() => Intl.message('plural_hryvna', name: 'plural_hryvna', locale: Intl.defaultLocale); - - static String nominativeTenge() => Intl.message('nominative_tenge', name: 'nominative_tenge', locale: Intl.defaultLocale); - static String singularTenge() => Intl.message('singular_tenge', name: 'singular_tenge', locale: Intl.defaultLocale); - static String pluralTenge() => Intl.message('plural_tenge', name: 'plural_tenge', locale: Intl.defaultLocale); - - static String registrationGuide() => Intl.message('registration_guide', name: 'registration_guide', locale: Intl.defaultLocale); - static String usageGuide() => Intl.message('usage_guide', name: 'usage_guide', locale: Intl.defaultLocale); - static String commonGuide() => Intl.message('common_guide', name: 'common_guide', locale: Intl.defaultLocale); - - static String supportGuide(String phone, String url) { - return sprintf(Intl.message('support_guide', name: 'support_guide', locale: Intl.defaultLocale), [phone, url]); - } + static String registration() => strings['registration']; + static String usage() => strings['usage']; + static String support() => strings['support']; + static String common() => strings['common']; + static String idStore() => strings['ID_Store']; + static String signUp() => strings['sign_up']; + static String specifyDinStore() => strings['specify_din_store']; + static String confirmation() => strings['confirmation']; + static String askChangeStore() => strings['ask_change_store']; + static String yes() => strings['yes']; + static String no() => strings['no']; + static String requestSentWaitActivation() => strings['request_sent_wait_activ']; + static String refreshActivationStatus() => strings['update_activ_status']; + static String appActivated() => strings['app_activ']; + static String completeRegistration() => strings['complite_activ']; + static String cardScanner() => strings['card_scaner']; + static String card() => strings['card']; + static String reward() => strings['reward']; + static String sum() => strings['sum']; + static String bonus() => strings['bonus']; + static String couponsUsed() => strings['coupons_used']; + static String selectCoupons() => strings['select_coupons']; + static String carryingPurchase() => strings['carry_purchase']; + static String completePurchase() => strings['complite_purchase']; + static String scan() => strings['scan']; + static String buyer() => strings['buyer']; + static String bonusHint() => strings['bonus_hint']; + static String bonusExplanation() => strings['bonus_explanation']; + static String discountRate() => strings['discount_rate']; + static String discountSum() => strings['discount_sum']; + static String bonusPlus() => strings['bonus_plus']; + static String bonusMinus() => strings['bonus_minus']; + static String idNotFound() => strings['ID_not_found']; + static String settings() => strings['settings']; + static String help() => strings['help']; + static String exit() => strings['exit']; + static String logout() => strings['logout']; + static String currency() => strings['currency']; + static String locale() => strings['locale']; + static String nominativeRuble() => strings['nominative_ruble']; + static String singularRuble() => strings['singular_ruble']; + static String pluralRuble() => strings['plural_ruble']; + static String nominativeEuro() => strings['nominative_euro']; + static String singularEuro() => strings['singular_euro']; + static String pluralEuro() => strings['plural_euro']; + static String nominativeDollar() => strings['nominative_dollar']; + static String singularDollar() => strings['singular_dollar']; + static String pluralDollar() => strings['plural_dollar']; + static String nominativeHryvna() => strings['nominative_hryvna']; + static String singularHryvna() => strings['singular_hryvna']; + static String pluralHryvna() => strings['plural_hryvna']; + static String nominativeTenge() => strings['nominative_tenge']; + static String singularTenge() => strings['singular_tenge']; + static String pluralTenge() => strings['plural_tenge']; + static String registrationGuide() => strings['registration_guide']; + static String usageGuide() => strings['usage_guide']; + static String commonGuide() => strings['common_guide'].replaceAll('\n', "\n"); + static String supportGuide(String phone, String url) => sprintf(strings['support_guide'], [phone, url]); } diff --git a/pubspec.lock b/pubspec.lock index da40990..709b1c3 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1,20 +1,6 @@ # Generated by pub # See http://pub.dartlang.org/doc/glossary.html#lockfile packages: - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "0.30.0+4" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.7" async: dependency: transitive description: @@ -22,13 +8,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.3" - barback: - dependency: transitive - description: - name: barback - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.2+14" charcode: dependency: transitive description: @@ -36,13 +15,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" - cli_util: - dependency: transitive - description: - name: cli_util - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.2+1" collection: dependency: transitive description: @@ -50,60 +22,11 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.14.5" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.1" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2+1" - csslib: - dependency: transitive - description: - name: csslib - url: "https://pub.dartlang.org" - source: hosted - version: "0.14.1" - dart_style: - dependency: transitive - description: - name: dart_style - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.9+1" flutter: dependency: "direct main" description: flutter source: sdk version: "0.0.0" - front_end: - dependency: transitive - description: - name: front_end - url: "https://pub.dartlang.org" - source: hosted - version: "0.1.0-alpha.4.1" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.5" - html: - dependency: transitive - description: - name: html - url: "https://pub.dartlang.org" - source: hosted - version: "0.13.2+2" http: dependency: "direct main" description: @@ -125,41 +48,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "0.1.5" - intl: - dependency: "direct main" - description: - name: intl - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.2" - intl_translation: - dependency: "direct main" - description: - name: intl_translation - url: "https://pub.dartlang.org" - source: hosted - version: "0.15.0" - isolate: - dependency: transitive - description: - name: isolate - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" - kernel: - dependency: transitive - description: - name: kernel - url: "https://pub.dartlang.org" - source: hosted - version: "0.3.0-alpha.1.1" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "0.11.3+1" matcher: dependency: transitive description: @@ -174,13 +62,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.1" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.3" path: dependency: transitive description: @@ -202,20 +83,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.7.0" - plugin: - dependency: transitive - description: - name: plugin - url: "https://pub.dartlang.org" - source: hosted - version: "0.2.0+2" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.4" sky_engine: dependency: transitive description: flutter @@ -241,7 +108,7 @@ packages: name: sqflite url: "https://pub.dartlang.org" source: hosted - version: "0.6.2+1" + version: "0.6.2+2" stack_trace: dependency: transitive description: @@ -270,13 +137,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.4" - utf: - dependency: transitive - description: - name: utf - url: "https://pub.dartlang.org" - source: hosted - version: "0.9.0+3" vector_math: dependency: transitive description: @@ -284,19 +144,12 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.5" - watcher: - dependency: transitive + xml: + dependency: "direct main" description: - name: watcher + name: xml url: "https://pub.dartlang.org" source: hosted - version: "0.9.7+6" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.13" + version: "2.6.0" sdks: dart: ">=2.0.0-dev.15.0 <=2.0.0-dev.19.0" diff --git a/pubspec.yaml b/pubspec.yaml index 357839f..39ea140 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,12 +3,11 @@ description: A new Flutter project. dependencies: http: '>=0.11.3+12' - intl: '>=0.14.0 <0.16.0' - intl_translation: '>=0.14.0 <0.16.0' sprintf: "^3.0.2" path_provider: "^0.2.1+1" sqflite: any image_picker: '^0.1.3' # use for ask permissions @ iOS + xml: "^2.6.0" flutter: sdk: flutter @@ -46,6 +45,10 @@ flutter: - assets/powered_by_dinect_splash.png - assets/powered_by_dinect.png - assets/splash_text.png + - assets/values-ru/strings.xml + - assets/values-ua/strings.xml + - assets/values-en/strings.xml + - assets/values-es/strings.xml # To add assets from package dependencies, first ensure the asset # is in the lib/ directory of the dependency. Then,