Compare commits
58
Commits
main
...
2a4f8fc335
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a4f8fc335 | ||
|
|
efcfb609d5 | ||
|
|
dba0e9d6cd | ||
|
|
93d15dd59f | ||
|
|
0a8ef32fe4 | ||
|
|
0b54a5126d | ||
|
|
927f805484 | ||
|
|
5230d7dcca | ||
|
|
d05d5242db | ||
|
|
aa2d7a0194 | ||
|
|
340a66bfb2 | ||
|
|
467470ce90 | ||
|
|
3f37619744 | ||
|
|
f57088b04a | ||
|
|
278750083e | ||
|
|
854efa1986 | ||
|
|
af92616ef7 | ||
|
|
fa9c15f7c8 | ||
|
|
ad3591b042 | ||
|
|
c6bcf88caf | ||
|
|
4e19c82046 | ||
|
|
0e52ced016 | ||
|
|
3ffa70486e | ||
|
|
e6b81acaf3 | ||
|
|
4fb5cbd567 | ||
|
|
8013646d0d | ||
|
|
66d72b9b1d | ||
|
|
17bfc6faee | ||
|
|
967cd86849 | ||
|
|
9ae836b2a1 | ||
|
|
8b55983dd6 | ||
|
|
ffb4c5876c | ||
|
|
ff68b8b145 | ||
|
|
e15bba626d | ||
|
|
42642c2ef3 | ||
|
|
35860df873 | ||
|
|
47b3e2e15d | ||
|
|
c4c6097828 | ||
|
|
1fdcc3773d | ||
|
|
2e489a97a4 | ||
|
|
aa06f86854 | ||
|
|
13e99257b8 | ||
|
|
6dbb7f4ca9 | ||
|
|
b0d343e6fc | ||
|
|
bab3893f8a | ||
|
|
e055ef5484 | ||
|
|
39514dc0f6 | ||
|
|
0564cab301 | ||
|
|
b5943099ff | ||
|
|
929f2ce729 | ||
|
|
75210e29bc | ||
|
|
cb1c0a8e05 | ||
|
|
0fb3e74cf7 | ||
|
|
26a3940365 | ||
|
|
724b6d47e3 | ||
|
|
a858d66653 | ||
|
|
6348f74b95 | ||
|
|
bf9a57f23b |
@@ -43,3 +43,12 @@ app.*.map.json
|
||||
/android/app/debug
|
||||
/android/app/profile
|
||||
/android/app/release
|
||||
|
||||
# Place unity project here
|
||||
/unity
|
||||
|
||||
# flutter will place unity Library dependency here
|
||||
/unityLibrary
|
||||
|
||||
# unityLibrary will place build here
|
||||
/android/unityLibrary
|
||||
@@ -1,16 +1,239 @@
|
||||
# furibase
|
||||
# Furikake App
|
||||
|
||||
A new Flutter project.
|
||||
Project ini adalah aplikasi mobile Furikake.
|
||||
|
||||
## Getting Started
|
||||
## Konfiguras dan perubahan android app
|
||||
|
||||
This project is a starting point for a Flutter application.
|
||||
Edit android/app/src/main/kotlin ... /MainActivity.kt
|
||||
|
||||
A few resources to get you started if this is your first Flutter project:
|
||||
```
|
||||
package com.paj.freekake
|
||||
|
||||
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.android.FlutterFragmentActivity;
|
||||
|
||||
For help getting started with Flutter development, view the
|
||||
[online documentation](https://docs.flutter.dev/), which offers tutorials,
|
||||
samples, guidance on mobile development, and a full API reference.
|
||||
//class MainActivity : FlutterActivity()
|
||||
class MainActivity: FlutterFragmentActivity() {
|
||||
}
|
||||
```
|
||||
|
||||
Gunakan konfigurasi ini pada file android/settings.gradle.kts
|
||||
|
||||
```
|
||||
pluginManagement {
|
||||
val flutterSdkPath = run {
|
||||
val properties = java.util.Properties()
|
||||
file("local.properties").inputStream().use { properties.load(it) }
|
||||
val flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
|
||||
flutterSdkPath
|
||||
}
|
||||
|
||||
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
|
||||
|
||||
repositories {
|
||||
google()
|
||||
mavenCentral()
|
||||
gradlePluginPortal()
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.9.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
|
||||
include(":unityLibrary")
|
||||
project(":unityLibrary").projectDir = file("./unityLibrary")
|
||||
|
||||
include(":unityLibrary:xrmanifest.androidlib")
|
||||
//project(":unityLibrary:xrmanifest.androidlib").projectDir = file("unityLibrary/xrmanifest.androidlib")
|
||||
|
||||
//include(":unityLibrary:mobilenotifications.androidlib")
|
||||
//project(":unityLibrary:mobilenotifications.androidlib").projectDir = file("unityLibrary/mobilenotifications.androidlib")
|
||||
|
||||
```
|
||||
|
||||
Gunakan konfigurasi ini pada android/app/build.gradle.kts
|
||||
|
||||
```
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("kotlin-android")
|
||||
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
|
||||
id("dev.flutter.flutter-gradle-plugin")
|
||||
}
|
||||
|
||||
android {
|
||||
namespace = "com.paj.freekake"
|
||||
//compileSdk = flutter.compileSdkVersion
|
||||
compileSdk = 35
|
||||
//ndkVersion = "27.0.12077973"
|
||||
//ndkVersion = flutter.ndkVersion
|
||||
ndkVersion = "23.1.7779620"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.paj.freekake"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
//minSdk = flutter.minSdkVersion
|
||||
//targetSdk = flutter.targetSdkVersion
|
||||
//minSdk = 24 // Set to 24 or higher
|
||||
minSdk = 30
|
||||
targetSdk = 35
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
release {
|
||||
// TODO: Add your own signing config for the release build.
|
||||
// Signing with the debug keys for now, so `flutter run --release` works.
|
||||
signingConfig = signingConfigs.getByName("debug")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":unityLibrary"))
|
||||
implementation(project(":flutter_unity_widget"))
|
||||
}
|
||||
```
|
||||
|
||||
## Konfigurasi UnityLibrary
|
||||
|
||||
Gunakan konfigurasi ini pada file android/unityLibrary/build.gradle:
|
||||
|
||||
```
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation(name: 'unity-classes', ext:'jar')
|
||||
implementation(name: 'arcore_client', ext:'aar')
|
||||
implementation(name: 'ARPresto', ext:'aar')
|
||||
implementation(name: 'UnityARCore', ext:'aar')
|
||||
implementation(name: 'unityandroidpermissions', ext:'aar')
|
||||
implementation project('xrmanifest.androidlib')
|
||||
//implementation project('mobilenotifications.androidlib')
|
||||
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "com.unity3d.player"
|
||||
// ndkPath "/Applications/Unity/Hub/Editor/2022.3.60f1/PlaybackEngines/AndroidPlayer/NDK"
|
||||
compileSdkVersion 35
|
||||
buildToolsVersion '34.0.0'
|
||||
ndkVersion "23.1.7779620"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 30
|
||||
targetSdkVersion 35
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
versionCode 1
|
||||
versionName '1.0.2'
|
||||
consumerProguardFiles 'proguard-unity.txt'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
aaptOptions {
|
||||
noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp']
|
||||
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
doNotStrip '*/armeabi-v7a/*.so'
|
||||
doNotStrip '*/arm64-v8a/*.so'
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def getSdkDir() {
|
||||
Properties local = new Properties()
|
||||
local.load(new FileInputStream("${rootDir}/local.properties"))
|
||||
return local.getProperty('sdk.dir')
|
||||
}
|
||||
|
||||
def BuildIl2Cpp(String workingDir, String configuration, String architecture, String abi, String[] staticLibraries) {
|
||||
def commandLineArgs = []
|
||||
commandLineArgs.add("--compile-cpp")
|
||||
commandLineArgs.add("--platform=Android")
|
||||
commandLineArgs.add("--architecture=" + architecture)
|
||||
commandLineArgs.add("--outputpath=" + workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.so")
|
||||
commandLineArgs.add("--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi)
|
||||
commandLineArgs.add("--incremental-g-c-time-slice=3")
|
||||
commandLineArgs.add("--dotnetprofile=unityaot-linux")
|
||||
commandLineArgs.add("--enable-debugger")
|
||||
commandLineArgs.add("--profiler-report")
|
||||
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_conv.traceevents")
|
||||
commandLineArgs.add("--print-command-line")
|
||||
commandLineArgs.add("--data-folder=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput/data")
|
||||
commandLineArgs.add("--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput")
|
||||
commandLineArgs.add("--cachedirectory=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_cache")
|
||||
commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory)
|
||||
staticLibraries.eachWithIndex {fileName, i->
|
||||
commandLineArgs.add("--additional-libraries=" + workingDir + "/src/main/jniStaticLibs/" + abi + "/" + fileName)
|
||||
}
|
||||
def executableExtension = ""
|
||||
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
|
||||
executableExtension = ".exe"
|
||||
commandLineArgs = commandLineArgs*.replace('\"', '\\\"')
|
||||
}
|
||||
exec {
|
||||
executable workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp" + executableExtension
|
||||
args commandLineArgs
|
||||
environment "ANDROID_SDK_ROOT", getSdkDir()
|
||||
}
|
||||
delete workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.sym.so"
|
||||
ant.move(file: workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so")
|
||||
}
|
||||
|
||||
android {
|
||||
task BuildIl2CppTask {
|
||||
doLast {
|
||||
BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), 'Debug', 'armv7', 'armeabi-v7a', [ ] as String[]);
|
||||
BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), 'Debug', 'arm64', 'arm64-v8a', [ ] as String[]);
|
||||
}
|
||||
}
|
||||
afterEvaluate {
|
||||
if (project(':unityLibrary').tasks.findByName('mergeDebugJniLibFolders'))
|
||||
project(':unityLibrary').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask
|
||||
if (project(':unityLibrary').tasks.findByName('mergeReleaseJniLibFolders'))
|
||||
project(':unityLibrary').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
jni.srcDirs = ["src/main/Il2CppOutputProject"]
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
@@ -9,26 +9,28 @@ android {
|
||||
namespace = "com.example.furibase"
|
||||
//compileSdk = flutter.compileSdkVersion
|
||||
compileSdk = 35
|
||||
ndkVersion = "27.0.12077973"
|
||||
//ndkVersion = "27.0.12077973"
|
||||
//ndkVersion = flutter.ndkVersion
|
||||
ndkVersion = "23.1.7779620"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_11
|
||||
targetCompatibility = JavaVersion.VERSION_11
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
|
||||
kotlinOptions {
|
||||
jvmTarget = JavaVersion.VERSION_11.toString()
|
||||
jvmTarget = JavaVersion.VERSION_17.toString()
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||
applicationId = "com.example.furibase"
|
||||
applicationId = "com.paj.freekake"
|
||||
// You can update the following values to match your application needs.
|
||||
// For more information, see: https://flutter.dev/to/review-gradle-config.
|
||||
//minSdk = flutter.minSdkVersion
|
||||
//targetSdk = flutter.targetSdkVersion
|
||||
minSdk = 24 // Set to 24 or higher
|
||||
//minSdk = 24 // Set to 24 or higher
|
||||
minSdk = 30
|
||||
targetSdk = 35
|
||||
versionCode = flutter.versionCode
|
||||
versionName = flutter.versionName
|
||||
@@ -50,3 +52,8 @@ android {
|
||||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":unityLibrary"))
|
||||
implementation(project(":flutter_unity_widget"))
|
||||
}
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.example.furibase
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
|
||||
class MainActivity : FlutterActivity()
|
||||
@@ -0,0 +1,8 @@
|
||||
package com.paj.freekake
|
||||
|
||||
import io.flutter.embedding.android.FlutterActivity
|
||||
import io.flutter.embedding.android.FlutterFragmentActivity;
|
||||
|
||||
//class MainActivity : FlutterActivity()
|
||||
class MainActivity: FlutterFragmentActivity() {
|
||||
}
|
||||
@@ -1,5 +1,11 @@
|
||||
allprojects {
|
||||
repositories {
|
||||
flatDir {
|
||||
dirs(
|
||||
file("${project(":unityLibrary").projectDir}/libs")
|
||||
)
|
||||
}
|
||||
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -12,6 +18,39 @@ subprojects {
|
||||
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
|
||||
project.layout.buildDirectory.value(newSubprojectBuildDir)
|
||||
}
|
||||
|
||||
subprojects {
|
||||
afterEvaluate {
|
||||
if (project.extensions.findByName("android") != null) {
|
||||
extensions.configure<com.android.build.gradle.BaseExtension>("android") {
|
||||
if (namespace == null) {
|
||||
namespace = project.group.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (plugins.hasPlugin("com.android.application") || plugins.hasPlugin("com.android.library")) {
|
||||
if (name == "flutter_unity_widget") {
|
||||
extensions.configure<com.android.build.gradle.BaseExtension>("android") {
|
||||
compileOptions {
|
||||
sourceCompatibility = JavaVersion.VERSION_17
|
||||
targetCompatibility = JavaVersion.VERSION_17
|
||||
}
|
||||
(this as ExtensionAware).extensions.configure<org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions>("kotlinOptions") {
|
||||
jvmTarget = "17"
|
||||
}
|
||||
|
||||
if (namespace == null) {
|
||||
namespace = project.group.toString()
|
||||
}
|
||||
|
||||
compileSdkVersion(35)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
subprojects {
|
||||
project.evaluationDependsOn(":app")
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
# org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
|
||||
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
|
||||
android.useAndroidX=true
|
||||
android.enableJetifier=true
|
||||
|
||||
@@ -18,8 +18,30 @@ pluginManagement {
|
||||
|
||||
plugins {
|
||||
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
|
||||
id("com.android.application") version "8.7.0" apply false
|
||||
id("com.android.application") version "8.9.0" apply false
|
||||
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
|
||||
}
|
||||
|
||||
include(":app")
|
||||
|
||||
include(":unityLibrary")
|
||||
project(":unityLibrary").projectDir = file("./unityLibrary")
|
||||
|
||||
include(":unityLibrary:xrmanifest.androidlib")
|
||||
// project(":unityLibrary:xrmanifest.androidlib").projectDir = file("unityLibrary/xrmanifest.androidlib")
|
||||
|
||||
// include(":unityLibrary:mobilenotifications.androidlib")
|
||||
// project(":unityLibrary:mobilenotifications.androidlib").projectDir = file("unityLibrary/mobilenotifications.androidlib")
|
||||
|
||||
|
||||
|
||||
include(":unityLibrary")
|
||||
project(":unityLibrary").projectDir = file("./unityLibrary")
|
||||
|
||||
|
||||
include(":unityLibrary")
|
||||
project(":unityLibrary").projectDir = file("./unityLibrary")
|
||||
|
||||
|
||||
include(":unityLibrary")
|
||||
project(":unityLibrary").projectDir = file("./unityLibrary")
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
|
||||
dependencies {
|
||||
implementation(name: 'unity-classes', ext:'jar')
|
||||
implementation(name: 'arcore_client', ext:'aar')
|
||||
implementation(name: 'ARPresto', ext:'aar')
|
||||
implementation(name: 'UnityARCore', ext:'aar')
|
||||
implementation(name: 'unityandroidpermissions', ext:'aar')
|
||||
implementation project('xrmanifest.androidlib')
|
||||
//implementation project('mobilenotifications.androidlib')
|
||||
|
||||
}
|
||||
|
||||
android {
|
||||
namespace "com.unity3d.player"
|
||||
// ndkPath "/Applications/Unity/Hub/Editor/2022.3.60f1/PlaybackEngines/AndroidPlayer/NDK"
|
||||
compileSdkVersion 35
|
||||
buildToolsVersion '34.0.0'
|
||||
ndkVersion "23.1.7779620"
|
||||
|
||||
compileOptions {
|
||||
sourceCompatibility JavaVersion.VERSION_11
|
||||
targetCompatibility JavaVersion.VERSION_11
|
||||
}
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion 30
|
||||
targetSdkVersion 35
|
||||
ndk {
|
||||
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
||||
}
|
||||
versionCode 1
|
||||
versionName '1.0.2'
|
||||
consumerProguardFiles 'proguard-unity.txt'
|
||||
}
|
||||
|
||||
lintOptions {
|
||||
abortOnError false
|
||||
}
|
||||
|
||||
aaptOptions {
|
||||
noCompress = ['.unity3d', '.ress', '.resource', '.obb', '.bundle', '.unityexp']
|
||||
ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~"
|
||||
}
|
||||
|
||||
packagingOptions {
|
||||
doNotStrip '*/armeabi-v7a/*.so'
|
||||
doNotStrip '*/arm64-v8a/*.so'
|
||||
jniLibs {
|
||||
useLegacyPackaging true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def getSdkDir() {
|
||||
Properties local = new Properties()
|
||||
local.load(new FileInputStream("${rootDir}/local.properties"))
|
||||
return local.getProperty('sdk.dir')
|
||||
}
|
||||
|
||||
def BuildIl2Cpp(String workingDir, String configuration, String architecture, String abi, String[] staticLibraries) {
|
||||
def commandLineArgs = []
|
||||
commandLineArgs.add("--compile-cpp")
|
||||
commandLineArgs.add("--platform=Android")
|
||||
commandLineArgs.add("--architecture=" + architecture)
|
||||
commandLineArgs.add("--outputpath=" + workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.so")
|
||||
commandLineArgs.add("--baselib-directory=" + workingDir + "/src/main/jniStaticLibs/" + abi)
|
||||
commandLineArgs.add("--incremental-g-c-time-slice=3")
|
||||
commandLineArgs.add("--dotnetprofile=unityaot-linux")
|
||||
commandLineArgs.add("--enable-debugger")
|
||||
commandLineArgs.add("--profiler-report")
|
||||
commandLineArgs.add("--profiler-output-file=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_conv.traceevents")
|
||||
commandLineArgs.add("--print-command-line")
|
||||
commandLineArgs.add("--data-folder=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput/data")
|
||||
commandLineArgs.add("--generatedcppdir=" + workingDir + "/src/main/Il2CppOutputProject/Source/il2cppOutput")
|
||||
commandLineArgs.add("--cachedirectory=" + workingDir + "/build/il2cpp_"+ abi + "_" + configuration + "/il2cpp_cache")
|
||||
commandLineArgs.add("--tool-chain-path=" + android.ndkDirectory)
|
||||
staticLibraries.eachWithIndex {fileName, i->
|
||||
commandLineArgs.add("--additional-libraries=" + workingDir + "/src/main/jniStaticLibs/" + abi + "/" + fileName)
|
||||
}
|
||||
def executableExtension = ""
|
||||
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
|
||||
executableExtension = ".exe"
|
||||
commandLineArgs = commandLineArgs*.replace('\"', '\\\"')
|
||||
}
|
||||
exec {
|
||||
executable workingDir + "/src/main/Il2CppOutputProject/IL2CPP/build/deploy/il2cpp" + executableExtension
|
||||
args commandLineArgs
|
||||
environment "ANDROID_SDK_ROOT", getSdkDir()
|
||||
}
|
||||
delete workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.sym.so"
|
||||
ant.move(file: workingDir + "/src/main/jniLibs/" + abi + "/libil2cpp.dbg.so", tofile: workingDir + "/symbols/" + abi + "/libil2cpp.so")
|
||||
}
|
||||
|
||||
android {
|
||||
task BuildIl2CppTask {
|
||||
doLast {
|
||||
BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), 'Debug', 'armv7', 'armeabi-v7a', [ ] as String[]);
|
||||
BuildIl2Cpp(projectDir.toString().replaceAll('\\\\', '/'), 'Debug', 'arm64', 'arm64-v8a', [ ] as String[]);
|
||||
}
|
||||
}
|
||||
afterEvaluate {
|
||||
if (project(':unityLibrary').tasks.findByName('mergeDebugJniLibFolders'))
|
||||
project(':unityLibrary').mergeDebugJniLibFolders.dependsOn BuildIl2CppTask
|
||||
if (project(':unityLibrary').tasks.findByName('mergeReleaseJniLibFolders'))
|
||||
project(':unityLibrary').mergeReleaseJniLibFolders.dependsOn BuildIl2CppTask
|
||||
}
|
||||
sourceSets {
|
||||
main {
|
||||
jni.srcDirs = ["src/main/Il2CppOutputProject"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import 'package:freekake/components/navbar_shape_3.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:furibase/components/navbar_container.dart';
|
||||
import 'package:furibase/components/navbar_shape_1.dart';
|
||||
import 'package:furibase/components/navbar_shape_2.dart';
|
||||
import 'package:furibase/components/navbar_shape_3.dart';
|
||||
import 'package:furibase/components/custom_shape.dart';
|
||||
|
||||
class BottomNavbar extends StatefulWidget {
|
||||
const BottomNavbar({super.key});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import 'package:freekake/components/menu_button.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:freekake/providers/menu_selection_provider.dart';
|
||||
import 'package:freekake/screen/Home_screen.dart';
|
||||
import 'package:freekake/screen/koleksi_screen.dart';
|
||||
|
||||
@@ -28,8 +28,8 @@ class MenuButton extends StatelessWidget {
|
||||
IconButton(
|
||||
icon: SvgPicture.asset(
|
||||
icon ?? '',
|
||||
width: w ?? 28,
|
||||
height: h ?? 28,
|
||||
width: w ?? 24,
|
||||
height: h ?? 24,
|
||||
// allowDrawingOutsideViewBox: true,
|
||||
colorFilter: ColorFilter.mode(
|
||||
(isSelected ?? false)
|
||||
@@ -48,6 +48,7 @@ class MenuButton extends StatelessWidget {
|
||||
? Color.fromARGB(255, 216, 182, 10)
|
||||
: Color.fromARGB(255, 239, 224, 232),
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 10,
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'package:freekake/screen/camera_screen.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_svg/svg.dart';
|
||||
// import 'package:freekake/screen/camera_screen.dart';
|
||||
import 'package:freekake/screen/camera_screen.dart';
|
||||
|
||||
class ScanButton extends StatelessWidget {
|
||||
const ScanButton({super.key});
|
||||
@@ -45,4 +45,4 @@ class ScanButton extends StatelessWidget {
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import 'dart:io';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
|
||||
class ImagePickerHelper {
|
||||
Future<dynamic> pickImage() async {
|
||||
final ImagePicker picker = ImagePicker();
|
||||
final XFile? pickedFile = await picker.pickImage(source: ImageSource.gallery);
|
||||
|
||||
if (pickedFile != null) {
|
||||
File imageFile = File(pickedFile.path);
|
||||
return imageFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
class ImagePickerHelper {
|
||||
Future<void> pickImage() async {
|
||||
throw UnsupportedError('pickImage is not supported on this platform');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// import 'package:image_picker_web/image_picker_web.dart';
|
||||
// import 'dart:typed_data';
|
||||
|
||||
// class ImagePickerHelper {
|
||||
// Future<dynamic> pickImage() async {
|
||||
// Uint8List? bytesFromPicker = await ImagePickerWeb.getImageAsBytes();
|
||||
// if (bytesFromPicker != null) {
|
||||
// return bytesFromPicker;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
import 'dart:typed_data';
|
||||
import 'dart:html' as html;
|
||||
|
||||
class ImagePickerHelper {
|
||||
Future<void> pickImage() async {
|
||||
html.FileUploadInputElement uploadInput = html.FileUploadInputElement();
|
||||
uploadInput.accept = 'image/*';
|
||||
uploadInput.click();
|
||||
|
||||
uploadInput.onChange.listen((event) async {
|
||||
final file = uploadInput.files!.first;
|
||||
final reader = html.FileReader();
|
||||
|
||||
reader.readAsArrayBuffer(file);
|
||||
reader.onLoadEnd.listen((event) {
|
||||
Uint8List imageBytes = reader.result as Uint8List;
|
||||
if (imageBytes != null) {
|
||||
return imageBytes;
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export 'image_picker_stub.dart'
|
||||
if (dart.library.html) 'image_picker_web.dart'
|
||||
if (dart.library.io) 'image_picker_mobile.dart';
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:freekake/components/navbar_container.dart';
|
||||
import 'package:freekake/providers/character_provider.dart';
|
||||
import 'package:freekake/providers/menu_selection_provider.dart';
|
||||
import 'package:freekake/screen/Home_screen.dart';
|
||||
@@ -30,7 +30,7 @@ class MyApp extends StatelessWidget {
|
||||
],
|
||||
child: MaterialApp(
|
||||
debugShowCheckedModeBanner: false,
|
||||
title: 'AR Character App',
|
||||
title: 'Freekake',
|
||||
theme: ThemeData.dark(),
|
||||
home:
|
||||
// DrawScreen(),
|
||||
|
||||
+208
-134
@@ -5,6 +5,7 @@ import 'package:freekake/components/buildcard_info.dart';
|
||||
import 'package:freekake/components/main_menu.dart';
|
||||
import 'package:freekake/components/menu_item.dart';
|
||||
import 'package:freekake/components/scan_button.dart';
|
||||
import 'package:flutter_unity_widget/flutter_unity_widget.dart';
|
||||
|
||||
class HomeScreen extends StatefulWidget {
|
||||
const HomeScreen({super.key});
|
||||
@@ -16,6 +17,7 @@ class HomeScreen extends StatefulWidget {
|
||||
class _HomeScreenState extends State<HomeScreen> {
|
||||
final String username = "luffy01";
|
||||
// Image image
|
||||
late UnityWidgetController _unityWidgetController;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -59,146 +61,163 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
right: 0,
|
||||
top: 100,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(right: 20),
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(1),
|
||||
color: Color.fromARGB(1, 209, 174, 174).withAlpha(0),
|
||||
),
|
||||
child: Center(
|
||||
child: DropdownButtonHideUnderline(
|
||||
child: DropdownButton2(
|
||||
customButton: Container(
|
||||
height: 50,
|
||||
width: 50,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
image: const DecorationImage(
|
||||
image: AssetImage('assets/images/cepot-u.png'),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
openWithLongPress: false,
|
||||
items: [
|
||||
..._MenuItems.firstItems.map(
|
||||
(item) => DropdownMenuItem<MenuItem>(
|
||||
value: item,
|
||||
child: _MenuItems.buildItem(item),
|
||||
),
|
||||
),
|
||||
],
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
_MenuItems.onChanged(context, value);
|
||||
} else {
|
||||
print("null");
|
||||
}
|
||||
},
|
||||
buttonStyleData: ButtonStyleData(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
),
|
||||
dropdownStyleData: DropdownStyleData(
|
||||
width: 140,
|
||||
padding: EdgeInsets.zero,
|
||||
maxHeight: 150,
|
||||
// padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
color: Color.fromRGBO(2, 104, 17, 1).withAlpha(50),
|
||||
),
|
||||
offset: const Offset(40, -4),
|
||||
),
|
||||
menuItemStyleData: MenuItemStyleData(
|
||||
height: 35,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
),
|
||||
// menuItemStyleData: const MenuItemStyleData(
|
||||
// padding: EdgeInsets.only(left: 16, right: 16),
|
||||
// ),
|
||||
),
|
||||
// Positioned(
|
||||
// top: 0,
|
||||
// left: 0,
|
||||
// right: 0,
|
||||
// child: SizedBox(height: 120, child: TopbarContainer()),
|
||||
// ),
|
||||
// Positioned(
|
||||
// right: 0,
|
||||
// top: 100,
|
||||
// child: Padding(
|
||||
// padding: EdgeInsets.only(right: 20),
|
||||
// child: Container(
|
||||
// width: 40,
|
||||
// height: 40,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(1),
|
||||
// color: Color.fromARGB(1, 209, 174, 174).withAlpha(0),
|
||||
// ),
|
||||
// child: Center(
|
||||
// child: DropdownButtonHideUnderline(
|
||||
// child: DropdownButton2(
|
||||
// customButton: Container(
|
||||
// height: 50,
|
||||
// width: 50,
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// image: const DecorationImage(
|
||||
// image: AssetImage('assets/images/luffy-u.png'),
|
||||
// fit: BoxFit.cover,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// openWithLongPress: false,
|
||||
// items: [
|
||||
// ..._MenuItems.firstItems.map(
|
||||
// (item) => DropdownMenuItem<_MenuItem>(
|
||||
// value: item,
|
||||
// child: _MenuItems.buildItem(item),
|
||||
// ),
|
||||
// ),
|
||||
// // const DropdownMenuItem<Divider>(
|
||||
// // enabled: false,
|
||||
// // // height: 8,
|
||||
// // child: Divider(),
|
||||
// // ),
|
||||
// // ..._MenuItems.secondItems.map(
|
||||
// // (item) => DropdownMenuItem<_MenuItem>(
|
||||
// // value: item,
|
||||
// // // height: 48,
|
||||
// // child: _MenuItems.buildItem(item),
|
||||
// // ),
|
||||
// // ),
|
||||
// ],
|
||||
// onChanged: (value) {
|
||||
// if (value != null) {
|
||||
// _MenuItems.onChanged(context, value);
|
||||
// } else {
|
||||
// print("null");
|
||||
// }
|
||||
// },
|
||||
// buttonStyleData: ButtonStyleData(
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(40),
|
||||
// ),
|
||||
// ),
|
||||
// dropdownStyleData: DropdownStyleData(
|
||||
// width: 140,
|
||||
// padding: EdgeInsets.zero,
|
||||
// maxHeight: 150,
|
||||
// // padding: const EdgeInsets.symmetric(vertical: 6),
|
||||
// decoration: BoxDecoration(
|
||||
// borderRadius: BorderRadius.circular(4),
|
||||
// color: Color.fromRGBO(2, 104, 17, 1).withAlpha(50),
|
||||
// ),
|
||||
// offset: const Offset(40, -4),
|
||||
// ),
|
||||
// menuItemStyleData: MenuItemStyleData(
|
||||
// height: 35,
|
||||
// padding: EdgeInsets.symmetric(horizontal: 10),
|
||||
// ),
|
||||
// // menuItemStyleData: const MenuItemStyleData(
|
||||
// // padding: EdgeInsets.only(left: 16, right: 16),
|
||||
// // ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 10,
|
||||
right: 10,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
BuildcardInfo(
|
||||
icon: Icons.person,
|
||||
text: username,
|
||||
extraIcon: Icons.emoji_events,
|
||||
extraText: "5000",
|
||||
width: 180,
|
||||
),
|
||||
),
|
||||
BuildcardInfo(
|
||||
icon: Icons.monetization_on,
|
||||
text: "1.300",
|
||||
width: 90,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
top: 10,
|
||||
left: 10,
|
||||
right: 10,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// Positioned(
|
||||
// bottom: 150,
|
||||
// left: 0,
|
||||
// right: 0,
|
||||
// child: Column(
|
||||
// children: [
|
||||
// Container(
|
||||
// padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
// decoration: BoxDecoration(
|
||||
// color: Color.fromARGB(255, 247, 224, 236),
|
||||
// borderRadius: BorderRadius.circular(10),
|
||||
// boxShadow: [
|
||||
// BoxShadow(
|
||||
// color: Color.fromARGB(255, 214, 213, 121),
|
||||
// blurRadius: 5,
|
||||
// spreadRadius: 2,
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// child: Text(
|
||||
// "Halo....Jotaslim",
|
||||
// style: TextStyle(
|
||||
// fontSize: 12,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// color: Color(0xFF000000),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// SizedBox(height: 10),
|
||||
// setHomeImage("images/luffy.png", 300),
|
||||
// // Image.asset("images/luffy.png", width: 300),
|
||||
// ],
|
||||
// ),
|
||||
// ),
|
||||
// BG MEnu
|
||||
Stack(
|
||||
children: [
|
||||
BuildcardInfo(
|
||||
icon: Icons.person,
|
||||
text: username,
|
||||
extraIcon: Icons.emoji_events,
|
||||
extraText: "5000",
|
||||
width: 180,
|
||||
),
|
||||
BuildcardInfo(
|
||||
icon: Icons.monetization_on,
|
||||
text: "1.300",
|
||||
width: 90,
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: SizedBox(height: 85, child: BottomNavbar()),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Positioned(
|
||||
bottom: 150,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 10),
|
||||
decoration: BoxDecoration(
|
||||
color: Color.fromARGB(255, 247, 224, 236),
|
||||
borderRadius: BorderRadius.circular(10),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: Color.fromARGB(255, 214, 213, 121),
|
||||
blurRadius: 5,
|
||||
spreadRadius: 2,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Text(
|
||||
"Halo....Jotaslim",
|
||||
style: TextStyle(
|
||||
fontSize: 12,
|
||||
fontWeight: FontWeight.bold,
|
||||
color: Color(0xFF000000),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
setHomeImage("assets/images/cepott.png", 300),
|
||||
],
|
||||
),
|
||||
),
|
||||
// BG MEnu
|
||||
Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: SizedBox(height: 85, child: BottomNavbar()),
|
||||
),
|
||||
],
|
||||
),
|
||||
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
|
||||
Positioned(bottom: 0, left: 0, right: 0, child: MainMenu()),
|
||||
|
||||
Positioned(
|
||||
bottom:
|
||||
@@ -215,8 +234,63 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
);
|
||||
}
|
||||
|
||||
void onUnityCreated(controller) {
|
||||
_unityWidgetController = controller;
|
||||
}
|
||||
|
||||
void onUnityMessage(message) {
|
||||
print('Received message from unity: ${message.toString()}');
|
||||
}
|
||||
|
||||
// Widget _menuButton(String label, Widget icon) {
|
||||
// return Expanded(
|
||||
// child: Column(
|
||||
// children: [
|
||||
// IconButton(
|
||||
// // icon: Icon(icon, color: Color.fromARGB(255, 179, 161, 170)),
|
||||
// icon: icon,
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
// Text(
|
||||
// label,
|
||||
// style: TextStyle(
|
||||
// color: Color.fromARGB(255, 239, 224, 232),
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
// Widget _scanButton() {
|
||||
// return Expanded(
|
||||
// child: Container(
|
||||
// decoration: BoxDecoration(shape: BoxShape.circle, color: transparent),
|
||||
// padding: EdgeInsets.all(10),
|
||||
// child: IconButton(
|
||||
// icon: SvgPicture.asset(
|
||||
// 'icons/Scan.svg',
|
||||
// width: 60,
|
||||
// height: 60,
|
||||
// colorFilter: ColorFilter.mode(Color(0xFFFFFFFF), BlendMode.srcIn),
|
||||
// ),
|
||||
// onPressed: () {},
|
||||
// ),
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
|
||||
Widget setHomeImage(String src, double size) {
|
||||
return Image.asset(src, width: size);
|
||||
return Image.asset("assets/" + src, width: size);
|
||||
}
|
||||
|
||||
void onUnityCreated(controller) {
|
||||
_unityWidgetController = controller;
|
||||
}
|
||||
|
||||
void onUnityMessage(message) {
|
||||
print('Received message from unity: ${message.toString()}');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
|
||||
children: [
|
||||
CollectionContainer(
|
||||
label: "Luffy",
|
||||
imagesrc: 'images/luffy.png',
|
||||
imagesrc: 'assets/images/luffy.png',
|
||||
width: 100,
|
||||
height: 100,
|
||||
onTapAc:
|
||||
|
||||
@@ -108,7 +108,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
|
||||
children: [
|
||||
CollectionContainer(
|
||||
label: "Luffy",
|
||||
imagesrc: 'images/luffy.png',
|
||||
imagesrc: 'assets/images/luffy.png',
|
||||
width: 100,
|
||||
height: 100,
|
||||
onTapAc:
|
||||
|
||||
@@ -22,26 +22,10 @@ class _PustakaScreenState extends State<PustakaScreen> {
|
||||
String _searchQuery = "";
|
||||
|
||||
final List<Map<String, dynamic>> _collections = [
|
||||
{
|
||||
"label": "Kesehatan",
|
||||
"image": "assets/icons/healthy.svg",
|
||||
"color": "#cdd0ee",
|
||||
},
|
||||
{
|
||||
"label": "Gizi",
|
||||
"image": "assets/icons/Nutrition.svg",
|
||||
"color": "#e8e29a",
|
||||
},
|
||||
{
|
||||
"label": "Pendidikan",
|
||||
"image": "assets/icons/Education.svg",
|
||||
"color": "#efd8c6",
|
||||
},
|
||||
{
|
||||
"label": "Keselamatan",
|
||||
"image": "assets/icons/Safety.svg",
|
||||
"color": "#cef1da",
|
||||
},
|
||||
{"label": "Kesehatan", "image": "assets/icons/healthy.svg", "color": "#cdd0ee"},
|
||||
{"label": "Gizi", "image": "assets/icons/Nutrition.svg", "color": "#e8e29a"},
|
||||
{"label": "Pendidikan", "image": "assets/icons/Education.svg", "color": "#efd8c6"},
|
||||
{"label": "Keselamatan", "image": "assets/icons/Safety.svg", "color": "#cef1da"},
|
||||
];
|
||||
|
||||
void _onMenuTapped(int index) {
|
||||
@@ -159,7 +143,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
|
||||
),
|
||||
decoration: const InputDecoration(
|
||||
border: InputBorder.none,
|
||||
hintText: 'Search...',
|
||||
hintText: 'Cari konten...',
|
||||
hintStyle: TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
@@ -188,6 +172,7 @@ class _PustakaScreenState extends State<PustakaScreen> {
|
||||
final item = filteredCollections[index];
|
||||
return CollectionContainer(
|
||||
label: item["label"]!,
|
||||
lblSize: 11,
|
||||
imageSvg: item["image"]!,
|
||||
width: 30,
|
||||
height: 80,
|
||||
@@ -267,9 +252,10 @@ class _PustakaScreenState extends State<PustakaScreen> {
|
||||
color: Colors.blueAccent,
|
||||
),
|
||||
Text(
|
||||
'Topic ${index + 1}',
|
||||
'Topik ${index + 1}',
|
||||
style: const TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 11,
|
||||
color: Color.fromARGB(255, 0, 0, 0),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -0,0 +1,211 @@
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:furibase/components/bottom_navbar.dart';
|
||||
import 'package:furibase/components/main_menu.dart';
|
||||
import 'package:furibase/components/scan_button.dart';
|
||||
import 'package:furibase/helpers/pick_image.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
|
||||
class AkunSaya extends StatefulWidget {
|
||||
@override
|
||||
_AkunSayaState createState() => _AkunSayaState();
|
||||
}
|
||||
|
||||
class _AkunSayaState extends State<AkunSaya> {
|
||||
dynamic _profileImage;
|
||||
dynamic _headerImage;
|
||||
//final ImagePicker _picker = ImagePicker();
|
||||
|
||||
Future<void> _pickImage(bool isProfile) async {
|
||||
final imagePicker = ImagePickerHelper();
|
||||
dynamic pic = await imagePicker.pickImage();
|
||||
|
||||
if (pic != null) {
|
||||
setState(() {
|
||||
if (isProfile) {
|
||||
_profileImage = pic;
|
||||
} else {
|
||||
_headerImage = pic;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: Text("Saya"),
|
||||
backgroundColor: Color.fromARGB(225, 79, 76, 182),
|
||||
),
|
||||
backgroundColor: const Color.fromARGB(255, 255, 255, 255),
|
||||
body: Stack(
|
||||
children: [
|
||||
Positioned(
|
||||
bottom: 0,
|
||||
left: 0,
|
||||
right: 0,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.only(top: 20.0, left: 20, right: 20),
|
||||
child: Container(
|
||||
height: MediaQuery.of(context).size.height * 0.7,
|
||||
width: MediaQuery.of(context).size.width,
|
||||
decoration: BoxDecoration(
|
||||
color: const Color.fromARGB(255, 205, 202, 189),
|
||||
borderRadius: BorderRadius.only(
|
||||
topLeft: Radius.circular(20),
|
||||
topRight: Radius.circular(20),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
// Header image (bisa diubah)
|
||||
SizedBox(
|
||||
height: 80,
|
||||
child: Container(
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.only(
|
||||
bottomLeft: Radius.circular(40),
|
||||
bottomRight: Radius.circular(40),
|
||||
),
|
||||
color: Color.fromARGB(225, 79, 76, 182),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Expanded(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(20),
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20, vertical: 40),
|
||||
children: [
|
||||
TextFormField(
|
||||
initialValue: "Cepot",
|
||||
decoration: const InputDecoration(
|
||||
border: UnderlineInputBorder(),
|
||||
labelText: 'Nama',
|
||||
labelStyle: TextStyle(color: Colors.black),
|
||||
),
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
TextFormField(
|
||||
initialValue: "cpt09",
|
||||
decoration: const InputDecoration(
|
||||
border: UnderlineInputBorder(),
|
||||
labelText: 'Nama Pengguna',
|
||||
labelStyle: TextStyle(color: Colors.black),
|
||||
),
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
|
||||
TextFormField(
|
||||
initialValue: "Jl. Sentosa jaya",
|
||||
decoration: const InputDecoration(
|
||||
border: UnderlineInputBorder(),
|
||||
labelText: 'Alamat',
|
||||
labelStyle: TextStyle(color: Colors.black),
|
||||
),
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
|
||||
TextFormField(
|
||||
initialValue: "******",
|
||||
decoration: const InputDecoration(
|
||||
border: UnderlineInputBorder(),
|
||||
labelText: 'Kata Sandi',
|
||||
labelStyle: TextStyle(color: Colors.black),
|
||||
),
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
TextFormField(
|
||||
initialValue: "+62923",
|
||||
decoration: const InputDecoration(
|
||||
border: UnderlineInputBorder(),
|
||||
labelText: 'No. HP',
|
||||
labelStyle: TextStyle(color: Colors.black),
|
||||
),
|
||||
style: TextStyle(color: Colors.black),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
// Profile Picture (bisa diubah)
|
||||
Positioned(
|
||||
top: 25,
|
||||
left: MediaQuery.of(context).size.width / 2 - 50,
|
||||
child: GestureDetector(
|
||||
onTap: () => _pickImage(true),
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomRight,
|
||||
children: [
|
||||
CircleAvatar(
|
||||
radius: 50,
|
||||
backgroundColor: Colors.grey[300],
|
||||
backgroundImage:
|
||||
_profileImage != null
|
||||
? (kIsWeb
|
||||
? MemoryImage(_profileImage) as ImageProvider
|
||||
: FileImage(_profileImage) as ImageProvider)
|
||||
: null,
|
||||
child:
|
||||
_profileImage == null
|
||||
? Icon(Icons.person, size: 50, color: Colors.white)
|
||||
: null,
|
||||
),
|
||||
CircleAvatar(
|
||||
radius: 15,
|
||||
backgroundColor: Colors.blue,
|
||||
child: Icon(Icons.edit, color: Colors.white, size: 15),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
top: 130,
|
||||
left: MediaQuery.of(context).size.width / 2 - 50,
|
||||
child: GestureDetector(
|
||||
onTap: () => _pickImage(true),
|
||||
child: Stack(
|
||||
alignment: Alignment.bottomRight,
|
||||
children: [
|
||||
Text(
|
||||
"Nama Akun",
|
||||
style: TextStyle(
|
||||
color: Colors.deepPurple,
|
||||
fontSize: 18,
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildListItem(IconData icon, String label, {bool isLogout = false}) {
|
||||
return ListTile(
|
||||
leading: Icon(
|
||||
icon,
|
||||
color:
|
||||
isLogout
|
||||
? const Color.fromARGB(255, 181, 47, 47)
|
||||
: const Color.fromARGB(255, 255, 255, 255),
|
||||
),
|
||||
title: Text(label, style: TextStyle(fontSize: 16, color: Colors.black)),
|
||||
trailing: Icon(Icons.arrow_forward_ios, size: 16),
|
||||
onTap: () {},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,6 @@ import 'package:freekake/components/scan_button.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'dart:io';
|
||||
|
||||
// import 'package:image_picker_web/image_picker_web.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
|
||||
class AkunSaya extends StatefulWidget {
|
||||
|
||||
@@ -10,7 +10,6 @@ import 'package:freekake/screen/saya/akun_saya.dart';
|
||||
import 'package:image_picker/image_picker.dart';
|
||||
import 'dart:io';
|
||||
|
||||
// import 'package:image_picker_web/image_picker_web.dart';
|
||||
import 'package:flutter/foundation.dart' show kIsWeb;
|
||||
|
||||
class ProfileScreen extends StatefulWidget {
|
||||
|
||||
@@ -235,6 +235,15 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
flutter_unity_widget:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
path: "."
|
||||
ref: "flutter_3.24_android_hotfix"
|
||||
resolved-ref: d2f6dc853d5b5054668ea9d79bb138d2d072696c
|
||||
url: "https://github.com/juicycleff/flutter-unity-view-widget.git"
|
||||
source: git
|
||||
version: "2022.2.1"
|
||||
flutter_web_plugins:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
|
||||
+6
-37
@@ -59,6 +59,11 @@ dependencies:
|
||||
# arcore_flutter_plugin:
|
||||
# git:
|
||||
# url: https://github.com/giandifra/arcore_flutter_plugin.git
|
||||
# flutter_unity_widget: ^2022.2.1
|
||||
flutter_unity_widget:
|
||||
git:
|
||||
url: https://github.com/juicycleff/flutter-unity-view-widget.git
|
||||
ref: flutter_3.24_android_hotfix
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
@@ -85,45 +90,9 @@ flutter:
|
||||
# To add assets to your application, add an assets section, like this:
|
||||
assets:
|
||||
- assets/images/
|
||||
- assets/images/Artboard 15@4x.png
|
||||
- assets/images/Artboard 16@4x.png
|
||||
- assets/images/background.jpeg
|
||||
- assets/images/cepott.png
|
||||
- assets/images/ft_cepot.png
|
||||
- assets/images/ft_luffy.png
|
||||
- assets/images/klipartz.png
|
||||
- assets/images/luffy-kimono.png
|
||||
- assets/images/luffy-king.png
|
||||
- assets/images/luffy-u.png
|
||||
- assets/images/luffy.gif
|
||||
- assets/images/luffy.png
|
||||
|
||||
# SVG files
|
||||
- assets/icons/E-furrybuddy.svg
|
||||
- assets/icons/E-furrybuddy1.svg
|
||||
- assets/icons/Education.svg
|
||||
- assets/icons/furrybuddy.svg
|
||||
- assets/icons/healthy.svg
|
||||
- assets/icons/Koleksi.svg
|
||||
- assets/icons/Nutrition.svg
|
||||
- assets/icons/Pustaka.svg
|
||||
- assets/icons/Safety.svg
|
||||
- assets/icons/Saya.svg
|
||||
- assets/icons/Scan.svg
|
||||
|
||||
#HTML File
|
||||
- assets/html/
|
||||
- assets/html/index.html
|
||||
- assets/html/furikake/index.html
|
||||
- assets/html/furikake/
|
||||
# HTML Images
|
||||
- assets/html/isipiringku.png
|
||||
- assets/html/karbohidrat.png
|
||||
- assets/html/lemak.png
|
||||
- assets/html/protein.png
|
||||
- assets/html/seratair.png
|
||||
- assets/html/vitaminmineral.png
|
||||
|
||||
- assets/icons/
|
||||
|
||||
# An image asset can refer to one or more resolution-specific "variants", see
|
||||
# https://flutter.dev/to/resolution-aware-images
|
||||
|
||||
Reference in New Issue
Block a user