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

Fix: Warning solved + Notifications + Package renamed #183

Merged
merged 3 commits into from
Dec 2, 2024
Merged
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
54 changes: 18 additions & 36 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,26 @@ plugins {
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

android {
compileSdkVersion 34
ndkVersion flutter.ndkVersion
namespace "com.ripsters.sossoldi"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
jvmTarget = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.sossoldi"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "com.ripsters.sossoldi"
minSdkVersion = flutter.minSdkVersion
targetSdkVersion = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}

buildTypes {
Expand All @@ -60,5 +36,11 @@ android {
}

flutter {
source '../..'
source = "../.."
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.2.2'
implementation 'androidx.window:window:1.0.0'
implementation 'androidx.window:window-java:1.0.0'
}
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sossoldi">
package="com.ripsters.sossoldi">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
23 changes: 21 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sossoldi">
package="com.ripsters.sossoldi">

<!-- Permissions for scheduled notifications-->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.USE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT"/>

<application
android:label="sossoldi"
android:label="Sossoldi"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
Expand All @@ -25,6 +34,16 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Notifications scheduler -->
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:exported="false" android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
</intent-filter>
</receiver>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.example.sossoldi
package com.ripsters.sossoldi

import io.flutter.embedding.android.FlutterActivity

Expand Down
2 changes: 1 addition & 1 deletion android/app/src/profile/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.sossoldi">
package="com.ripsters.sossoldi">
<!-- The INTERNET permission is required for development. Specifically,
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
Expand Down
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Sun Sep 25 18:25:25 CEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
4 changes: 2 additions & 2 deletions android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.1.2" apply false
id "org.jetbrains.kotlin.android" version "1.8.20" apply false
id "com.android.application" version "8.1.0" apply false
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
}

include ":app"
Expand Down
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.sossoldi;
PRODUCT_BUNDLE_IDENTIFIER = com.ripsters.sossoldi;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand All @@ -510,7 +510,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.sossoldi.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.ripsters.sossoldi.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -528,7 +528,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.sossoldi.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.ripsters.sossoldi.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
Expand All @@ -544,7 +544,7 @@
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.example.sossoldi.RunnerTests;
PRODUCT_BUNDLE_IDENTIFIER = com.ripsters.sossoldi.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
Expand Down Expand Up @@ -671,7 +671,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.sossoldi;
PRODUCT_BUNDLE_IDENTIFIER = com.ripsters.sossoldi;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
Expand All @@ -693,7 +693,7 @@
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.sossoldi;
PRODUCT_BUNDLE_IDENTIFIER = com.ripsters.sossoldi;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
SWIFT_VERSION = 5.0;
Expand Down
15 changes: 3 additions & 12 deletions lib/custom_widgets/account_modal.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
Expand All @@ -17,7 +15,7 @@ class AccountDialog extends ConsumerWidget with Functions {
@override
Widget build(BuildContext context, WidgetRef ref) {
final currencyState = ref.watch(currencyStateNotifier);

return SingleChildScrollView(
child: Column(
children: [
Expand Down Expand Up @@ -62,7 +60,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,15 +79,8 @@ 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),
period: Period.month,
),
const Padding(
padding: EdgeInsets.only(bottom: 14.0),
),
const SizedBox(height: 14.0),
],
),
),
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
47 changes: 29 additions & 18 deletions lib/custom_widgets/alert_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ class AlertDialogBuilder {
showDialog(
context: context,
builder: (context) {
return _AlertDialog(dialogType, text, primaryActionText, primaryActionFunction, secondaryActionText, secondaryActionFunction);
return _AlertDialog(dialogType, text, primaryActionText, primaryActionFunction,
secondaryActionText, secondaryActionFunction);
},
barrierDismissible: isDismissible);
}
Expand All @@ -68,33 +69,41 @@ class AlertDialogBuilder {
/// Shows an info dialog with given text
///
void showInfoDialog(BuildContext context, String text) =>
AlertDialogBuilder(text: text, dialogType: AlertDialogType.info, primaryActionText: "OK").show(context);
AlertDialogBuilder(text: text, dialogType: AlertDialogType.info, primaryActionText: "OK")
.show(context);

///
/// Shows a success dialog with given text
///
void showSuccessDialog(BuildContext context, String text) =>
AlertDialogBuilder(text: text, dialogType: AlertDialogType.success, primaryActionText: "OK").show(context);
AlertDialogBuilder(text: text, dialogType: AlertDialogType.success, primaryActionText: "OK")
.show(context);

///
/// Shows a warning dialog with given text
///
void showWarningDialog(BuildContext context, String text) =>
AlertDialogBuilder(text: text, dialogType: AlertDialogType.warning, primaryActionText: "OK").show(context);
AlertDialogBuilder(text: text, dialogType: AlertDialogType.warning, primaryActionText: "OK")
.show(context);

///
/// Shows an error dialog with given text
///
void showErrorDialog(BuildContext context, String text) =>
AlertDialogBuilder(text: text, dialogType: AlertDialogType.error, primaryActionText: "OK").show(context);
AlertDialogBuilder(text: text, dialogType: AlertDialogType.error, primaryActionText: "OK")
.show(context);

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 Expand Up @@ -134,19 +143,21 @@ class _AlertDialog extends StatelessWidget {
// Secondary action comes first, since actions are displayed on screen left to right //
if (_secondaryActionText != null) {
actionWidgets.add(TextButton(
onPressed: () {
_secondaryActionFunction?.call();
Navigator.of(context).pop();
},
child: Text(_secondaryActionText!)));
}

actionWidgets.add(TextButton(
onPressed: () {
_primaryActionFunction?.call();
_secondaryActionFunction?.call();
Navigator.of(context).pop();
},
child: Text(_primaryActionText)));
child: Text(_secondaryActionText),
));
}

actionWidgets.add(TextButton(
onPressed: () {
_primaryActionFunction?.call();
Navigator.of(context).pop();
},
child: Text(_primaryActionText),
));

return actionWidgets;
}
Expand Down
16 changes: 8 additions & 8 deletions lib/custom_widgets/budget_circular_indicator.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:percent_indicator/circular_percent_indicator.dart';
Expand Down Expand Up @@ -62,7 +60,10 @@ class BudgetCircularIndicator extends ConsumerWidget with Functions {
const SizedBox(height: 6),
Text(
"LEFT",
style: Theme.of(context).textTheme.labelLarge!.copyWith(color: Theme.of(context).colorScheme.primary),
style: Theme.of(context)
.textTheme
.labelLarge!
.copyWith(color: Theme.of(context).colorScheme.primary),
),
],
),
Expand All @@ -71,11 +72,10 @@ class BudgetCircularIndicator extends ConsumerWidget with Functions {
progressColor: color,
),
const SizedBox(height: 10),
Row(
children: [
perc >= 0.9 ? const Icon(Icons.error_outline, color: Colors.red, size: 15) : Container(),
const SizedBox(width: 3),
Text(title, style: Theme.of(context).textTheme.bodyLarge),
Row(children: [
perc >= 0.9 ? const Icon(Icons.error_outline, color: Colors.red, size: 15) : Container(),
const SizedBox(width: 3),
Text(title, style: Theme.of(context).textTheme.bodyLarge),
])
],
);
Expand Down
Loading
Loading