Skip to content

Commit

Permalink
chore: 🚀 version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
lucafluri committed Jul 17, 2020
1 parent 684f553 commit 3a638f2
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 90 deletions.
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
172 changes: 86 additions & 86 deletions lib/screens/settings/settings_controller.dart
Original file line number Diff line number Diff line change
@@ -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<SettingsScreen> {
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<SettingsScreen> {
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);
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions utils/androidBumpScript.py
Original file line number Diff line number Diff line change
@@ -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 = "../"

Expand Down

0 comments on commit 3a638f2

Please sign in to comment.