Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Google Drive support + Bug fixing + Web app fixes #170

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 33
compileSdkVersion 34
ndkVersion flutter.ndkVersion

compileOptions {
Expand Down
2 changes: 1 addition & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '12.0'
platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
85 changes: 51 additions & 34 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
PODS:
- AppAuth (1.7.5):
- AppAuth/Core (= 1.7.5)
- AppAuth/ExternalUserAgent (= 1.7.5)
- AppAuth/Core (1.7.5)
- AppAuth/ExternalUserAgent (1.7.5):
- AppAuth/Core
- Flutter (1.0.0)
- flutter_local_notifications (0.0.1):
- Flutter
- flutter_native_splash (0.0.1):
- Flutter
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- google_sign_in_ios (0.0.1):
- AppAuth (>= 1.7.4)
- Flutter
- FlutterMacOS
- GoogleSignIn (~> 7.1)
- GTMSessionFetcher (>= 3.4.0)
- GoogleSignIn (7.1.0):
- AppAuth (< 2.0, >= 1.7.3)
- GTMAppAuth (< 5.0, >= 4.1.1)
- GTMSessionFetcher/Core (~> 3.3)
- GTMAppAuth (4.1.1):
- AppAuth/Core (~> 1.7)
- GTMSessionFetcher/Core (< 4.0, >= 3.3)
- GTMSessionFetcher (3.5.0):
- GTMSessionFetcher/Full (= 3.5.0)
- GTMSessionFetcher/Core (3.5.0)
- GTMSessionFetcher/Full (3.5.0):
- GTMSessionFetcher/Core
- path_provider_foundation (0.0.1):
- Flutter
- FlutterMacOS
- permission_handler_apple (9.3.0):
- Flutter
- shared_preferences_foundation (0.0.1):
- Flutter
- FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
- sqlite3 (3.44.0):
- sqlite3/common (= 3.44.0)
- sqlite3/common (3.44.0)
- sqlite3/fts5 (3.44.0):
- sqlite3/common
- sqlite3/perf-threadsafe (3.44.0):
- sqlite3/common
- sqlite3/rtree (3.44.0):
- sqlite3/common
- sqlite3_flutter_libs (0.0.1):
- Flutter
- sqlite3 (~> 3.44.0)
- sqlite3/fts5
- sqlite3/perf-threadsafe
- sqlite3/rtree
- FlutterMacOS
- url_launcher_ios (0.0.1):
- Flutter
- workmanager (0.0.1):
Expand All @@ -39,17 +48,20 @@ DEPENDENCIES:
- Flutter (from `Flutter`)
- flutter_local_notifications (from `.symlinks/plugins/flutter_local_notifications/ios`)
- flutter_native_splash (from `.symlinks/plugins/flutter_native_splash/ios`)
- google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`)
- path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`)
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- sqlite3_flutter_libs (from `.symlinks/plugins/sqlite3_flutter_libs/ios`)
- sqflite (from `.symlinks/plugins/sqflite/darwin`)
- url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
- workmanager (from `.symlinks/plugins/workmanager/ios`)

SPEC REPOS:
trunk:
- FMDB
- sqlite3
- AppAuth
- GoogleSignIn
- GTMAppAuth
- GTMSessionFetcher

EXTERNAL SOURCES:
Flutter:
Expand All @@ -58,32 +70,37 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/flutter_local_notifications/ios"
flutter_native_splash:
:path: ".symlinks/plugins/flutter_native_splash/ios"
google_sign_in_ios:
:path: ".symlinks/plugins/google_sign_in_ios/darwin"
path_provider_foundation:
:path: ".symlinks/plugins/path_provider_foundation/darwin"
permission_handler_apple:
:path: ".symlinks/plugins/permission_handler_apple/ios"
shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
sqlite3_flutter_libs:
:path: ".symlinks/plugins/sqlite3_flutter_libs/ios"
:path: ".symlinks/plugins/sqflite/darwin"
url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios"
workmanager:
:path: ".symlinks/plugins/workmanager/ios"

SPEC CHECKSUMS:
AppAuth: 501c04eda8a8d11f179dbe8637b7a91bb7e5d2fa
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
flutter_local_notifications: 4cde75091f6327eb8517fa068a0a5950212d2086
flutter_native_splash: 52501b97d1c0a5f898d687f1646226c1f93c56ef
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
flutter_native_splash: edf599c81f74d093a4daf8e17bd7a018854bc778
google_sign_in_ios: 07375bfbf2620bc93a602c0e27160d6afc6ead38
GoogleSignIn: d4281ab6cf21542b1cfaff85c191f230b399d2db
GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de
GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6
path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46
permission_handler_apple: 9878588469a2b0d0fc1e048d9f43605f92e6cec2
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
sqlite3: 6e2d4a4879854d0ec86b476bf3c3e30870bac273
sqlite3_flutter_libs: eb769059df0356dc52ddda040f09cacc9391a7cf
url_launcher_ios: 68d46cc9766d0c41dbdc884310529557e3cd7a86
shared_preferences_foundation: fcdcbc04712aee1108ac7fda236f363274528f78
sqflite: 673a0e54cc04b7d6dba8d24fb8095b31c3a99eec
url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
workmanager: 0afdcf5628bbde6924c21af7836fed07b42e30e6

PODFILE CHECKSUM: 819463e6a0290f5a72f145ba7cde16e8b6ef0796
PODFILE CHECKSUM: 7be2f5f74864d463a8ad433546ed1de7e0f29aef

COCOAPODS: 1.15.2
16 changes: 16 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,21 @@
<true/>
<key>UIStatusBarHidden</key>
<false/>
<!-- Google Sign-in Section -->
<key>GIDClientID</key>
<string>228827034667-iic4ese3m78q7enpiv8p9oqma7qknoof.apps.googleusercontent.com</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLSchemes</key>
<array>
<!-- TODO Replace this value: -->
<string>com.googleusercontent.apps.228827034667-iic4ese3m78q7enpiv8p9oqma7qknoof</string>
</array>
</dict>
</array>
<!-- End of the Google Sign-in Section -->
</dict>
</plist>
11 changes: 5 additions & 6 deletions lib/custom_widgets/account_modal.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:ui';

import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
Expand Down Expand Up @@ -62,7 +61,7 @@ class AccountDialog extends ConsumerWidget with Functions {
padding: EdgeInsets.all(8.0),
),
LineChartWidget(
lineData: [
lineData: const [
FlSpot(0, 3),
FlSpot(1, 1.3),
FlSpot(2, -2),
Expand All @@ -81,10 +80,10 @@ class AccountDialog extends ConsumerWidget with Functions {
FlSpot(15, -4.5),
FlSpot(16, 2.5),
],
lineColor: Color(0xffffffff),
line2Data: <FlSpot>[],
line2Color: Color(0xffffffff),
colorBackground: Color(0xff356CA3),
lineColor: const Color(0xffffffff),
line2Data: const <FlSpot>[],
line2Color: const Color(0xffffffff),
colorBackground: const Color(0xff356CA3),
period: Period.month,
),
const Padding(
Expand Down
1 change: 0 additions & 1 deletion lib/custom_widgets/accounts_sum.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

Expand Down
4 changes: 1 addition & 3 deletions lib/custom_widgets/alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,7 @@ enum AlertDialogType { info, success, warning, error }

class _AlertDialog extends StatelessWidget {
const _AlertDialog(
this._dialogType, this._text, this._primaryActionText, this._primaryActionFunction, this._secondaryActionText, this._secondaryActionFunction,
{Key? key})
: super(key: key);
this._dialogType, this._text, this._primaryActionText, this._primaryActionFunction, this._secondaryActionText, this._secondaryActionFunction);

final AlertDialogType _dialogType;
final String _text;
Expand Down
1 change: 0 additions & 1 deletion lib/custom_widgets/budget_circular_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand Down
18 changes: 7 additions & 11 deletions lib/custom_widgets/circular_menu_item_wrap.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,16 @@ import 'package:circular_menu/circular_menu.dart';
import 'package:flutter/material.dart';

class CircularMenuItemWrap extends CircularMenuItem {
final VoidCallback onTap;
final String text;
final Color? iconColor;
final Color? color;
final IconData? icon;

CircularMenuItemWrap({
required this.onTap,
this.color,
CircularMenuItemWrap({super.key,
required super.onTap,
super.color,
required this.text,
this.icon,
this.iconColor,
}) : super(onTap: onTap, icon: icon, iconColor: iconColor, color: color);

super.icon,
super.iconColor,
});
@override
Widget build(BuildContext context) {
return Column(
Expand Down
2 changes: 1 addition & 1 deletion lib/custom_widgets/line_chart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ class _LineChartSample2State extends State<LineChartWidget> {
LineTooltipItem first = LineTooltipItem(
'$dateFormat \n\n',
TextStyle(
color: Theme.of(context).colorScheme.onBackground,
color: Theme.of(context).colorScheme.onSurface,
fontWeight: FontWeight.bold,
),
children: [
Expand Down
2 changes: 1 addition & 1 deletion lib/custom_widgets/transactions_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class TransactionRow extends ConsumerWidget with Functions {
),
if (!last)
Container(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
child: Divider(
height: 1,
indent: 12,
Expand Down
41 changes: 30 additions & 11 deletions lib/database/sossoldi_database.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import 'dart:math'; // used for random number generation in demo data

import 'package:flutter/foundation.dart' show kIsWeb;
import 'package:path/path.dart';
import 'package:sqflite/sqflite.dart';
import 'package:sqflite_common_ffi_web/sqflite_ffi_web.dart';

// Models
import '../model/bank_account.dart';
Expand All @@ -12,10 +14,18 @@ import '../model/recurring_transaction_amount.dart';
import '../model/transaction.dart';

class SossoldiDatabase {
static final SossoldiDatabase instance = SossoldiDatabase._init();
static SossoldiDatabase instance = SossoldiDatabase._init();
static Database? _database;
static String dbName = 'sossoldi.db';

static Future<String> getPath() async {
// On Android, it is typically data/data//databases, on iOS and MacOS, it is the Documents directory.
final databasePath = await getDatabasesPath();
final path = join(databasePath, dbName);

return path;
}

// Zero args constructor needed to extend this class
SossoldiDatabase({String? dbName}){
dbName = dbName ?? 'sossoldi.db';
Expand All @@ -26,17 +36,17 @@ class SossoldiDatabase {
Future<Database> get database async {
if (_database != null) return _database!;

_database = await _initDB(dbName);
_database = await _initDB();
return _database!;
}

Future<Database> _initDB(String filePath) async {
// On Android, it is typically data/data//databases.
// On iOS and MacOS, it is the Documents directory.
final databasePath = await getDatabasesPath();
// Directory databasePath = await getApplicationDocumentsDirectory();

final path = join(databasePath, filePath);
Future<Database> _initDB() async {
if (kIsWeb) {
// We need to change default factory on the web
databaseFactory = databaseFactoryFfiWeb;
}
final path = await getPath();

return await openDatabase(path, version: 1, onCreate: _createDB);
}

Expand Down Expand Up @@ -205,7 +215,7 @@ class SossoldiDatabase {
var randomAccount = accounts[rnd.nextInt(accounts.length)];
var randomNote = outNotes[rnd.nextInt(outNotes.length)];
var randomCategory = categories[rnd.nextInt(categories.length)];
var idBankAccountTransfer;
int? idBankAccountTransfer;
DateTime randomDate = now.subtract(Duration(days: rnd.nextInt(dateInPastMaxRange), hours: rnd.nextInt(20), minutes: rnd.nextInt(50)));

if (i % (countOfGeneratedTransaction/100) == 0) {
Expand All @@ -224,7 +234,11 @@ class SossoldiDatabase {
}

// put generated transaction in our list
demoTransactions.add('''('$randomDate', ${randomAmount.toStringAsFixed(2)}, '$randomType', '$randomNote', $randomCategory, $randomAccount, $idBankAccountTransfer, 0, null, null, null, null, '$randomDate', '$randomDate')''');
demoTransactions.add('''
('$randomDate', ${randomAmount.toStringAsFixed(2)}, '$randomType',
'$randomNote', $randomCategory, $randomAccount, $idBankAccountTransfer,
0, null, null, null, null, '$randomDate', '$randomDate')
''');
}

// add salary every month
Expand Down Expand Up @@ -265,6 +279,11 @@ class SossoldiDatabase {
database.close();
}

Future reset() async {
// Reopen the database previoulsy closed
_database = await _initDB();
}

// WARNING: FOR DEV/TEST PURPOSES ONLY!!
Future<void> deleteDatabase() async {
final databasePath = await getDatabasesPath();
Expand Down
Loading
Loading