fix some issues

This commit is contained in:
OkaykOrhmn 2025-01-06 15:13:58 +03:30
parent 0ad8c23547
commit 3814bf14ff
17 changed files with 80 additions and 145 deletions

View File

@ -36,7 +36,7 @@ if (keystorePropertiesFile.exists()) {
android {
namespace "com.didvan.didvanapp"
compileSdk 34
compileSdk 35
ndkVersion "25.1.8937393"
compileOptions {

View File

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.didvan.didvanapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

View File

@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.didvan.didvanapp">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

View File

@ -1,5 +1,4 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.didvan.didvanapp">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->

View File

@ -1,5 +1,5 @@
buildscript {
ext.kotlin_version = '1.9.10'
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
@ -7,7 +7,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.android.tools.build:gradle:8.3.2'
classpath 'com.google.gms:google-services:4.3.14'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}

View File

@ -1,3 +1,6 @@
org.gradle.jvmargs=-Xmx4608m
android.useAndroidX=true
android.enableJetifier=true
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false
android.nonFinalResIds=false

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip

View File

@ -6,7 +6,6 @@ import 'package:didvan/services/storage/storage.dart';
import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get/get.dart';
class NotificationService {
@ -167,51 +166,3 @@ class NotificationService {
}
}
}
class NotificationHelper {
static final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
FlutterLocalNotificationsPlugin();
static Future<void> initialized() async {
const AndroidInitializationSettings initializationSettingsAndroid =
AndroidInitializationSettings('@mipmap/ic_launcher');
final initializationSettingsIos = DarwinInitializationSettings(
requestAlertPermission: true,
requestBadgePermission: true,
requestSoundPermission: true,
onDidReceiveLocalNotification: (id, title, body, payload) async {},
);
await flutterLocalNotificationsPlugin.initialize(
InitializationSettings(
android: initializationSettingsAndroid,
iOS: initializationSettingsIos),
onDidReceiveNotificationResponse: (details) {
if (kDebugMode) {
print("onDidReceiveNotificationResponse: $details");
}
}, onDidReceiveBackgroundNotificationResponse: localBackgroundHandler);
}
static void displayNotification(RemoteMessage message) async {
try {
final id = DateTime.now().millisecondsSinceEpoch ~/ 1000;
const notifDetails = NotificationDetails(
android: AndroidNotificationDetails(
'push_notificatiion', 'push_notificatiion_channel',
importance: Importance.max, priority: Priority.high));
await flutterLocalNotificationsPlugin.show(
id, message.data['title'], message.data['body'], notifDetails);
} on Exception catch (e) {
e.printError();
}
}
}
@pragma('vm:entry-point')
Future<void> localBackgroundHandler(NotificationResponse data) async {
if (kDebugMode) {
print("onDidReceiveBackgroundNotificationResponse: $data");
}
}

View File

@ -213,23 +213,26 @@ class _CreateBotAssistantsPageState extends State<CreateBotAssistantsPage> {
final pickedFile =
await MediaService.pickImage(
source: ImageSource.gallery);
File? file;
CroppedFile? croppedFile;
if (pickedFile != null && !kIsWeb) {
file = await ImageCropper().cropImage(
croppedFile =
await ImageCropper().cropImage(
sourcePath: pickedFile.path,
androidUiSettings:
const AndroidUiSettings(
toolbarTitle: 'برش تصویر'),
iosUiSettings: const IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
),
uiSettings: [
AndroidUiSettings(
toolbarTitle: 'برش تصویر'),
IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
)
],
compressQuality: 30,
);
}
if (file != null) {
if (croppedFile != null) {
final file = File(croppedFile.path);
final fileSizeInBytes =
await file.length();
if (fileSizeInBytes >
@ -242,7 +245,8 @@ class _CreateBotAssistantsPageState extends State<CreateBotAssistantsPage> {
return;
}
state.image.value = XFile(file.path);
state.image.value =
XFile(croppedFile.path);
} else if (kIsWeb && pickedFile != null) {
final fileSizeInBytes =
await pickedFile.length();

View File

@ -594,17 +594,18 @@ class _AiMessageBarState extends State<AiMessageBar> {
final pickedFile = await MediaService.pickImage(
source: ImageSource.gallery);
File? file;
CroppedFile? file;
if (pickedFile != null && !kIsWeb) {
file = await ImageCropper().cropImage(
sourcePath: pickedFile.path,
androidUiSettings:
const AndroidUiSettings(toolbarTitle: 'برش تصویر'),
iosUiSettings: const IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
),
uiSettings: [
AndroidUiSettings(toolbarTitle: 'برش تصویر'),
IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
)
],
compressQuality: 30,
);

View File

@ -666,17 +666,18 @@ class _AiMessageBarIOSState extends State<AiMessageBarIOS> {
final pickedFile = await MediaService.pickImage(
source: ImageSource.gallery);
File? file;
CroppedFile? file;
if (pickedFile != null && !kIsWeb) {
file = await ImageCropper().cropImage(
sourcePath: pickedFile.path,
androidUiSettings:
const AndroidUiSettings(toolbarTitle: 'برش تصویر'),
iosUiSettings: const IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
),
uiSettings: [
AndroidUiSettings(toolbarTitle: 'برش تصویر'),
IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
)
],
compressQuality: 30,
);

View File

@ -15,7 +15,6 @@ import 'package:flutter_sound/public/flutter_sound_player.dart';
import 'package:flutter_sound/public/flutter_sound_recorder.dart';
import 'package:flutter_sound_platform_interface/flutter_sound_platform_interface.dart';
import 'package:flutter_sound_platform_interface/flutter_sound_recorder_platform_interface.dart';
import 'package:flutter_vibrate/flutter_vibrate.dart';
import 'package:http/http.dart' as http;
import 'package:permission_handler/permission_handler.dart';
@ -176,9 +175,6 @@ class DirectState extends CoreProvier {
Future<void> startRecording() async {
text = null;
// await _recorder.hasPermission();
if (!kIsWeb) {
Vibrate.feedback(FeedbackType.medium);
}
record();
notifyListeners();

View File

@ -146,12 +146,14 @@ class _ProfilePhotoState extends State<ProfilePhoto> {
file = await ImageCropper().cropImage(
sourcePath: pickedFile.path,
aspectRatio: const CropAspectRatio(ratioX: 1, ratioY: 1),
androidUiSettings: const AndroidUiSettings(toolbarTitle: 'برش تصویر'),
iosUiSettings: const IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
),
uiSettings: [
AndroidUiSettings(toolbarTitle: 'برش تصویر'),
IOSUiSettings(
title: 'برش تصویر',
doneButtonTitle: 'تایید',
cancelButtonTitle: 'بازگشت',
),
],
compressQuality: 30,
);
if (file == null) return;

View File

@ -120,7 +120,9 @@ class _CategoriesListState extends State<CategoriesList> {
return GestureDetector(
onTap: () async {
if (widget.selectedCats.isNotEmpty &&
widget.selectedCats.first.id == category.id) return;
widget.selectedCats.first.id == category.id) {
return;
}
widget.selectedCats.clear();
if (category.id != 0) widget.selectedCats.add(category);
await _scrollController.animateTo(

View File

@ -139,7 +139,9 @@ class _PrimaryControlsState extends State<PrimaryControls> {
if (position.value.inSeconds >
chewieController
.videoPlayerController.value.duration.inSeconds -
1) return;
1) {
return;
}
setState(() => isAnimatingForward = true);
Duration forward = Duration(seconds: position.value.inSeconds + 1);

View File

@ -438,30 +438,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "2.0.3"
flutter_local_notifications:
dependency: "direct main"
description:
name: flutter_local_notifications
sha256: c500d5d9e7e553f06b61877ca6b9c8b92c570a4c8db371038702e8ce57f8a50f
url: "https://pub.dev"
source: hosted
version: "17.2.2"
flutter_local_notifications_linux:
dependency: transitive
description:
name: flutter_local_notifications_linux
sha256: c49bd06165cad9beeb79090b18cd1eb0296f4bf4b23b84426e37dd7c027fc3af
url: "https://pub.dev"
source: hosted
version: "4.0.1"
flutter_local_notifications_platform_interface:
dependency: transitive
description:
name: flutter_local_notifications_platform_interface
sha256: "85f8d07fe708c1bdcf45037f2c0109753b26ae077e9d9e899d55971711a4ea66"
url: "https://pub.dev"
source: hosted
version: "7.2.0"
flutter_localizations:
dependency: "direct main"
description: flutter
@ -568,14 +544,6 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_vibrate:
dependency: "direct main"
description:
name: flutter_vibrate
sha256: "9cc9b32cf52c90dd34c1cf396ed40010b2c74e69adbb0ff16005afa900971ad8"
url: "https://pub.dev"
source: hosted
version: "1.3.0"
flutter_web_plugins:
dependency: transitive
description: flutter
@ -641,10 +609,26 @@ packages:
dependency: "direct main"
description:
name: image_cropper
sha256: "60542ffd03436e6f80a1d7c9839f75b6a62b0a290cd98624fa29d150fdf672c8"
sha256: "266760ed426d7121f0ada02c672bfe5c1b5c714e908328716aee756f045709dc"
url: "https://pub.dev"
source: hosted
version: "1.5.1"
version: "8.1.0"
image_cropper_for_web:
dependency: transitive
description:
name: image_cropper_for_web
sha256: "34256c8fb7fcb233251787c876bb37271744459b593a948a2db73caa323034d0"
url: "https://pub.dev"
source: hosted
version: "6.0.2"
image_cropper_platform_interface:
dependency: transitive
description:
name: image_cropper_platform_interface
sha256: e8e9d2ca36360387aee39295ce49029362ae4df3071f23e8e71f2b81e40b7531
url: "https://pub.dev"
source: hosted
version: "7.0.0"
image_picker:
dependency: "direct main"
description:
@ -1266,14 +1250,6 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.7.3"
timezone:
dependency: transitive
description:
name: timezone
sha256: "2236ec079a174ce07434e89fcd3fcda430025eb7692244139a9cf54fdcf1fc7d"
url: "https://pub.dev"
source: hosted
version: "0.9.4"
toggle_switch:
dependency: "direct main"
description:
@ -1556,4 +1532,4 @@ packages:
version: "6.5.0"
sdks:
dart: ">=3.5.0 <4.0.0"
flutter: ">=3.20.0-1.2.pre"
flutter: ">=3.22.0"

View File

@ -49,7 +49,6 @@ dependencies:
cached_network_image: ^3.2.0
skeleton_text: ^3.0.0
carousel_slider: ^5.0.0
flutter_vibrate: ^1.3.0
universal_html: ^2.0.8
record: ^5.1.2
@ -59,7 +58,7 @@ dependencies:
flutter_html: ^3.0.0-alpha.2
url_launcher: ^6.0.18
audio_video_progress_bar: ^2.0.0
image_cropper: ^1.5.0
# image_cropper: ^1.5.0
firebase_core: ^3.1.0
firebase_messaging: ^15.0.1
webview_flutter: ^4.8.0
@ -92,7 +91,7 @@ dependencies:
mime: ^1.0.2
path: any
flutter_cache_manager: any
flutter_local_notifications: ^17.2.2
# flutter_local_notifications: ^17.2.2
flutter_background_service: ^5.0.10
# js: ^0.6.7
flutter_sound: ^9.6.0
@ -107,6 +106,7 @@ dependencies:
sentry_flutter: ^8.12.0
persian_datetime_picker: ^3.1.0
just_audio_web: ^0.4.13
image_cropper: ^8.1.0
# fading_edge_scrollview: ^4.1.1
dev_dependencies:
flutter_test: