feat: initial Cutdex application

Add the Flutter video editing application with project management, media
import, timeline editing, preview, AI assistance, diagnostics and settings.

Include shared UI and native host packages, platform runners, application
tests and release tooling.

Provide usage and contribution guides, the MIT license and third-party
notices. Exclude local credentials, build outputs and validation data.
This commit is contained in:
lingjhf committed 2026-10-05 23:36:23 +08:00
commit 27e77fff39
718 files changed
+183958

No files matched your search

@@ -0,0 +1,9 @@
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.cxx
@@ -0,0 +1,53 @@
group = "dev.cutdex.cutdex_native"
version = "0.1.0"
buildscript {
val kotlinVersion = "2.4.0"
repositories {
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:9.1.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
plugins {
id("com.android.library")
}
android {
namespace = "dev.cutdex.cutdex_native"
compileSdk = 36
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
sourceSets {
getByName("main") {
java.srcDirs("src/main/kotlin")
}
}
defaultConfig {
minSdk = 24
}
}
kotlin {
compilerOptions {
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
}
}
@@ -0,0 +1 @@
rootProject.name = "cutdex_native"
@@ -0,0 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
@@ -0,0 +1,84 @@
package dev.cutdex.cutdex_native
import android.app.Activity
import android.content.Context
import android.os.Build
import android.util.DisplayMetrics
import io.flutter.embedding.engine.plugins.FlutterPlugin
import io.flutter.embedding.engine.plugins.activity.ActivityAware
import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
import io.flutter.plugin.common.MethodCall
import io.flutter.plugin.common.MethodChannel
class CutdexNativePlugin : FlutterPlugin, ActivityAware, MethodChannel.MethodCallHandler {
private var channel: MethodChannel? = null
private var activity: Activity? = null
private var context: Context? = null
override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) {
context = binding.applicationContext
channel = MethodChannel(binding.binaryMessenger, "cutdex_native/device_info").also {
it.setMethodCallHandler(this)
}
}
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
if (call.method == "getApplicationInfo") {
val host = context ?: return result.error("unavailable", "No application context.", null)
try {
@Suppress("DEPRECATION")
val info = host.packageManager.getPackageInfo(host.packageName, 0)
@Suppress("DEPRECATION")
val build = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) info.longVersionCode else info.versionCode.toLong()
result.success(mapOf("appVersion" to (info.versionName ?: "unknown"), "appBuild" to build.toString()))
} catch (error: Exception) {
result.error("unavailable", "Application metadata unavailable.", null)
}
return
}
if (call.method != "getDeviceInfo") {
result.notImplemented()
return
}
val host = activity
if (host == null) {
result.error("unavailable", "No activity is attached.", null)
return
}
// Maximum bounds do not shrink with the app's split-screen window.
val shortestSideDp = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
val bounds = host.windowManager.maximumWindowMetrics.bounds
minOf(bounds.width(), bounds.height()) / host.resources.displayMetrics.density
} else {
@Suppress("DEPRECATION")
val metrics = DisplayMetrics().also {
host.windowManager.defaultDisplay.getRealMetrics(it)
}
minOf(metrics.widthPixels, metrics.heightPixels) / metrics.density
}
result.success(mapOf("displayShortestSideDp" to shortestSideDp.toDouble()))
}
override fun onAttachedToActivity(binding: ActivityPluginBinding) {
activity = binding.activity
}
override fun onDetachedFromActivityForConfigChanges() {
activity = null
}
override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {
activity = binding.activity
}
override fun onDetachedFromActivity() {
activity = null
}
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {
channel?.setMethodCallHandler(null)
channel = null
activity = null
context = null
}
}