From bdf380b92564663168a4871371dd42d78d3bd250 Mon Sep 17 00:00:00 2001 From: Hamza-Ayed Date: Sun, 11 May 2025 00:03:19 +0300 Subject: [PATCH] 25-5-10/1 --- .../profile/arm64-v8a/compile_commands.json | 6 +- .../profile/armeabi-v7a/compile_commands.json | 6 +- .../profile/x86_64/compile_commands.json | 6 +- android/app/build.gradle | 4 +- ios/MyWidgetHome/AppIntent.swift | 18 + .../AccentColor.colorset/Contents.json | 11 + .../AppIcon.appiconset/Contents.json | 35 ++ .../Assets.xcassets/Contents.json | 6 + .../WidgetBackground.colorset/Contents.json | 11 + ios/MyWidgetHome/Info.plist | 11 + ios/MyWidgetHome/MyWidgetHome.swift | 88 +++ ios/MyWidgetHome/MyWidgetHomeBundle.swift | 18 + ios/MyWidgetHome/MyWidgetHomeControl.swift | 77 +++ .../MyWidgetHomeLiveActivity.swift | 80 +++ ios/Podfile.lock | 6 + ios/Runner.xcodeproj/project.pbxproj | 225 ++++++- ios/Runner/Info.plist | 4 +- .../map_widget.dart/left_main_menu_icons.dart | 48 +- lib/views/widgets/error_snakbar.dart | 592 +++++++++++++++--- pubspec.lock | 8 + pubspec.yaml | 1 + 21 files changed, 1117 insertions(+), 144 deletions(-) create mode 100644 ios/MyWidgetHome/AppIntent.swift create mode 100644 ios/MyWidgetHome/Assets.xcassets/AccentColor.colorset/Contents.json create mode 100644 ios/MyWidgetHome/Assets.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ios/MyWidgetHome/Assets.xcassets/Contents.json create mode 100644 ios/MyWidgetHome/Assets.xcassets/WidgetBackground.colorset/Contents.json create mode 100644 ios/MyWidgetHome/Info.plist create mode 100644 ios/MyWidgetHome/MyWidgetHome.swift create mode 100644 ios/MyWidgetHome/MyWidgetHomeBundle.swift create mode 100644 ios/MyWidgetHome/MyWidgetHomeControl.swift create mode 100644 ios/MyWidgetHome/MyWidgetHomeLiveActivity.swift diff --git a/android/app/.cxx/tools/profile/arm64-v8a/compile_commands.json b/android/app/.cxx/tools/profile/arm64-v8a/compile_commands.json index 2f3fe99..2e9f93a 100644 --- a/android/app/.cxx/tools/profile/arm64-v8a/compile_commands.json +++ b/android/app/.cxx/tools/profile/arm64-v8a/compile_commands.json @@ -1,8 +1,8 @@ [ { - "directory": "/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/.cxx/Debug/2c6m2v30/arm64-v8a", - "command": "/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dnative_lib_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c \"/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/src/main/cpp/native-lib.cpp\"", - "file": "/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/src/main/cpp/native-lib.cpp", + "directory": "/Users/hamzaaleghwairyeen/development/App/ride/android/app/.cxx/Debug/2t6f74k3/arm64-v8a", + "command": "/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=aarch64-none-linux-android23 --sysroot=/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dnative_lib_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c /Users/hamzaaleghwairyeen/development/App/ride/android/app/src/main/cpp/native-lib.cpp", + "file": "/Users/hamzaaleghwairyeen/development/App/ride/android/app/src/main/cpp/native-lib.cpp", "output": "CMakeFiles/native-lib.dir/native-lib.cpp.o" } ] \ No newline at end of file diff --git a/android/app/.cxx/tools/profile/armeabi-v7a/compile_commands.json b/android/app/.cxx/tools/profile/armeabi-v7a/compile_commands.json index ebe784c..11f431b 100644 --- a/android/app/.cxx/tools/profile/armeabi-v7a/compile_commands.json +++ b/android/app/.cxx/tools/profile/armeabi-v7a/compile_commands.json @@ -1,8 +1,8 @@ [ { - "directory": "/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/.cxx/Debug/2c6m2v30/armeabi-v7a", - "command": "/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi23 --sysroot=/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dnative_lib_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c \"/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/src/main/cpp/native-lib.cpp\"", - "file": "/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/src/main/cpp/native-lib.cpp", + "directory": "/Users/hamzaaleghwairyeen/development/App/ride/android/app/.cxx/Debug/2t6f74k3/armeabi-v7a", + "command": "/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=armv7-none-linux-androideabi23 --sysroot=/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dnative_lib_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -march=armv7-a -mthumb -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c /Users/hamzaaleghwairyeen/development/App/ride/android/app/src/main/cpp/native-lib.cpp", + "file": "/Users/hamzaaleghwairyeen/development/App/ride/android/app/src/main/cpp/native-lib.cpp", "output": "CMakeFiles/native-lib.dir/native-lib.cpp.o" } ] \ No newline at end of file diff --git a/android/app/.cxx/tools/profile/x86_64/compile_commands.json b/android/app/.cxx/tools/profile/x86_64/compile_commands.json index 2010bc9..5870560 100644 --- a/android/app/.cxx/tools/profile/x86_64/compile_commands.json +++ b/android/app/.cxx/tools/profile/x86_64/compile_commands.json @@ -1,8 +1,8 @@ [ { - "directory": "/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/.cxx/Debug/2c6m2v30/x86_64", - "command": "/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=x86_64-none-linux-android23 --sysroot=/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dnative_lib_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c \"/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/src/main/cpp/native-lib.cpp\"", - "file": "/Users/hamzaaleghwairyeen/development/App/ride 2/android/app/src/main/cpp/native-lib.cpp", + "directory": "/Users/hamzaaleghwairyeen/development/App/ride/android/app/.cxx/Debug/2t6f74k3/x86_64", + "command": "/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/bin/clang++ --target=x86_64-none-linux-android23 --sysroot=/Users/hamzaaleghwairyeen/Library/Android/sdk/ndk/27.0.12077973/toolchains/llvm/prebuilt/darwin-x86_64/sysroot -Dnative_lib_EXPORTS -g -DANDROID -fdata-sections -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fno-limit-debug-info -fPIC -o CMakeFiles/native-lib.dir/native-lib.cpp.o -c /Users/hamzaaleghwairyeen/development/App/ride/android/app/src/main/cpp/native-lib.cpp", + "file": "/Users/hamzaaleghwairyeen/development/App/ride/android/app/src/main/cpp/native-lib.cpp", "output": "CMakeFiles/native-lib.dir/native-lib.cpp.o" } ] \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 219d123..54971a2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -53,8 +53,8 @@ android { applicationId = "com.mobileapp.store.ride" minSdk = 23 targetSdk = flutter.targetSdkVersion // Use flutter.targetSdkVersion - versionCode = 130 - versionName = '2.0.130' + versionCode = 131 + versionName = '2.0.131' multiDexEnabled = true ndk { diff --git a/ios/MyWidgetHome/AppIntent.swift b/ios/MyWidgetHome/AppIntent.swift new file mode 100644 index 0000000..a09b9c5 --- /dev/null +++ b/ios/MyWidgetHome/AppIntent.swift @@ -0,0 +1,18 @@ +// +// AppIntent.swift +// MyWidgetHome +// +// Created by Hamza Aleghwairyeen on 11/05/2025. +// + +import WidgetKit +import AppIntents + +struct ConfigurationAppIntent: WidgetConfigurationIntent { + static var title: LocalizedStringResource { "Configuration" } + static var description: IntentDescription { "This is an example widget." } + + // An example configurable parameter. + @Parameter(title: "Favorite Emoji", default: "😃") + var favoriteEmoji: String +} diff --git a/ios/MyWidgetHome/Assets.xcassets/AccentColor.colorset/Contents.json b/ios/MyWidgetHome/Assets.xcassets/AccentColor.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios/MyWidgetHome/Assets.xcassets/AccentColor.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/MyWidgetHome/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/MyWidgetHome/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..2305880 --- /dev/null +++ b/ios/MyWidgetHome/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,35 @@ +{ + "images" : [ + { + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "dark" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + }, + { + "appearances" : [ + { + "appearance" : "luminosity", + "value" : "tinted" + } + ], + "idiom" : "universal", + "platform" : "ios", + "size" : "1024x1024" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/MyWidgetHome/Assets.xcassets/Contents.json b/ios/MyWidgetHome/Assets.xcassets/Contents.json new file mode 100644 index 0000000..73c0059 --- /dev/null +++ b/ios/MyWidgetHome/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/MyWidgetHome/Assets.xcassets/WidgetBackground.colorset/Contents.json b/ios/MyWidgetHome/Assets.xcassets/WidgetBackground.colorset/Contents.json new file mode 100644 index 0000000..eb87897 --- /dev/null +++ b/ios/MyWidgetHome/Assets.xcassets/WidgetBackground.colorset/Contents.json @@ -0,0 +1,11 @@ +{ + "colors" : [ + { + "idiom" : "universal" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/ios/MyWidgetHome/Info.plist b/ios/MyWidgetHome/Info.plist new file mode 100644 index 0000000..0f118fb --- /dev/null +++ b/ios/MyWidgetHome/Info.plist @@ -0,0 +1,11 @@ + + + + + NSExtension + + NSExtensionPointIdentifier + com.apple.widgetkit-extension + + + diff --git a/ios/MyWidgetHome/MyWidgetHome.swift b/ios/MyWidgetHome/MyWidgetHome.swift new file mode 100644 index 0000000..2ec3bd8 --- /dev/null +++ b/ios/MyWidgetHome/MyWidgetHome.swift @@ -0,0 +1,88 @@ +// +// MyWidgetHome.swift +// MyWidgetHome +// +// Created by Hamza Aleghwairyeen on 11/05/2025. +// + +import WidgetKit +import SwiftUI + +struct Provider: AppIntentTimelineProvider { + func placeholder(in context: Context) -> SimpleEntry { + SimpleEntry(date: Date(), configuration: ConfigurationAppIntent()) + } + + func snapshot(for configuration: ConfigurationAppIntent, in context: Context) async -> SimpleEntry { + SimpleEntry(date: Date(), configuration: configuration) + } + + func timeline(for configuration: ConfigurationAppIntent, in context: Context) async -> Timeline { + var entries: [SimpleEntry] = [] + + // Generate a timeline consisting of five entries an hour apart, starting from the current date. + let currentDate = Date() + for hourOffset in 0 ..< 5 { + let entryDate = Calendar.current.date(byAdding: .hour, value: hourOffset, to: currentDate)! + let entry = SimpleEntry(date: entryDate, configuration: configuration) + entries.append(entry) + } + + return Timeline(entries: entries, policy: .atEnd) + } + +// func relevances() async -> WidgetRelevances { +// // Generate a list containing the contexts this widget is relevant in. +// } +} + +struct SimpleEntry: TimelineEntry { + let date: Date + let configuration: ConfigurationAppIntent +} + +struct MyWidgetHomeEntryView : View { + var entry: Provider.Entry + + var body: some View { + VStack { + Text("Time:") + Text(entry.date, style: .time) + + Text("Favorite Emoji:") + Text(entry.configuration.favoriteEmoji) + } + } +} + +struct MyWidgetHome: Widget { + let kind: String = "MyWidgetHome" + + var body: some WidgetConfiguration { + AppIntentConfiguration(kind: kind, intent: ConfigurationAppIntent.self, provider: Provider()) { entry in + MyWidgetHomeEntryView(entry: entry) + .containerBackground(.fill.tertiary, for: .widget) + } + } +} + +extension ConfigurationAppIntent { + fileprivate static var smiley: ConfigurationAppIntent { + let intent = ConfigurationAppIntent() + intent.favoriteEmoji = "😀" + return intent + } + + fileprivate static var starEyes: ConfigurationAppIntent { + let intent = ConfigurationAppIntent() + intent.favoriteEmoji = "🤩" + return intent + } +} + +#Preview(as: .systemSmall) { + MyWidgetHome() +} timeline: { + SimpleEntry(date: .now, configuration: .smiley) + SimpleEntry(date: .now, configuration: .starEyes) +} diff --git a/ios/MyWidgetHome/MyWidgetHomeBundle.swift b/ios/MyWidgetHome/MyWidgetHomeBundle.swift new file mode 100644 index 0000000..8c5c8f1 --- /dev/null +++ b/ios/MyWidgetHome/MyWidgetHomeBundle.swift @@ -0,0 +1,18 @@ +// +// MyWidgetHomeBundle.swift +// MyWidgetHome +// +// Created by Hamza Aleghwairyeen on 11/05/2025. +// + +import WidgetKit +import SwiftUI + +@main +struct MyWidgetHomeBundle: WidgetBundle { + var body: some Widget { + MyWidgetHome() + MyWidgetHomeControl() + MyWidgetHomeLiveActivity() + } +} diff --git a/ios/MyWidgetHome/MyWidgetHomeControl.swift b/ios/MyWidgetHome/MyWidgetHomeControl.swift new file mode 100644 index 0000000..53b8c3b --- /dev/null +++ b/ios/MyWidgetHome/MyWidgetHomeControl.swift @@ -0,0 +1,77 @@ +// +// MyWidgetHomeControl.swift +// MyWidgetHome +// +// Created by Hamza Aleghwairyeen on 11/05/2025. +// + +import AppIntents +import SwiftUI +import WidgetKit + +struct MyWidgetHomeControl: ControlWidget { + static let kind: String = "com.mobileapp.store.ride.MyWidgetHome" + + var body: some ControlWidgetConfiguration { + AppIntentControlConfiguration( + kind: Self.kind, + provider: Provider() + ) { value in + ControlWidgetToggle( + "Start Timer", + isOn: value.isRunning, + action: StartTimerIntent(value.name) + ) { isRunning in + Label(isRunning ? "On" : "Off", systemImage: "timer") + } + } + .displayName("Timer") + .description("A an example control that runs a timer.") + } +} + +extension MyWidgetHomeControl { + struct Value { + var isRunning: Bool + var name: String + } + + struct Provider: AppIntentControlValueProvider { + func previewValue(configuration: TimerConfiguration) -> Value { + MyWidgetHomeControl.Value(isRunning: false, name: configuration.timerName) + } + + func currentValue(configuration: TimerConfiguration) async throws -> Value { + let isRunning = true // Check if the timer is running + return MyWidgetHomeControl.Value(isRunning: isRunning, name: configuration.timerName) + } + } +} + +struct TimerConfiguration: ControlConfigurationIntent { + static let title: LocalizedStringResource = "Timer Name Configuration" + + @Parameter(title: "Timer Name", default: "Timer") + var timerName: String +} + +struct StartTimerIntent: SetValueIntent { + static let title: LocalizedStringResource = "Start a timer" + + @Parameter(title: "Timer Name") + var name: String + + @Parameter(title: "Timer is running") + var value: Bool + + init() {} + + init(_ name: String) { + self.name = name + } + + func perform() async throws -> some IntentResult { + // Start the timer… + return .result() + } +} diff --git a/ios/MyWidgetHome/MyWidgetHomeLiveActivity.swift b/ios/MyWidgetHome/MyWidgetHomeLiveActivity.swift new file mode 100644 index 0000000..f90467b --- /dev/null +++ b/ios/MyWidgetHome/MyWidgetHomeLiveActivity.swift @@ -0,0 +1,80 @@ +// +// MyWidgetHomeLiveActivity.swift +// MyWidgetHome +// +// Created by Hamza Aleghwairyeen on 11/05/2025. +// + +import ActivityKit +import WidgetKit +import SwiftUI + +struct MyWidgetHomeAttributes: ActivityAttributes { + public struct ContentState: Codable, Hashable { + // Dynamic stateful properties about your activity go here! + var emoji: String + } + + // Fixed non-changing properties about your activity go here! + var name: String +} + +struct MyWidgetHomeLiveActivity: Widget { + var body: some WidgetConfiguration { + ActivityConfiguration(for: MyWidgetHomeAttributes.self) { context in + // Lock screen/banner UI goes here + VStack { + Text("Hello \(context.state.emoji)") + } + .activityBackgroundTint(Color.cyan) + .activitySystemActionForegroundColor(Color.black) + + } dynamicIsland: { context in + DynamicIsland { + // Expanded UI goes here. Compose the expanded UI through + // various regions, like leading/trailing/center/bottom + DynamicIslandExpandedRegion(.leading) { + Text("Leading") + } + DynamicIslandExpandedRegion(.trailing) { + Text("Trailing") + } + DynamicIslandExpandedRegion(.bottom) { + Text("Bottom \(context.state.emoji)") + // more content + } + } compactLeading: { + Text("L") + } compactTrailing: { + Text("T \(context.state.emoji)") + } minimal: { + Text(context.state.emoji) + } + .widgetURL(URL(string: "http://www.apple.com")) + .keylineTint(Color.red) + } + } +} + +extension MyWidgetHomeAttributes { + fileprivate static var preview: MyWidgetHomeAttributes { + MyWidgetHomeAttributes(name: "World") + } +} + +extension MyWidgetHomeAttributes.ContentState { + fileprivate static var smiley: MyWidgetHomeAttributes.ContentState { + MyWidgetHomeAttributes.ContentState(emoji: "😀") + } + + fileprivate static var starEyes: MyWidgetHomeAttributes.ContentState { + MyWidgetHomeAttributes.ContentState(emoji: "🤩") + } +} + +#Preview("Notification", as: .content, using: MyWidgetHomeAttributes.preview) { + MyWidgetHomeLiveActivity() +} contentStates: { + MyWidgetHomeAttributes.ContentState.smiley + MyWidgetHomeAttributes.ContentState.starEyes +} diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 09baf62..2efcae1 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -130,6 +130,8 @@ PODS: - GTMSessionFetcher/Core (3.5.0) - GTMSessionFetcher/Full (3.5.0): - GTMSessionFetcher/Core + - home_widget (0.0.1): + - Flutter - image_cropper (0.0.4): - Flutter - TOCropViewController (~> 2.7.4) @@ -240,6 +242,7 @@ DEPENDENCIES: - geolocator_apple (from `.symlinks/plugins/geolocator_apple/ios`) - google_maps_flutter_ios (from `.symlinks/plugins/google_maps_flutter_ios/ios`) - google_sign_in_ios (from `.symlinks/plugins/google_sign_in_ios/darwin`) + - home_widget (from `.symlinks/plugins/home_widget/ios`) - image_cropper (from `.symlinks/plugins/image_cropper/ios`) - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`) - jailbreak_root_detection (from `.symlinks/plugins/jailbreak_root_detection/ios`) @@ -325,6 +328,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/google_maps_flutter_ios/ios" google_sign_in_ios: :path: ".symlinks/plugins/google_sign_in_ios/darwin" + home_widget: + :path: ".symlinks/plugins/home_widget/ios" image_cropper: :path: ".symlinks/plugins/image_cropper/ios" image_picker_ios: @@ -402,6 +407,7 @@ SPEC CHECKSUMS: GoogleUtilities: 26a3abef001b6533cf678d3eb38fd3f614b7872d GTMAppAuth: f69bd07d68cd3b766125f7e072c45d7340dea0de GTMSessionFetcher: 5aea5ba6bd522a239e236100971f10cb71b96ab6 + home_widget: 0434835a4c9a75704264feff6be17ea40e0f0d57 image_cropper: 37d40f62177c101ff4c164906d259ea2c3aa70cf image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1 IOSSecuritySuite: b51056d5411aee567153ca86ce7f6edfdc5d2654 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 5871fb4..495915a 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 70; objects = { /* Begin PBXBuildFile section */ @@ -29,6 +29,9 @@ C6B15AA12B5FB24600746405 /* order.wav in Resources */ = {isa = PBXBuildFile; fileRef = C6B15A9F2B5FB24600746405 /* order.wav */; }; C6B15AA22B5FB24600746405 /* tone2.wav in Resources */ = {isa = PBXBuildFile; fileRef = C6B15AA02B5FB24600746405 /* tone2.wav */; }; C6B450142D67556C001427AA /* Constants1.swift in Sources */ = {isa = PBXBuildFile; fileRef = C6B450132D67556B001427AA /* Constants1.swift */; }; + C6E5BC4D2DCFF5F600471574 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6E5BC4C2DCFF5F600471574 /* WidgetKit.framework */; }; + C6E5BC4F2DCFF5F600471574 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C6E5BC4E2DCFF5F600471574 /* SwiftUI.framework */; }; + C6E5BC602DCFF5F800471574 /* MyWidgetHomeExtension.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = C6E5BC4B2DCFF5F600471574 /* MyWidgetHomeExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; D529E7C8240CCC30BB7358A2 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B099132D71B1299FCDFD9C8 /* Pods_Runner.framework */; }; /* End PBXBuildFile section */ @@ -40,6 +43,13 @@ remoteGlobalIDString = 97C146ED1CF9000F007C117D; remoteInfo = Runner; }; + C6E5BC5E2DCFF5F800471574 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 97C146E61CF9000F007C117D /* Project object */; + proxyType = 1; + remoteGlobalIDString = C6E5BC4A2DCFF5F600471574; + remoteInfo = MyWidgetHomeExtension; + }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -53,6 +63,17 @@ name = "Embed Frameworks"; runOnlyForDeploymentPostprocessing = 0; }; + C6E5BC612DCFF5F800471574 /* Embed Foundation Extensions */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 13; + files = ( + C6E5BC602DCFF5F800471574 /* MyWidgetHomeExtension.appex in Embed Foundation Extensions */, + ); + name = "Embed Foundation Extensions"; + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ @@ -93,10 +114,27 @@ C6B15A9F2B5FB24600746405 /* order.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = order.wav; sourceTree = ""; }; C6B15AA02B5FB24600746405 /* tone2.wav */ = {isa = PBXFileReference; lastKnownFileType = audio.wav; path = tone2.wav; sourceTree = ""; }; C6B450132D67556B001427AA /* Constants1.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Constants1.swift; sourceTree = ""; }; + C6E5BC4B2DCFF5F600471574 /* MyWidgetHomeExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = MyWidgetHomeExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; + C6E5BC4C2DCFF5F600471574 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; }; + C6E5BC4E2DCFF5F600471574 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; }; CAF37DC30C17166B851DBC8C /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; F231BA28015FE2C634809733 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ +/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */ + C6E5BC652DCFF5F800471574 /* PBXFileSystemSynchronizedBuildFileExceptionSet */ = { + isa = PBXFileSystemSynchronizedBuildFileExceptionSet; + membershipExceptions = ( + Info.plist, + ); + target = C6E5BC4A2DCFF5F600471574 /* MyWidgetHomeExtension */; + }; +/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */ + +/* Begin PBXFileSystemSynchronizedRootGroup section */ + C6E5BC502DCFF5F600471574 /* MyWidgetHome */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (C6E5BC652DCFF5F800471574 /* PBXFileSystemSynchronizedBuildFileExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = MyWidgetHome; sourceTree = ""; }; +/* End PBXFileSystemSynchronizedRootGroup section */ + /* Begin PBXFrameworksBuildPhase section */ 7AD318F74F39A70FCC91E66D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; @@ -114,6 +152,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6E5BC482DCFF5F600471574 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + C6E5BC4F2DCFF5F600471574 /* SwiftUI.framework in Frameworks */, + C6E5BC4D2DCFF5F600471574 /* WidgetKit.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -154,6 +201,7 @@ children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, + C6E5BC502DCFF5F600471574 /* MyWidgetHome */, 97C146EF1CF9000F007C117D /* Products */, 331C8082294A63A400263BE5 /* RunnerTests */, 5684D45491D29A320AB8001A /* Pods */, @@ -166,6 +214,7 @@ children = ( 97C146EE1CF9000F007C117D /* Runner.app */, 331C8081294A63A400263BE5 /* RunnerTests.xctest */, + C6E5BC4B2DCFF5F600471574 /* MyWidgetHomeExtension.appex */, ); name = Products; sourceTree = ""; @@ -206,6 +255,8 @@ children = ( 3B099132D71B1299FCDFD9C8 /* Pods_Runner.framework */, 27958A27956787B6764BC14F /* Pods_RunnerTests.framework */, + C6E5BC4C2DCFF5F600471574 /* WidgetKit.framework */, + C6E5BC4E2DCFF5F600471574 /* SwiftUI.framework */, ); name = Frameworks; sourceTree = ""; @@ -245,16 +296,40 @@ 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 854CC60BC5A3FC7474EC1FBF /* [CP] Embed Pods Frameworks */, 7ADB08D4DE3D2A2E09575068 /* [CP] Copy Pods Resources */, + C6E5BC612DCFF5F800471574 /* Embed Foundation Extensions */, ); buildRules = ( ); dependencies = ( + C6E5BC5F2DCFF5F800471574 /* PBXTargetDependency */, ); name = Runner; productName = Runner; productReference = 97C146EE1CF9000F007C117D /* Runner.app */; productType = "com.apple.product-type.application"; }; + C6E5BC4A2DCFF5F600471574 /* MyWidgetHomeExtension */ = { + isa = PBXNativeTarget; + buildConfigurationList = C6E5BC662DCFF5F800471574 /* Build configuration list for PBXNativeTarget "MyWidgetHomeExtension" */; + buildPhases = ( + C6E5BC472DCFF5F600471574 /* Sources */, + C6E5BC482DCFF5F600471574 /* Frameworks */, + C6E5BC492DCFF5F600471574 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + fileSystemSynchronizedGroups = ( + C6E5BC502DCFF5F600471574 /* MyWidgetHome */, + ); + name = MyWidgetHomeExtension; + packageProductDependencies = ( + ); + productName = MyWidgetHomeExtension; + productReference = C6E5BC4B2DCFF5F600471574 /* MyWidgetHomeExtension.appex */; + productType = "com.apple.product-type.app-extension"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -262,6 +337,7 @@ isa = PBXProject; attributes = { BuildIndependentTargetsInParallel = YES; + LastSwiftUpdateCheck = 1620; LastUpgradeCheck = 1510; ORGANIZATIONNAME = ""; TargetAttributes = { @@ -273,6 +349,9 @@ CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; }; + C6E5BC4A2DCFF5F600471574 = { + CreatedOnToolsVersion = 16.2; + }; }; }; buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; @@ -290,6 +369,7 @@ targets = ( 97C146ED1CF9000F007C117D /* Runner */, 331C8080294A63A400263BE5 /* RunnerTests */, + C6E5BC4A2DCFF5F600471574 /* MyWidgetHomeExtension */, ); }; /* End PBXProject section */ @@ -323,6 +403,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6E5BC492DCFF5F600471574 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ @@ -459,6 +546,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + C6E5BC472DCFF5F600471574 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -467,6 +561,11 @@ target = 97C146ED1CF9000F007C117D /* Runner */; targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */; }; + C6E5BC5F2DCFF5F800471574 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = C6E5BC4A2DCFF5F600471574 /* MyWidgetHomeExtension */; + targetProxy = C6E5BC5E2DCFF5F800471574 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin PBXVariantGroup section */ @@ -787,6 +886,120 @@ }; name = Release; }; + C6E5BC622DCFF5F800471574 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 63CVT8G5P8; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = MyWidgetHome/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = MyWidgetHome; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.mobileapp.store.ride.MyWidgetHome; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)"; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + C6E5BC632DCFF5F800471574 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 63CVT8G5P8; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = MyWidgetHome/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = MyWidgetHome; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.mobileapp.store.ride.MyWidgetHome; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + C6E5BC642DCFF5F800471574 /* Profile */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor; + ASSETCATALOG_COMPILER_WIDGET_BACKGROUND_COLOR_NAME = WidgetBackground; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++20"; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = 63CVT8G5P8; + ENABLE_USER_SCRIPT_SANDBOXING = YES; + GCC_C_LANGUAGE_STANDARD = gnu17; + GENERATE_INFOPLIST_FILE = YES; + INFOPLIST_FILE = MyWidgetHome/Info.plist; + INFOPLIST_KEY_CFBundleDisplayName = MyWidgetHome; + INFOPLIST_KEY_NSHumanReadableCopyright = ""; + IPHONEOS_DEPLOYMENT_TARGET = 18.2; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@executable_path/../../Frameworks", + ); + LOCALIZATION_PREFERS_STRING_CATALOGS = YES; + MARKETING_VERSION = 1.0; + MTL_FAST_MATH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.mobileapp.store.ride.MyWidgetHome; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + SWIFT_EMIT_LOC_STRINGS = YES; + SWIFT_VERSION = 5.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Profile; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -820,6 +1033,16 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + C6E5BC662DCFF5F800471574 /* Build configuration list for PBXNativeTarget "MyWidgetHomeExtension" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C6E5BC622DCFF5F800471574 /* Debug */, + C6E5BC632DCFF5F800471574 /* Release */, + C6E5BC642DCFF5F800471574 /* Profile */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index b987148..85ec87e 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -41,11 +41,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 102 + 104 CFBundleSignature ???? CFBundleVersion - 5.0.992 + 5.0.994 NSHumanReadableCopyright FirebaseAppDelegateProxyEnabled diff --git a/lib/views/home/map_widget.dart/left_main_menu_icons.dart b/lib/views/home/map_widget.dart/left_main_menu_icons.dart index fe18320..7702fed 100644 --- a/lib/views/home/map_widget.dart/left_main_menu_icons.dart +++ b/lib/views/home/map_widget.dart/left_main_menu_icons.dart @@ -1,28 +1,12 @@ -import 'dart:io'; - -import 'package:Tripz/constant/links.dart'; -import 'package:Tripz/controller/auth/login_controller.dart'; -import 'package:Tripz/controller/functions/crud.dart'; -import 'package:Tripz/controller/functions/sms_controller.dart'; -import 'package:Tripz/views/widgets/error_snakbar.dart'; import 'package:flutter/services.dart'; -import 'package:Tripz/constant/box_name.dart'; -import 'package:Tripz/main.dart'; import 'package:flutter/material.dart'; import 'package:flutter_font_icons/flutter_font_icons.dart'; import 'package:get/get.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; -import 'package:jwt_decoder/jwt_decoder.dart'; -import 'package:secure_string_operations/secure_string_operations.dart'; -import '../../../constant/char_map.dart'; import '../../../constant/colors.dart'; -import '../../../constant/info.dart'; -import '../../../controller/functions/encrypt_decrypt.dart'; import '../../../controller/functions/tts.dart'; import '../../../controller/home/map_passenger_controller.dart'; import '../../../controller/home/vip_waitting_page.dart'; -import '../../../controller/payment/paymob/paymob_response.dart'; -import '../../../print.dart'; GetBuilder leftMainMenuIcons() { Get.put(TextToSpeechController()); @@ -70,7 +54,7 @@ GetBuilder leftMainMenuIcons() { onPressed: () => Get.to(() => VipWaittingPage()), tooltip: 'VIP Waiting Page', // More descriptive tooltip ), - const SizedBox(width: 8), + // const SizedBox(width: 8), _buildIconButtonWithAnimation( controller: controller, icon: Octicons.screen_full, @@ -96,35 +80,7 @@ class TestPage extends StatelessWidget { appBar: AppBar(), body: Center( child: TextButton( - onPressed: () async { - // bool isTokenExpired = JwtDecoder.isExpired(X - // .r(X.r(X.r(box.read(BoxName.jwt), cn), cC), cs) - // .toString() - // .split(AppInformation.addd)[0]); - - // if (isTokenExpired) { - // Log.print( - // 'isTokenExpired loginUsingCredentials: ${isTokenExpired}'); - // await LoginController().getJWT(); - // } - - // var res = await CRUD().get( - // link: 'https://server.sefer.click/sefer.click/sefer/test.php', - // payload: { - // 'email': box.read(BoxName.email).toString(), - // 'id': box.read(BoxName.passengerID).toString(), - // "platform": Platform.isAndroid ? 'android' : 'ios', - // "appName": AppInformation.appName, - // }); - // Log.print('res: ${res}'); - // var s = EncryptionHelper.instance.encryptData('Female'); - Log.print('s: ${box.read(BoxName.hmac)}'); - }, - - // uDG41L0K5vrem0eh87ZAf9leTrDUW0+twVRHQIQtxOWn4L6J5seU9x1tnRUUbGBb - - // uDG41L0K5vrem0eh87ZAf9leTrDUW0+twVRHQIQtxOU= - + onPressed: () async {}, child: Text( "Text Button", ), diff --git a/lib/views/widgets/error_snakbar.dart b/lib/views/widgets/error_snakbar.dart index 0a129e4..e968f24 100644 --- a/lib/views/widgets/error_snakbar.dart +++ b/lib/views/widgets/error_snakbar.dart @@ -1,123 +1,547 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:get/get.dart'; - +import 'dart:ui'; import '../../constant/colors.dart'; class SnackbarConfig { - static const duration = Duration(seconds: 3); - static const animationDuration = Duration(milliseconds: 300); - static const margin = EdgeInsets.symmetric(horizontal: 16, vertical: 10); - static const borderRadius = 12.0; - static const elevation = 6.0; + static const duration = Duration(seconds: 4); + static const animationDuration = Duration(milliseconds: 400); + static const margin = EdgeInsets.symmetric(horizontal: 16, vertical: 12); + static const borderRadius = 16.0; + static const elevation = 0.0; // تقليل الارتفاع لأننا سنستخدم تأثيرات زجاجية - static final BoxShadow shadow = BoxShadow( - color: Colors.black.withOpacity(0.1), - blurRadius: 10, - offset: const Offset(0, 2), + // تأثير زجاجي + static const double blurStrength = 15.0; + static const double opacity = 0.85; + + // حدود شفافة + static final Border glassBorder = Border.all( + color: Colors.white.withOpacity(0.25), + width: 1.5, ); + + // ظل أكثر نعومة وانتشار + static final List shadows = [ + BoxShadow( + color: Colors.black.withOpacity(0.15), + blurRadius: 12, + spreadRadius: 1, + offset: const Offset(0, 4), + ), + BoxShadow( + color: Colors.black.withOpacity(0.08), + blurRadius: 20, + spreadRadius: 0, + offset: const Offset(0, 2), + ), + ]; +} + +// تطبيق تأثير زجاجي باستخدام Container مخصص +class GlassSnackbar extends StatelessWidget { + final Color baseColor; + final Widget child; + + const GlassSnackbar({ + required this.baseColor, + required this.child, + Key? key, + }) : super(key: key); + + @override + Widget build(BuildContext context) { + return ClipRRect( + borderRadius: BorderRadius.circular(SnackbarConfig.borderRadius), + child: BackdropFilter( + filter: ImageFilter.blur( + sigmaX: SnackbarConfig.blurStrength, + sigmaY: SnackbarConfig.blurStrength, + ), + child: Container( + decoration: BoxDecoration( + color: baseColor.withOpacity(SnackbarConfig.opacity), + borderRadius: BorderRadius.circular(SnackbarConfig.borderRadius), + border: SnackbarConfig.glassBorder, + boxShadow: SnackbarConfig.shadows, + gradient: LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + baseColor.withOpacity(SnackbarConfig.opacity + 0.05), + baseColor.withOpacity(SnackbarConfig.opacity - 0.05), + ], + ), + ), + child: child, + ), + ), + ); + } } SnackbarController mySnackeBarError(String message) { - // Trigger error haptic feedback + // تأثير اهتزاز للأخطاء HapticFeedback.mediumImpact(); + final Color errorBaseColor = AppColor.redColor; + return Get.snackbar( - 'Error'.tr, - message, - backgroundColor: AppColor.redColor.withOpacity(0.95), - colorText: AppColor.secondaryColor, - icon: const Icon( - Icons.error_outline_rounded, - color: AppColor.secondaryColor, - size: 28, - ), - shouldIconPulse: true, + '', + '', snackPosition: SnackPosition.TOP, margin: SnackbarConfig.margin, - borderRadius: SnackbarConfig.borderRadius, duration: SnackbarConfig.duration, animationDuration: SnackbarConfig.animationDuration, - forwardAnimationCurve: Curves.easeOutCirc, - reverseAnimationCurve: Curves.easeInCirc, - boxShadows: [SnackbarConfig.shadow], - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), - titleText: Text( - 'Error'.tr, - style: const TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white, - fontSize: 16, - letterSpacing: 0.2, + borderRadius: SnackbarConfig.borderRadius, + backgroundColor: Colors.transparent, // شفاف لأننا سنستخدم حاوية مخصصة + barBlur: 0, // إيقاف تشويش الخلفية الافتراضي لأننا سنستخدم BlurFilter + overlayBlur: 1.5, + overlayColor: Colors.black12, + userInputForm: Form( + child: GlassSnackbar( + baseColor: errorBaseColor, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14), + child: Row( + children: [ + // أيقونة متحركة + TweenAnimationBuilder( + tween: Tween(begin: 0.0, end: 1.0), + duration: const Duration(milliseconds: 500), + curve: Curves.elasticOut, + builder: (context, value, child) { + return Transform.scale( + scale: value, + child: child, + ); + }, + child: Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.25), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.error_rounded, + color: Colors.white, + size: 26, + ), + ), + ), + const SizedBox(width: 16), + // محتوى النص + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Error'.tr, + style: const TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white, + fontSize: 16, + letterSpacing: 0.3, + shadows: [ + Shadow( + color: Colors.black26, + offset: Offset(0, 1), + blurRadius: 2, + ), + ], + ), + ), + const SizedBox(height: 4), + Text( + message, + style: const TextStyle( + color: Colors.white, + fontSize: 14, + height: 1.3, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + // زر الإغلاق + InkWell( + onTap: () { + HapticFeedback.lightImpact(); + Get.closeCurrentSnackbar(); + }, + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.close_rounded, + color: Colors.white, + size: 18, + ), + ), + ), + ], + ), + ), ), ), - messageText: Text( - message, - style: TextStyle( - color: Colors.white.withOpacity(0.95), - fontSize: 14, - height: 1.3, - ), - ), - onTap: (_) { - HapticFeedback.lightImpact(); - Get.closeCurrentSnackbar(); - }, isDismissible: true, dismissDirection: DismissDirection.horizontal, - overlayBlur: 0.8, - overlayColor: Colors.black12, + forwardAnimationCurve: Curves.easeOutBack, + reverseAnimationCurve: Curves.easeInCubic, ); } SnackbarController mySnackbarSuccess(String message) { - // Trigger success haptic feedback + // تأثير اهتزاز للنجاح HapticFeedback.lightImpact(); + final Color successBaseColor = AppColor.greenColor; + return Get.snackbar( - 'Success'.tr, - message, - backgroundColor: AppColor.greenColor.withOpacity(0.95), - colorText: AppColor.secondaryColor, - icon: const Icon( - Icons.check_circle_outline_rounded, - color: AppColor.secondaryColor, - size: 28, - ), - shouldIconPulse: true, + '', + '', snackPosition: SnackPosition.TOP, margin: SnackbarConfig.margin, - borderRadius: SnackbarConfig.borderRadius, duration: SnackbarConfig.duration, animationDuration: SnackbarConfig.animationDuration, - forwardAnimationCurve: Curves.easeOutCirc, - reverseAnimationCurve: Curves.easeInCirc, - boxShadows: [SnackbarConfig.shadow], - padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12), - titleText: Text( - 'Success'.tr, - style: const TextStyle( - fontWeight: FontWeight.w700, - color: Colors.white, - fontSize: 16, - letterSpacing: 0.2, + borderRadius: SnackbarConfig.borderRadius, + backgroundColor: Colors.transparent, // شفاف لأننا سنستخدم حاوية مخصصة + barBlur: 0, // إيقاف تشويش الخلفية الافتراضي لأننا سنستخدم BlurFilter + overlayBlur: 1.5, + overlayColor: Colors.black12, + userInputForm: Form( + child: GlassSnackbar( + baseColor: successBaseColor, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14), + child: Row( + children: [ + // أيقونة متحركة + TweenAnimationBuilder( + tween: Tween(begin: 0.0, end: 1.0), + duration: const Duration(milliseconds: 600), + curve: Curves.elasticOut, + builder: (context, value, child) { + return Transform.scale( + scale: value, + child: child, + ); + }, + child: Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.25), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.check_circle_rounded, + color: Colors.white, + size: 26, + ), + ), + ), + const SizedBox(width: 16), + // محتوى النص + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Success'.tr, + style: const TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white, + fontSize: 16, + letterSpacing: 0.3, + shadows: [ + Shadow( + color: Colors.black26, + offset: Offset(0, 1), + blurRadius: 2, + ), + ], + ), + ), + const SizedBox(height: 4), + Text( + message, + style: const TextStyle( + color: Colors.white, + fontSize: 14, + height: 1.3, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + // زر الإغلاق + InkWell( + onTap: () { + HapticFeedback.lightImpact(); + Get.closeCurrentSnackbar(); + }, + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.close_rounded, + color: Colors.white, + size: 18, + ), + ), + ), + ], + ), + ), ), ), - messageText: Text( - message, - style: TextStyle( - color: Colors.white.withOpacity(0.95), - fontSize: 14, - height: 1.3, - ), - ), - onTap: (_) { - HapticFeedback.lightImpact(); - Get.closeCurrentSnackbar(); - }, isDismissible: true, dismissDirection: DismissDirection.horizontal, - overlayBlur: 0.8, - overlayColor: Colors.black12, + forwardAnimationCurve: Curves.easeOutBack, + reverseAnimationCurve: Curves.easeInCubic, + ); +} + +// إضافة: دالة للمعلومات والتنبيهات +SnackbarController mySnackbarInfo(String message) { + // تأثير اهتزاز خفيف + HapticFeedback.selectionClick(); + + final Color infoBaseColor = Colors.blue; + + return Get.snackbar( + '', + '', + snackPosition: SnackPosition.TOP, + margin: SnackbarConfig.margin, + duration: SnackbarConfig.duration, + animationDuration: SnackbarConfig.animationDuration, + borderRadius: SnackbarConfig.borderRadius, + backgroundColor: Colors.transparent, // شفاف لأننا سنستخدم حاوية مخصصة + barBlur: 0, // إيقاف تشويش الخلفية الافتراضي لأننا سنستخدم BlurFilter + overlayBlur: 1.5, + overlayColor: Colors.black12, + userInputForm: Form( + child: GlassSnackbar( + baseColor: infoBaseColor, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14), + child: Row( + children: [ + // أيقونة متحركة + TweenAnimationBuilder( + tween: Tween(begin: 0.0, end: 1.0), + duration: const Duration(milliseconds: 500), + curve: Curves.elasticOut, + builder: (context, value, child) { + return Transform.scale( + scale: value, + child: child, + ); + }, + child: Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.25), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.info_rounded, + color: Colors.white, + size: 26, + ), + ), + ), + const SizedBox(width: 16), + // محتوى النص + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Info'.tr, + style: const TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white, + fontSize: 16, + letterSpacing: 0.3, + shadows: [ + Shadow( + color: Colors.black26, + offset: Offset(0, 1), + blurRadius: 2, + ), + ], + ), + ), + const SizedBox(height: 4), + Text( + message, + style: const TextStyle( + color: Colors.white, + fontSize: 14, + height: 1.3, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + // زر الإغلاق + InkWell( + onTap: () { + HapticFeedback.lightImpact(); + Get.closeCurrentSnackbar(); + }, + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.close_rounded, + color: Colors.white, + size: 18, + ), + ), + ), + ], + ), + ), + ), + ), + isDismissible: true, + dismissDirection: DismissDirection.horizontal, + forwardAnimationCurve: Curves.easeOutBack, + reverseAnimationCurve: Curves.easeInCubic, + ); +} + +// إضافة: دالة للتحذيرات +SnackbarController mySnackbarWarning(String message) { + // تأثير اهتزاز متوسط + HapticFeedback.mediumImpact(); + + final Color warningBaseColor = Colors.orange; + + return Get.snackbar( + '', + '', + snackPosition: SnackPosition.TOP, + margin: SnackbarConfig.margin, + duration: SnackbarConfig.duration, + animationDuration: SnackbarConfig.animationDuration, + borderRadius: SnackbarConfig.borderRadius, + backgroundColor: Colors.transparent, // شفاف لأننا سنستخدم حاوية مخصصة + barBlur: 0, // إيقاف تشويش الخلفية الافتراضي لأننا سنستخدم BlurFilter + overlayBlur: 1.5, + overlayColor: Colors.black12, + userInputForm: Form( + child: GlassSnackbar( + baseColor: warningBaseColor, + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 14), + child: Row( + children: [ + // أيقونة متحركة + TweenAnimationBuilder( + tween: Tween(begin: 0.0, end: 1.0), + duration: const Duration(milliseconds: 500), + curve: Curves.elasticOut, + builder: (context, value, child) { + return Transform.scale( + scale: value, + child: child, + ); + }, + child: Container( + padding: const EdgeInsets.all(8), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.25), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.warning_rounded, + color: Colors.white, + size: 26, + ), + ), + ), + const SizedBox(width: 16), + // محتوى النص + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + 'Warning'.tr, + style: const TextStyle( + fontWeight: FontWeight.w700, + color: Colors.white, + fontSize: 16, + letterSpacing: 0.3, + shadows: [ + Shadow( + color: Colors.black26, + offset: Offset(0, 1), + blurRadius: 2, + ), + ], + ), + ), + const SizedBox(height: 4), + Text( + message, + style: const TextStyle( + color: Colors.white, + fontSize: 14, + height: 1.3, + fontWeight: FontWeight.w400, + ), + ), + ], + ), + ), + // زر الإغلاق + InkWell( + onTap: () { + HapticFeedback.lightImpact(); + Get.closeCurrentSnackbar(); + }, + child: Container( + padding: const EdgeInsets.all(4), + decoration: BoxDecoration( + color: Colors.white.withOpacity(0.2), + shape: BoxShape.circle, + ), + child: const Icon( + Icons.close_rounded, + color: Colors.white, + size: 18, + ), + ), + ), + ], + ), + ), + ), + ), + isDismissible: true, + dismissDirection: DismissDirection.horizontal, + forwardAnimationCurve: Curves.easeOutBack, + reverseAnimationCurve: Curves.easeInCubic, ); } diff --git a/pubspec.lock b/pubspec.lock index b923e93..dfe695a 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -973,6 +973,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.3.2" + home_widget: + dependency: "direct main" + description: + name: home_widget + sha256: "7430f7549d42cef2e729bd3c779de748b93f1eb78b1abfe6bca8fffd1cfce3e9" + url: "https://pub.dev" + source: hosted + version: "0.7.0+1" html: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index e27ee02..cf9b2e0 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -71,6 +71,7 @@ dependencies: quick_actions: ^1.1.0 jwt_decoder: ^2.0.1 jailbreak_root_detection: ^1.1.5 + home_widget: ^0.7.0+1 dev_dependencies: flutter_test: