android app

main
Herwig Birke 2 months ago
parent 2836d8d1b2
commit 047bce9610

@ -1,4 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Internet permission required for HTTP/HTTPS requests (Dio, etc.) -->
<uses-permission android:name="android.permission.INTERNET" />
<!-- Optional: used by some libs to check connectivity state -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<application
android:label="multimediaflutter"
android:name="${applicationName}"

@ -25,5 +25,10 @@ public final class GeneratedPluginRegistrant {
} catch (Exception e) {
Log.e(TAG, "Error registering plugin sqflite_android, com.tekartik.sqflite.SqflitePlugin", e);
}
try {
flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
} catch (Exception e) {
Log.e(TAG, "Error registering plugin url_launcher_android, io.flutter.plugins.urllauncher.UrlLauncherPlugin", e);
}
}
}

@ -1,11 +1,11 @@
#!/bin/sh
# This is a generated file; do not edit or check into version control.
export "FLUTTER_ROOT=/home/ubuntu/flutter"
export "FLUTTER_APPLICATION_PATH=/home/ubuntu/projects/hello_world"
export "FLUTTER_ROOT=C:\dev\flutter"
export "FLUTTER_APPLICATION_PATH=C:\Users\herwi\Documents\GitHub\VSCode\flutter\multimedia_flutter"
export "COCOAPODS_PARALLEL_CODE_SIGN=true"
export "FLUTTER_TARGET=lib/main.dart"
export "FLUTTER_TARGET=lib\main.dart"
export "FLUTTER_BUILD_DIR=build"
export "FLUTTER_BUILD_NAME=1.0.0"
export "FLUTTER_BUILD_NAME=0.1.0"
export "FLUTTER_BUILD_NUMBER=1"
export "DART_OBFUSCATION=false"
export "TRACK_WIDGET_CREATION=true"

@ -1,13 +1,26 @@
import 'dart:io';
import 'package:flutter/foundation.dart';
import 'package:url_launcher/url_launcher.dart';
/// Opens a folder in the native file explorer.
/// Returns true if a launch was attempted.
Future<bool> openFolder(String path) async {
if (path.isEmpty) return false;
try {
if (kIsWeb) return false;
if (kIsWeb) {
final uri = _parseLaunchableUri(path);
if (uri != null) {
return await launchUrl(uri, mode: LaunchMode.platformDefault);
}
return false;
}
if (Platform.isAndroid || Platform.isIOS) {
final uri = _parseLaunchableUri(path);
if (uri != null) {
return await launchUrl(uri, mode: LaunchMode.externalApplication);
}
return false; // Non-HTTP paths (e.g., Windows shares) are not openable on mobile
}
if (Platform.isWindows) {
await Process.run('explorer', [path]);
return true;
@ -24,3 +37,15 @@ Future<bool> openFolder(String path) async {
return false;
}
Uri? _parseLaunchableUri(String input) {
final s = input.trim();
if (s.isEmpty) return null;
if (s.startsWith('http://') || s.startsWith('https://') || s.startsWith('content://') || s.startsWith('file://')) {
return Uri.tryParse(s);
}
// Allow smb:// or ftp:// if present
if (s.startsWith('smb://') || s.startsWith('ftp://')) {
return Uri.tryParse(s);
}
return null;
}

@ -155,6 +155,11 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
flutter_web_plugins:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
http:
dependency: transitive
description:
@ -464,6 +469,70 @@ packages:
url: "https://pub.dev"
source: hosted
version: "1.4.0"
url_launcher:
dependency: "direct main"
description:
name: url_launcher
sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
url: "https://pub.dev"
source: hosted
version: "6.3.1"
url_launcher_android:
dependency: transitive
description:
name: url_launcher_android
sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193"
url: "https://pub.dev"
source: hosted
version: "6.3.14"
url_launcher_ios:
dependency: transitive
description:
name: url_launcher_ios
sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
url: "https://pub.dev"
source: hosted
version: "6.3.3"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
url_launcher_macos:
dependency: transitive
description:
name: url_launcher_macos
sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
url: "https://pub.dev"
source: hosted
version: "3.2.2"
url_launcher_platform_interface:
dependency: transitive
description:
name: url_launcher_platform_interface
sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
url: "https://pub.dev"
source: hosted
version: "2.3.2"
url_launcher_web:
dependency: transitive
description:
name: url_launcher_web
sha256: "772638d3b34c779ede05ba3d38af34657a05ac55b06279ea6edd409e323dca8e"
url: "https://pub.dev"
source: hosted
version: "2.3.3"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77"
url: "https://pub.dev"
source: hosted
version: "3.1.4"
uuid:
dependency: transitive
description:

@ -13,6 +13,7 @@ dependencies:
dio: ^5.7.0
cached_network_image: ^3.3.1
intl: ^0.19.0
url_launcher: ^6.3.0
# Material 3 ist im Flutter SDK enthalten
@ -22,4 +23,4 @@ dev_dependencies:
flutter_lints: ^5.0.0
flutter:
uses-material-design: true
uses-material-design: true

@ -6,6 +6,9 @@
#include "generated_plugin_registrant.h"
#include <url_launcher_windows/url_launcher_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) {
UrlLauncherWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("UrlLauncherWindows"));
}

@ -3,6 +3,7 @@
#
list(APPEND FLUTTER_PLUGIN_LIST
url_launcher_windows
)
list(APPEND FLUTTER_FFI_PLUGIN_LIST

Loading…
Cancel
Save