From 3a638f246b70ec550432744bae30dd3e24e8a195 Mon Sep 17 00:00:00 2001 From: Luca Fluri Date: Fri, 17 Jul 2020 02:00:22 +0200 Subject: [PATCH] chore: :rocket: version bump --- android/app/build.gradle | 2 +- lib/screens/settings/settings_controller.dart | 172 +++++++++--------- pubspec.yaml | 2 +- utils/androidBumpScript.py | 4 +- 4 files changed, 90 insertions(+), 90 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index 01fd57d..fcec234 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -13,7 +13,7 @@ if (flutterRoot == null) { def flutterVersionCode = localProperties.getProperty('flutter.versionCode') if (flutterVersionCode == null) { - flutterVersionCode = '8' + flutterVersionCode = '9' } def flutterVersionName = localProperties.getProperty('flutter.versionName') diff --git a/lib/screens/settings/settings_controller.dart b/lib/screens/settings/settings_controller.dart index 6d46a83..4abf0a0 100644 --- a/lib/screens/settings/settings_controller.dart +++ b/lib/screens/settings/settings_controller.dart @@ -1,86 +1,86 @@ -import 'package:adaptive_dialog/adaptive_dialog.dart'; -import 'package:flutter/widgets.dart'; -import 'package:price_tracker/models/product.dart'; -import 'package:price_tracker/screens/settings/settings.dart'; -import 'package:price_tracker/services/backup.dart'; -import 'package:price_tracker/services/database.dart'; -import 'package:price_tracker/services/init.dart'; -import 'package:price_tracker/services/product_utils.dart'; -import 'package:toast/toast.dart'; -import 'package:workmanager/workmanager.dart'; - -class Settings extends State { - static const String VERSION = "0.1.4"; - static const String APP_NAME = "Price Tracker BETA"; - - Product testProduct = Product.fromMap({ - "_id": 0, - "name": - "Apple iPad (10.2-inch, WiFi, 32GB) - Gold (latest model) - with extra dolphins", - "productUrl": "testUrl.com", - "prices": "[-1.0, 269.0, 260.0]", - "dates": - "[2020-07-02 00:00:00.000, 2020-07-03 15:43:12.345, 2020-07-04 04:00:45.000]", - "targetPrice": "261.0", - "imageUrl": "", - "parseSuccess": "true", - }); - - showToast(String text, {int sec = 2}) => - Toast.show(text, context, duration: sec); - - clearDB() async { - OkCancelResult result = await showOkCancelAlertDialog( - context: context, - title: "Do you really want to empty the database?", - message: "All tracked products will be lost without a backup", - okLabel: "Clear DB", - barrierDismissible: true, - isDestructiveAction: true, - ); - if (result == OkCancelResult.ok) { - DatabaseService _db = await DatabaseService.getInstance(); - if (await _db.deleteAll() > 0) { - showToast("Database cleared!"); - navigatorKey.currentState - .pushNamedAndRemoveUntil("/", (route) => false); - } else - showToast("Database already empty"); - } - } - - backup() async { - if (await BackupService.instance.backup()) - showToast("Backup file saved"); - else - showToast("Error saving backup file"); - } - - restore() async { - if (await BackupService.instance.restore()) { - showToast("Products loaded from backup"); - navigatorKey.currentState.pushNamedAndRemoveUntil("/", (route) => false); - } else - showToast("Error reading backup file"); - } - - void testPriceFallNotification() { - sendPriceFallNotification(testProduct); - } - - void testUnderTargetNotification() { - sendUnderTargetNotification(testProduct); - } - - void testAvailableAgainNotification() { - sendAvailableAgainNotification(testProduct); - } - - void testBackgroundService() { - Workmanager.registerOneOffTask( - "manualPriceScraping", "Manual Price Tracker Scraper"); - } - - @override - Widget build(BuildContext context) => SettingsScreenView(this); -} +import 'package:adaptive_dialog/adaptive_dialog.dart'; +import 'package:flutter/widgets.dart'; +import 'package:price_tracker/models/product.dart'; +import 'package:price_tracker/screens/settings/settings.dart'; +import 'package:price_tracker/services/backup.dart'; +import 'package:price_tracker/services/database.dart'; +import 'package:price_tracker/services/init.dart'; +import 'package:price_tracker/services/product_utils.dart'; +import 'package:toast/toast.dart'; +import 'package:workmanager/workmanager.dart'; + +class Settings extends State { + static const String VERSION = "0.1.5"; + static const String APP_NAME = "Price Tracker BETA"; + + Product testProduct = Product.fromMap({ + "_id": 0, + "name": + "Apple iPad (10.2-inch, WiFi, 32GB) - Gold (latest model) - with extra dolphins", + "productUrl": "testUrl.com", + "prices": "[-1.0, 269.0, 260.0]", + "dates": + "[2020-07-02 00:00:00.000, 2020-07-03 15:43:12.345, 2020-07-04 04:00:45.000]", + "targetPrice": "261.0", + "imageUrl": "", + "parseSuccess": "true", + }); + + showToast(String text, {int sec = 2}) => + Toast.show(text, context, duration: sec); + + clearDB() async { + OkCancelResult result = await showOkCancelAlertDialog( + context: context, + title: "Do you really want to empty the database?", + message: "All tracked products will be lost without a backup", + okLabel: "Clear DB", + barrierDismissible: true, + isDestructiveAction: true, + ); + if (result == OkCancelResult.ok) { + DatabaseService _db = await DatabaseService.getInstance(); + if (await _db.deleteAll() > 0) { + showToast("Database cleared!"); + navigatorKey.currentState + .pushNamedAndRemoveUntil("/", (route) => false); + } else + showToast("Database already empty"); + } + } + + backup() async { + if (await BackupService.instance.backup()) + showToast("Backup file saved"); + else + showToast("Error saving backup file"); + } + + restore() async { + if (await BackupService.instance.restore()) { + showToast("Products loaded from backup"); + navigatorKey.currentState.pushNamedAndRemoveUntil("/", (route) => false); + } else + showToast("Error reading backup file"); + } + + void testPriceFallNotification() { + sendPriceFallNotification(testProduct); + } + + void testUnderTargetNotification() { + sendUnderTargetNotification(testProduct); + } + + void testAvailableAgainNotification() { + sendAvailableAgainNotification(testProduct); + } + + void testBackgroundService() { + Workmanager.registerOneOffTask( + "manualPriceScraping", "Manual Price Tracker Scraper"); + } + + @override + Widget build(BuildContext context) => SettingsScreenView(this); +} diff --git a/pubspec.yaml b/pubspec.yaml index 7713a29..f70d8dd 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 0.1.4 +version: 0.1.5 environment: sdk: ">=2.7.0 <3.0.0" diff --git a/utils/androidBumpScript.py b/utils/androidBumpScript.py index af5f66e..f8ddaa8 100644 --- a/utils/androidBumpScript.py +++ b/utils/androidBumpScript.py @@ -1,8 +1,8 @@ import re import subprocess -VERSION = '0.1.4' -FLUTTER_VERSION_CODE = '8' +VERSION = '0.1.5' +FLUTTER_VERSION_CODE = '9' PROJECT_ROOT = "../"