first commit
2
.env
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
url = 'http://20.20.20.25:3002/'
|
||||||
|
api_url = 'http://20.20.20.25:3002/'
|
48
.gitignore
vendored
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# Miscellaneous
|
||||||
|
*.class
|
||||||
|
*.log
|
||||||
|
*.pyc
|
||||||
|
*.swp
|
||||||
|
.DS_Store
|
||||||
|
.atom/
|
||||||
|
.buildlog/
|
||||||
|
.history
|
||||||
|
.svn/
|
||||||
|
migrate_working_dir/
|
||||||
|
|
||||||
|
# IntelliJ related
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
*.iws
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# The .vscode folder contains launch configuration and tasks you configure in
|
||||||
|
# VS Code which you may wish to be included in version control, so this line
|
||||||
|
# is commented out by default.
|
||||||
|
#.vscode/
|
||||||
|
|
||||||
|
# Flutter/Dart/Pub related
|
||||||
|
**/doc/api/
|
||||||
|
**/ios/Flutter/.last_build_id
|
||||||
|
.dart_tool/
|
||||||
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
.packages
|
||||||
|
.pub-cache/
|
||||||
|
.pub/
|
||||||
|
/build/
|
||||||
|
|
||||||
|
# Symbolication related
|
||||||
|
app.*.symbols
|
||||||
|
|
||||||
|
# Obfuscation related
|
||||||
|
app.*.map.json
|
||||||
|
|
||||||
|
# Android Studio will place build artifacts here
|
||||||
|
/android/app/debug
|
||||||
|
/android/app/profile
|
||||||
|
/android/app/release
|
||||||
|
|
||||||
|
|
||||||
|
# .env
|
||||||
|
.env.git
|
45
.metadata
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# This file tracks properties of this Flutter project.
|
||||||
|
# Used by Flutter tool to assess capabilities and perform upgrades etc.
|
||||||
|
#
|
||||||
|
# This file should be version controlled and should not be manually edited.
|
||||||
|
|
||||||
|
version:
|
||||||
|
revision: "8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f"
|
||||||
|
channel: "beta"
|
||||||
|
|
||||||
|
project_type: app
|
||||||
|
|
||||||
|
# Tracks metadata for the flutter migrate command
|
||||||
|
migration:
|
||||||
|
platforms:
|
||||||
|
- platform: root
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
- platform: android
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
- platform: ios
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
- platform: linux
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
- platform: macos
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
- platform: web
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
- platform: windows
|
||||||
|
create_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
base_revision: 8fcb74dbc16b9edb3d3f14c11c627d9e8f24fb1f
|
||||||
|
|
||||||
|
# User provided section
|
||||||
|
|
||||||
|
# List of Local paths (relative to this file) that should be
|
||||||
|
# ignored by the migrate tool.
|
||||||
|
#
|
||||||
|
# Files that are not part of the templates will be ignored by default.
|
||||||
|
unmanaged_files:
|
||||||
|
- 'lib/main.dart'
|
||||||
|
- 'ios/Runner.xcodeproj/project.pbxproj'
|
16
README.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# cek_suara
|
||||||
|
|
||||||
|
A new Flutter project.
|
||||||
|
|
||||||
|
## Getting Started
|
||||||
|
|
||||||
|
This project is a starting point for a Flutter application.
|
||||||
|
|
||||||
|
A few resources to get you started if this is your first Flutter project:
|
||||||
|
|
||||||
|
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
|
||||||
|
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
|
||||||
|
|
||||||
|
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.
|
29
analysis_options.yaml
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# This file configures the analyzer, which statically analyzes Dart code to
|
||||||
|
# check for errors, warnings, and lints.
|
||||||
|
#
|
||||||
|
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
|
||||||
|
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
|
||||||
|
# invoked from the command line by running `flutter analyze`.
|
||||||
|
|
||||||
|
# The following line activates a set of recommended lints for Flutter apps,
|
||||||
|
# packages, and plugins designed to encourage good coding practices.
|
||||||
|
include: package:flutter_lints/flutter.yaml
|
||||||
|
|
||||||
|
linter:
|
||||||
|
# The lint rules applied to this project can be customized in the
|
||||||
|
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
|
||||||
|
# included above or to enable additional rules. A list of all available lints
|
||||||
|
# and their documentation is published at
|
||||||
|
# https://dart-lang.github.io/linter/lints/index.html.
|
||||||
|
#
|
||||||
|
# Instead of disabling a lint rule for the entire project in the
|
||||||
|
# section below, it can also be suppressed for a single line of code
|
||||||
|
# or a specific dart file by using the `// ignore: name_of_lint` and
|
||||||
|
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
|
||||||
|
# producing the lint.
|
||||||
|
rules:
|
||||||
|
# avoid_print: false # Uncomment to disable the `avoid_print` rule
|
||||||
|
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
|
||||||
|
|
||||||
|
# Additional information about this file can be found at
|
||||||
|
# https://dart.dev/guides/language/analysis-options
|
13
android/.gitignore
vendored
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
gradle-wrapper.jar
|
||||||
|
/.gradle
|
||||||
|
/captures/
|
||||||
|
/gradlew
|
||||||
|
/gradlew.bat
|
||||||
|
/local.properties
|
||||||
|
GeneratedPluginRegistrant.java
|
||||||
|
|
||||||
|
# Remember to never publicly share your keystore.
|
||||||
|
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
|
||||||
|
key.properties
|
||||||
|
**/*.keystore
|
||||||
|
**/*.jks
|
67
android/app/build.gradle
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
plugins {
|
||||||
|
id "com.android.application"
|
||||||
|
id "kotlin-android"
|
||||||
|
id "dev.flutter.flutter-gradle-plugin"
|
||||||
|
}
|
||||||
|
|
||||||
|
def localProperties = new Properties()
|
||||||
|
def localPropertiesFile = rootProject.file('local.properties')
|
||||||
|
if (localPropertiesFile.exists()) {
|
||||||
|
localPropertiesFile.withReader('UTF-8') { reader ->
|
||||||
|
localProperties.load(reader)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
|
||||||
|
if (flutterVersionCode == null) {
|
||||||
|
flutterVersionCode = '1'
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutterVersionName = localProperties.getProperty('flutter.versionName')
|
||||||
|
if (flutterVersionName == null) {
|
||||||
|
flutterVersionName = '1.0'
|
||||||
|
}
|
||||||
|
|
||||||
|
android {
|
||||||
|
namespace "com.example.cek_suara"
|
||||||
|
compileSdkVersion flutter.compileSdkVersion
|
||||||
|
ndkVersion flutter.ndkVersion
|
||||||
|
|
||||||
|
compileOptions {
|
||||||
|
sourceCompatibility JavaVersion.VERSION_1_8
|
||||||
|
targetCompatibility JavaVersion.VERSION_1_8
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlinOptions {
|
||||||
|
jvmTarget = '1.8'
|
||||||
|
}
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
main.java.srcDirs += 'src/main/kotlin'
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
|
||||||
|
applicationId "com.example.cek_suara"
|
||||||
|
// You can update the following values to match your application needs.
|
||||||
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
|
||||||
|
minSdkVersion flutter.minSdkVersion
|
||||||
|
targetSdkVersion flutter.targetSdkVersion
|
||||||
|
versionCode flutterVersionCode.toInteger()
|
||||||
|
versionName flutterVersionName
|
||||||
|
}
|
||||||
|
|
||||||
|
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.debug
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
flutter {
|
||||||
|
source '../..'
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {}
|
7
android/app/src/debug/AndroidManifest.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
the Flutter tool needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
33
android/app/src/main/AndroidManifest.xml
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application
|
||||||
|
android:label="cek_suara"
|
||||||
|
android:name="${applicationName}"
|
||||||
|
android:icon="@mipmap/ic_launcher">
|
||||||
|
<activity
|
||||||
|
android:name=".MainActivity"
|
||||||
|
android:exported="true"
|
||||||
|
android:launchMode="singleTop"
|
||||||
|
android:theme="@style/LaunchTheme"
|
||||||
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
|
||||||
|
android:hardwareAccelerated="true"
|
||||||
|
android:windowSoftInputMode="adjustResize">
|
||||||
|
<!-- Specifies an Android theme to apply to this Activity as soon as
|
||||||
|
the Android process has started. This theme is visible to the user
|
||||||
|
while the Flutter UI initializes. After that, this theme continues
|
||||||
|
to determine the Window background behind the Flutter UI. -->
|
||||||
|
<meta-data
|
||||||
|
android:name="io.flutter.embedding.android.NormalTheme"
|
||||||
|
android:resource="@style/NormalTheme"
|
||||||
|
/>
|
||||||
|
<intent-filter>
|
||||||
|
<action android:name="android.intent.action.MAIN"/>
|
||||||
|
<category android:name="android.intent.category.LAUNCHER"/>
|
||||||
|
</intent-filter>
|
||||||
|
</activity>
|
||||||
|
<!-- Don't delete the meta-data below.
|
||||||
|
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
|
||||||
|
<meta-data
|
||||||
|
android:name="flutterEmbedding"
|
||||||
|
android:value="2" />
|
||||||
|
</application>
|
||||||
|
</manifest>
|
@ -0,0 +1,6 @@
|
|||||||
|
package com.example.cek_suara
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
class MainActivity: FlutterActivity() {
|
||||||
|
}
|
12
android/app/src/main/res/drawable-v21/launch_background.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="?android:colorBackground" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
12
android/app/src/main/res/drawable/launch_background.xml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Modify this file to customize your launch splash screen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item android:drawable="@android:color/white" />
|
||||||
|
|
||||||
|
<!-- You can insert your own image assets here -->
|
||||||
|
<!-- <item>
|
||||||
|
<bitmap
|
||||||
|
android:gravity="center"
|
||||||
|
android:src="@mipmap/launch_image" />
|
||||||
|
</item> -->
|
||||||
|
</layer-list>
|
BIN
android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 544 B |
BIN
android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 442 B |
BIN
android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 721 B |
BIN
android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 1.0 KiB |
BIN
android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Normal file
After Width: | Height: | Size: 1.4 KiB |
18
android/app/src/main/res/values-night/styles.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
the Flutter engine draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
18
android/app/src/main/res/values/styles.xml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<resources>
|
||||||
|
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
|
||||||
|
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<!-- Show a splash screen on the activity. Automatically removed when
|
||||||
|
the Flutter engine draws its first frame -->
|
||||||
|
<item name="android:windowBackground">@drawable/launch_background</item>
|
||||||
|
</style>
|
||||||
|
<!-- Theme applied to the Android Window as soon as the process has started.
|
||||||
|
This theme determines the color of the Android Window while your
|
||||||
|
Flutter UI initializes, as well as behind your Flutter UI while its
|
||||||
|
running.
|
||||||
|
|
||||||
|
This Theme is only used starting with V2 of Flutter's Android embedding. -->
|
||||||
|
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
|
||||||
|
<item name="android:windowBackground">?android:colorBackground</item>
|
||||||
|
</style>
|
||||||
|
</resources>
|
7
android/app/src/profile/AndroidManifest.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- The INTERNET permission is required for development. Specifically,
|
||||||
|
the Flutter tool needs it to communicate with the running application
|
||||||
|
to allow setting breakpoints, to provide hot reload, etc.
|
||||||
|
-->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET"/>
|
||||||
|
</manifest>
|
31
android/build.gradle
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
buildscript {
|
||||||
|
ext.kotlin_version = '1.7.10'
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath 'com.android.tools.build:gradle:7.2.0'
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
allprojects {
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rootProject.buildDir = '../build'
|
||||||
|
subprojects {
|
||||||
|
project.buildDir = "${rootProject.buildDir}/${project.name}"
|
||||||
|
}
|
||||||
|
subprojects {
|
||||||
|
project.evaluationDependsOn(':app')
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("clean", Delete) {
|
||||||
|
delete rootProject.buildDir
|
||||||
|
}
|
3
android/gradle.properties
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
org.gradle.jvmargs=-Xmx1536M
|
||||||
|
android.useAndroidX=true
|
||||||
|
android.enableJetifier=true
|
5
android/gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip
|
20
android/settings.gradle
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
pluginManagement {
|
||||||
|
def flutterSdkPath = {
|
||||||
|
def properties = new Properties()
|
||||||
|
file("local.properties").withInputStream { properties.load(it) }
|
||||||
|
def flutterSdkPath = properties.getProperty("flutter.sdk")
|
||||||
|
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
|
||||||
|
return flutterSdkPath
|
||||||
|
}
|
||||||
|
settings.ext.flutterSdkPath = flutterSdkPath()
|
||||||
|
|
||||||
|
includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "dev.flutter.flutter-gradle-plugin" version "1.0.0" apply false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
include ":app"
|
||||||
|
|
||||||
|
apply from: "${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle/app_plugin_loader.gradle"
|
BIN
assets/logo.png
Normal file
After Width: | Height: | Size: 87 KiB |
34
ios/.gitignore
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
**/dgph
|
||||||
|
*.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
*.moved-aside
|
||||||
|
*.pbxuser
|
||||||
|
*.perspectivev3
|
||||||
|
**/*sync/
|
||||||
|
.sconsign.dblite
|
||||||
|
.tags*
|
||||||
|
**/.vagrant/
|
||||||
|
**/DerivedData/
|
||||||
|
Icon?
|
||||||
|
**/Pods/
|
||||||
|
**/.symlinks/
|
||||||
|
profile
|
||||||
|
xcuserdata
|
||||||
|
**/.generated/
|
||||||
|
Flutter/App.framework
|
||||||
|
Flutter/Flutter.framework
|
||||||
|
Flutter/Flutter.podspec
|
||||||
|
Flutter/Generated.xcconfig
|
||||||
|
Flutter/ephemeral/
|
||||||
|
Flutter/app.flx
|
||||||
|
Flutter/app.zip
|
||||||
|
Flutter/flutter_assets/
|
||||||
|
Flutter/flutter_export_environment.sh
|
||||||
|
ServiceDefinitions.json
|
||||||
|
Runner/GeneratedPluginRegistrant.*
|
||||||
|
|
||||||
|
# Exceptions to above rules.
|
||||||
|
!default.mode1v3
|
||||||
|
!default.mode2v3
|
||||||
|
!default.pbxuser
|
||||||
|
!default.perspectivev3
|
26
ios/Flutter/AppFrameworkInfo.plist
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>en</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>io.flutter.flutter.app</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>App</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>FMWK</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>1.0</string>
|
||||||
|
<key>MinimumOSVersion</key>
|
||||||
|
<string>11.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
2
ios/Flutter/Debug.xcconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
|
||||||
|
#include "Generated.xcconfig"
|
2
ios/Flutter/Release.xcconfig
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
|
||||||
|
#include "Generated.xcconfig"
|
44
ios/Podfile
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# Uncomment this line to define a global platform for your project
|
||||||
|
# platform :ios, '11.0'
|
||||||
|
|
||||||
|
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||||
|
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||||
|
|
||||||
|
project 'Runner', {
|
||||||
|
'Debug' => :debug,
|
||||||
|
'Profile' => :release,
|
||||||
|
'Release' => :release,
|
||||||
|
}
|
||||||
|
|
||||||
|
def flutter_root
|
||||||
|
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
|
||||||
|
unless File.exist?(generated_xcode_build_settings_path)
|
||||||
|
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
|
||||||
|
end
|
||||||
|
|
||||||
|
File.foreach(generated_xcode_build_settings_path) do |line|
|
||||||
|
matches = line.match(/FLUTTER_ROOT\=(.*)/)
|
||||||
|
return matches[1].strip if matches
|
||||||
|
end
|
||||||
|
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
|
||||||
|
end
|
||||||
|
|
||||||
|
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
|
||||||
|
|
||||||
|
flutter_ios_podfile_setup
|
||||||
|
|
||||||
|
target 'Runner' do
|
||||||
|
use_frameworks!
|
||||||
|
use_modular_headers!
|
||||||
|
|
||||||
|
flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
|
||||||
|
target 'RunnerTests' do
|
||||||
|
inherit! :search_paths
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
post_install do |installer|
|
||||||
|
installer.pods_project.targets.each do |target|
|
||||||
|
flutter_additional_ios_build_settings(target)
|
||||||
|
end
|
||||||
|
end
|
614
ios/Runner.xcodeproj/project.pbxproj
Normal file
@ -0,0 +1,614 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 54;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
|
||||||
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXContainerItemProxy section */
|
||||||
|
331C8085294A63A400263BE5 /* PBXContainerItemProxy */ = {
|
||||||
|
isa = PBXContainerItemProxy;
|
||||||
|
containerPortal = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
proxyType = 1;
|
||||||
|
remoteGlobalIDString = 97C146ED1CF9000F007C117D;
|
||||||
|
remoteInfo = Runner;
|
||||||
|
};
|
||||||
|
/* End PBXContainerItemProxy section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = "";
|
||||||
|
dstSubfolderSpec = 10;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
name = "Embed Frameworks";
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
|
||||||
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||||
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||||
|
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
|
||||||
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RunnerTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Flutter;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146E51CF9000F007C117D = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */,
|
||||||
|
97C146F01CF9000F007C117D /* Runner */,
|
||||||
|
97C146EF1CF9000F007C117D /* Products */,
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146EF1CF9000F007C117D /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146EE1CF9000F007C117D /* Runner.app */,
|
||||||
|
331C8081294A63A400263BE5 /* RunnerTests.xctest */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146F01CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */,
|
||||||
|
97C146FD1CF9000F007C117D /* Assets.xcassets */,
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
|
||||||
|
97C147021CF9000F007C117D /* Info.plist */,
|
||||||
|
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
|
||||||
|
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
|
||||||
|
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
|
||||||
|
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
|
||||||
|
);
|
||||||
|
path = Runner;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
331C8080294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */;
|
||||||
|
buildPhases = (
|
||||||
|
331C807D294A63A400263BE5 /* Sources */,
|
||||||
|
331C807E294A63A400263BE5 /* Frameworks */,
|
||||||
|
331C807F294A63A400263BE5 /* Resources */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
331C8086294A63A400263BE5 /* PBXTargetDependency */,
|
||||||
|
);
|
||||||
|
name = RunnerTests;
|
||||||
|
productName = RunnerTests;
|
||||||
|
productReference = 331C8081294A63A400263BE5 /* RunnerTests.xctest */;
|
||||||
|
productType = "com.apple.product-type.bundle.unit-test";
|
||||||
|
};
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
|
||||||
|
buildPhases = (
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */,
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */,
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */,
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */,
|
||||||
|
9705A1C41CF9048500538489 /* Embed Frameworks */,
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = Runner;
|
||||||
|
productName = Runner;
|
||||||
|
productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
|
||||||
|
productType = "com.apple.product-type.application";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
97C146E61CF9000F007C117D /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
BuildIndependentTargetsInParallel = YES;
|
||||||
|
LastUpgradeCheck = 1430;
|
||||||
|
ORGANIZATIONNAME = "";
|
||||||
|
TargetAttributes = {
|
||||||
|
331C8080294A63A400263BE5 = {
|
||||||
|
CreatedOnToolsVersion = 14.0;
|
||||||
|
TestTargetID = 97C146ED1CF9000F007C117D;
|
||||||
|
};
|
||||||
|
97C146ED1CF9000F007C117D = {
|
||||||
|
CreatedOnToolsVersion = 7.3.1;
|
||||||
|
LastSwiftMigration = 1100;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
|
||||||
|
compatibilityVersion = "Xcode 9.3";
|
||||||
|
developmentRegion = en;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
Base,
|
||||||
|
);
|
||||||
|
mainGroup = 97C146E51CF9000F007C117D;
|
||||||
|
productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
97C146ED1CF9000F007C117D /* Runner */,
|
||||||
|
331C8080294A63A400263BE5 /* RunnerTests */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXResourcesBuildPhase section */
|
||||||
|
331C807F294A63A400263BE5 /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
97C146EC1CF9000F007C117D /* Resources */ = {
|
||||||
|
isa = PBXResourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
|
||||||
|
3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
|
||||||
|
97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
|
||||||
|
97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXResourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXShellScriptBuildPhase section */
|
||||||
|
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
|
||||||
|
);
|
||||||
|
name = "Thin Binary";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
|
||||||
|
};
|
||||||
|
9740EEB61CF901F6004384FC /* Run Script */ = {
|
||||||
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
alwaysOutOfDate = 1;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
inputPaths = (
|
||||||
|
);
|
||||||
|
name = "Run Script";
|
||||||
|
outputPaths = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
shellPath = /bin/sh;
|
||||||
|
shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
|
||||||
|
};
|
||||||
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
331C807D294A63A400263BE5 /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
97C146EA1CF9000F007C117D /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXTargetDependency section */
|
||||||
|
331C8086294A63A400263BE5 /* PBXTargetDependency */ = {
|
||||||
|
isa = PBXTargetDependency;
|
||||||
|
target = 97C146ED1CF9000F007C117D /* Runner */;
|
||||||
|
targetProxy = 331C8085294A63A400263BE5 /* PBXContainerItemProxy */;
|
||||||
|
};
|
||||||
|
/* End PBXTargetDependency section */
|
||||||
|
|
||||||
|
/* Begin PBXVariantGroup section */
|
||||||
|
97C146FA1CF9000F007C117D /* Main.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C146FB1CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = Main.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
|
||||||
|
isa = PBXVariantGroup;
|
||||||
|
children = (
|
||||||
|
97C147001CF9000F007C117D /* Base */,
|
||||||
|
);
|
||||||
|
name = LaunchScreen.storyboard;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXVariantGroup section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
249021D3217E4FDB00AE95B9 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
249021D4217E4FDB00AE95B9 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.cekSuara;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
331C8088294A63A400263BE5 /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = AE0B7B92F70575B8D7E0D07E /* Pods-RunnerTests.debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.cekSuara.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
331C8089294A63A400263BE5 /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 89B67EB44CE7B6631473024E /* Pods-RunnerTests.release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.cekSuara.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
331C808A294A63A400263BE5 /* Profile */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 640959BDD8F10B91D80A66BE /* Pods-RunnerTests.profile.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
|
CODE_SIGN_STYLE = Automatic;
|
||||||
|
CURRENT_PROJECT_VERSION = 1;
|
||||||
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
|
MARKETING_VERSION = 1.0;
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.cekSuara.RunnerTests;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Runner.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/Runner";
|
||||||
|
};
|
||||||
|
name = Profile;
|
||||||
|
};
|
||||||
|
97C147031CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = dwarf;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
ENABLE_TESTABILITY = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = YES;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147041CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_ANALYZER_NONNULL = YES;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_COMMA = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INFINITE_RECURSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
|
||||||
|
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
|
||||||
|
CLANG_WARN_STRICT_PROTOTYPES = YES;
|
||||||
|
CLANG_WARN_SUSPICIOUS_MOVE = YES;
|
||||||
|
CLANG_WARN_UNREACHABLE_CODE = YES;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
|
||||||
|
MTL_ENABLE_DEBUG_INFO = NO;
|
||||||
|
SDKROOT = iphoneos;
|
||||||
|
SUPPORTED_PLATFORMS = iphoneos;
|
||||||
|
SWIFT_COMPILATION_MODE = wholemodule;
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-O";
|
||||||
|
TARGETED_DEVICE_FAMILY = "1,2";
|
||||||
|
VALIDATE_PRODUCT = YES;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
97C147061CF9000F007C117D /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.cekSuara;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
97C147071CF9000F007C117D /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
|
||||||
|
buildSettings = {
|
||||||
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
|
CLANG_ENABLE_MODULES = YES;
|
||||||
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
|
ENABLE_BITCODE = NO;
|
||||||
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
|
"$(inherited)",
|
||||||
|
"@executable_path/Frameworks",
|
||||||
|
);
|
||||||
|
PRODUCT_BUNDLE_IDENTIFIER = com.example.cekSuara;
|
||||||
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
|
SWIFT_VERSION = 5.0;
|
||||||
|
VERSIONING_SYSTEM = "apple-generic";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
331C8087294A63A400263BE5 /* Build configuration list for PBXNativeTarget "RunnerTests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
331C8088294A63A400263BE5 /* Debug */,
|
||||||
|
331C8089294A63A400263BE5 /* Release */,
|
||||||
|
331C808A294A63A400263BE5 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147031CF9000F007C117D /* Debug */,
|
||||||
|
97C147041CF9000F007C117D /* Release */,
|
||||||
|
249021D3217E4FDB00AE95B9 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
97C147061CF9000F007C117D /* Debug */,
|
||||||
|
97C147071CF9000F007C117D /* Release */,
|
||||||
|
249021D4217E4FDB00AE95B9 /* Profile */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = 97C146E61CF9000F007C117D /* Project object */;
|
||||||
|
}
|
7
ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
98
ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
Normal file
@ -0,0 +1,98 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1430"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
<Testables>
|
||||||
|
<TestableReference
|
||||||
|
skipped = "NO"
|
||||||
|
parallelizable = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "331C8080294A63A400263BE5"
|
||||||
|
BuildableName = "RunnerTests.xctest"
|
||||||
|
BlueprintName = "RunnerTests"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</TestableReference>
|
||||||
|
</Testables>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
debugServiceExtension = "internal"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
buildConfiguration = "Profile"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable
|
||||||
|
runnableDebuggingMode = "0">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
|
||||||
|
BuildableName = "Runner.app"
|
||||||
|
BlueprintName = "Runner"
|
||||||
|
ReferencedContainer = "container:Runner.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
7
ios/Runner.xcworkspace/contents.xcworkspacedata
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "group:Runner.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDEDidComputeMac32BitWarning</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>PreviewsEnabled</key>
|
||||||
|
<false/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
13
ios/Runner/AppDelegate.swift
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import UIKit
|
||||||
|
import Flutter
|
||||||
|
|
||||||
|
@UIApplicationMain
|
||||||
|
@objc class AppDelegate: FlutterAppDelegate {
|
||||||
|
override func application(
|
||||||
|
_ application: UIApplication,
|
||||||
|
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
|
||||||
|
) -> Bool {
|
||||||
|
GeneratedPluginRegistrant.register(with: self)
|
||||||
|
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
|
||||||
|
}
|
||||||
|
}
|
122
ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-20x20@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-29x29@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-40x40@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "60x60",
|
||||||
|
"idiom" : "iphone",
|
||||||
|
"filename" : "Icon-App-60x60@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "20x20",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-20x20@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "29x29",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-29x29@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "40x40",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-40x40@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "76x76",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-76x76@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "83.5x83.5",
|
||||||
|
"idiom" : "ipad",
|
||||||
|
"filename" : "Icon-App-83.5x83.5@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"size" : "1024x1024",
|
||||||
|
"idiom" : "ios-marketing",
|
||||||
|
"filename" : "Icon-App-1024x1024@1x.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 295 B |
After Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 450 B |
After Width: | Height: | Size: 282 B |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 704 B |
After Width: | Height: | Size: 406 B |
After Width: | Height: | Size: 586 B |
After Width: | Height: | Size: 862 B |
After Width: | Height: | Size: 862 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 762 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
23
ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json
vendored
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"images" : [
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage.png",
|
||||||
|
"scale" : "1x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@2x.png",
|
||||||
|
"scale" : "2x"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idiom" : "universal",
|
||||||
|
"filename" : "LaunchImage@3x.png",
|
||||||
|
"scale" : "3x"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"info" : {
|
||||||
|
"version" : 1,
|
||||||
|
"author" : "xcode"
|
||||||
|
}
|
||||||
|
}
|
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
vendored
Normal file
After Width: | Height: | Size: 68 B |
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
vendored
Normal file
After Width: | Height: | Size: 68 B |
BIN
ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
vendored
Normal file
After Width: | Height: | Size: 68 B |
5
ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Launch Screen Assets
|
||||||
|
|
||||||
|
You can customize the launch screen with your own desired assets by replacing the image files in this directory.
|
||||||
|
|
||||||
|
You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
|
37
ios/Runner/Base.lproj/LaunchScreen.storyboard
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--View Controller-->
|
||||||
|
<scene sceneID="EHf-IW-A2E">
|
||||||
|
<objects>
|
||||||
|
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<subviews>
|
||||||
|
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
|
||||||
|
</imageView>
|
||||||
|
</subviews>
|
||||||
|
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
||||||
|
<constraints>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
|
||||||
|
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
|
||||||
|
</constraints>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
<point key="canvasLocation" x="53" y="375"/>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
<resources>
|
||||||
|
<image name="LaunchImage" width="168" height="185"/>
|
||||||
|
</resources>
|
||||||
|
</document>
|
26
ios/Runner/Base.lproj/Main.storyboard
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
|
||||||
|
<dependencies>
|
||||||
|
<deployment identifier="iOS"/>
|
||||||
|
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
|
||||||
|
</dependencies>
|
||||||
|
<scenes>
|
||||||
|
<!--Flutter View Controller-->
|
||||||
|
<scene sceneID="tne-QT-ifu">
|
||||||
|
<objects>
|
||||||
|
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
|
||||||
|
<layoutGuides>
|
||||||
|
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
|
||||||
|
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
|
||||||
|
</layoutGuides>
|
||||||
|
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
|
||||||
|
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
|
||||||
|
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||||
|
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
|
||||||
|
</view>
|
||||||
|
</viewController>
|
||||||
|
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
|
||||||
|
</objects>
|
||||||
|
</scene>
|
||||||
|
</scenes>
|
||||||
|
</document>
|
51
ios/Runner/Info.plist
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
|
<string>$(DEVELOPMENT_LANGUAGE)</string>
|
||||||
|
<key>CFBundleDisplayName</key>
|
||||||
|
<string>Cek Suara</string>
|
||||||
|
<key>CFBundleExecutable</key>
|
||||||
|
<string>$(EXECUTABLE_NAME)</string>
|
||||||
|
<key>CFBundleIdentifier</key>
|
||||||
|
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||||
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
|
<string>6.0</string>
|
||||||
|
<key>CFBundleName</key>
|
||||||
|
<string>cek_suara</string>
|
||||||
|
<key>CFBundlePackageType</key>
|
||||||
|
<string>APPL</string>
|
||||||
|
<key>CFBundleShortVersionString</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NAME)</string>
|
||||||
|
<key>CFBundleSignature</key>
|
||||||
|
<string>????</string>
|
||||||
|
<key>CFBundleVersion</key>
|
||||||
|
<string>$(FLUTTER_BUILD_NUMBER)</string>
|
||||||
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
<true/>
|
||||||
|
<key>UILaunchStoryboardName</key>
|
||||||
|
<string>LaunchScreen</string>
|
||||||
|
<key>UIMainStoryboardFile</key>
|
||||||
|
<string>Main</string>
|
||||||
|
<key>UISupportedInterfaceOrientations</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||||
|
<array>
|
||||||
|
<string>UIInterfaceOrientationPortrait</string>
|
||||||
|
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||||
|
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||||
|
</array>
|
||||||
|
<key>UIViewControllerBasedStatusBarAppearance</key>
|
||||||
|
<false/>
|
||||||
|
<key>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
1
ios/Runner/Runner-Bridging-Header.h
Normal file
@ -0,0 +1 @@
|
|||||||
|
#import "GeneratedPluginRegistrant.h"
|
12
ios/RunnerTests/RunnerTests.swift
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import Flutter
|
||||||
|
import UIKit
|
||||||
|
import XCTest
|
||||||
|
|
||||||
|
class RunnerTests: XCTestCase {
|
||||||
|
|
||||||
|
func testExample() {
|
||||||
|
// If you add code to the Runner application, consider adding tests here.
|
||||||
|
// See https://developer.apple.com/documentation/xctest for more information about using XCTest.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
60
lib/app/app.dart
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
import 'package:stacked/stacked_annotations.dart';
|
||||||
|
|
||||||
|
import '../services/global_var.dart';
|
||||||
|
import '../services/http_services.dart';
|
||||||
|
import '../services/my_easyloading.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/admin_index_tracking_view.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/halaman_area/halaman_area_view.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/halaman_caleg/halaman_caleg_view.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/halaman_caleg/tambah_edit_caleg/tambah_edit_caleg_view.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/halaman_pengaturan/halaman_pengaturan_view.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/tim_survei/tim_survei_view.dart';
|
||||||
|
import '../ui/views/login_screen/login_screen_view.dart';
|
||||||
|
import '../ui/views/splash_screen/splash_screen_view.dart';
|
||||||
|
|
||||||
|
@StackedApp(
|
||||||
|
routes: [
|
||||||
|
MaterialRoute(page: SplashScreenView, initial: true),
|
||||||
|
MaterialRoute(page: LoginScreenView),
|
||||||
|
MaterialRoute(
|
||||||
|
page: AdminIndexTrackingView,
|
||||||
|
children: [
|
||||||
|
MaterialRoute(
|
||||||
|
page: AdminFirstPageView,
|
||||||
|
initial: true,
|
||||||
|
),
|
||||||
|
MaterialRoute(
|
||||||
|
page: HalamanAreaView,
|
||||||
|
),
|
||||||
|
MaterialRoute(
|
||||||
|
page: HalamanCalegView,
|
||||||
|
),
|
||||||
|
MaterialRoute(
|
||||||
|
page: TimSurveiView,
|
||||||
|
),
|
||||||
|
MaterialRoute(
|
||||||
|
page: HalamanPengaturanView,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
dialogs: [
|
||||||
|
StackedDialog(classType: TambahEditCalegView),
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
LazySingleton(classType: NavigationService),
|
||||||
|
LazySingleton(classType: DialogService),
|
||||||
|
LazySingleton(classType: SnackbarService),
|
||||||
|
LazySingleton(classType: BottomSheetService),
|
||||||
|
//
|
||||||
|
// LazySingleton(classType: UserHomeView),
|
||||||
|
// LazySingleton(classType: PengembangHomeView),
|
||||||
|
LazySingleton(classType: MyEasyLoading),
|
||||||
|
LazySingleton(classType: MyHttpServices),
|
||||||
|
LazySingleton(classType: GlobalVar),
|
||||||
|
],
|
||||||
|
logger: StackedLogger(),
|
||||||
|
)
|
||||||
|
class App {}
|
25
lib/app/app.dialogs.dart
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// StackedDialogGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
|
import 'app.locator.dart';
|
||||||
|
import '../ui/views/admin_index_tracking/halaman_caleg/tambah_edit_caleg/tambah_edit_caleg_view.dart';
|
||||||
|
|
||||||
|
enum DialogType {
|
||||||
|
tambahEditCalegView,
|
||||||
|
}
|
||||||
|
|
||||||
|
void setupDialogUi() {
|
||||||
|
final dialogService = locator<DialogService>();
|
||||||
|
|
||||||
|
final Map<DialogType, DialogBuilder> builders = {
|
||||||
|
DialogType.tambahEditCalegView: (context, request, completer) =>
|
||||||
|
TambahEditCalegView(request: request, completer: completer),
|
||||||
|
};
|
||||||
|
|
||||||
|
dialogService.registerCustomDialogBuilders(builders);
|
||||||
|
}
|
37
lib/app/app.locator.dart
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// StackedLocatorGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// ignore_for_file: public_member_api_docs, implementation_imports, depend_on_referenced_packages
|
||||||
|
|
||||||
|
import 'package:stacked_services/src/bottom_sheet/bottom_sheet_service.dart';
|
||||||
|
import 'package:stacked_services/src/dialog/dialog_service.dart';
|
||||||
|
import 'package:stacked_services/src/navigation/navigation_service.dart';
|
||||||
|
import 'package:stacked_services/src/snackbar/snackbar_service.dart';
|
||||||
|
import 'package:stacked_shared/stacked_shared.dart';
|
||||||
|
|
||||||
|
import '../services/global_var.dart';
|
||||||
|
import '../services/http_services.dart';
|
||||||
|
import '../services/my_easyloading.dart';
|
||||||
|
|
||||||
|
final locator = StackedLocator.instance;
|
||||||
|
|
||||||
|
Future<void> setupLocator({
|
||||||
|
String? environment,
|
||||||
|
EnvironmentFilter? environmentFilter,
|
||||||
|
}) async {
|
||||||
|
// Register environments
|
||||||
|
locator.registerEnvironment(
|
||||||
|
environment: environment, environmentFilter: environmentFilter);
|
||||||
|
|
||||||
|
// Register dependencies
|
||||||
|
locator.registerLazySingleton(() => NavigationService());
|
||||||
|
locator.registerLazySingleton(() => DialogService());
|
||||||
|
locator.registerLazySingleton(() => SnackbarService());
|
||||||
|
locator.registerLazySingleton(() => BottomSheetService());
|
||||||
|
locator.registerLazySingleton(() => MyEasyLoading());
|
||||||
|
locator.registerLazySingleton(() => MyHttpServices());
|
||||||
|
locator.registerLazySingleton(() => GlobalVar());
|
||||||
|
}
|
159
lib/app/app.logger.dart
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// StackedLoggerGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// ignore_for_file: avoid_print, depend_on_referenced_packages
|
||||||
|
|
||||||
|
/// Maybe this should be generated for the user as well?
|
||||||
|
///
|
||||||
|
/// import 'package:customer_app/services/stackdriver/stackdriver_service.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:logger/logger.dart';
|
||||||
|
|
||||||
|
class SimpleLogPrinter extends LogPrinter {
|
||||||
|
final String className;
|
||||||
|
final bool printCallingFunctionName;
|
||||||
|
final bool printCallStack;
|
||||||
|
final List<String> exludeLogsFromClasses;
|
||||||
|
final String? showOnlyClass;
|
||||||
|
|
||||||
|
SimpleLogPrinter(
|
||||||
|
this.className, {
|
||||||
|
this.printCallingFunctionName = true,
|
||||||
|
this.printCallStack = false,
|
||||||
|
this.exludeLogsFromClasses = const [],
|
||||||
|
this.showOnlyClass,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<String> log(LogEvent event) {
|
||||||
|
var color = PrettyPrinter.levelColors[event.level];
|
||||||
|
var emoji = PrettyPrinter.levelEmojis[event.level];
|
||||||
|
var methodName = _getMethodName();
|
||||||
|
|
||||||
|
var methodNameSection =
|
||||||
|
printCallingFunctionName && methodName != null ? ' | $methodName' : '';
|
||||||
|
var stackLog = event.stackTrace.toString();
|
||||||
|
var output =
|
||||||
|
'$emoji $className$methodNameSection - ${event.message}${event.error != null ? '\nERROR: ${event.error}\n' : ''}${printCallStack ? '\nSTACKTRACE:\n$stackLog' : ''}';
|
||||||
|
|
||||||
|
if (exludeLogsFromClasses
|
||||||
|
.any((excludeClass) => className == excludeClass) ||
|
||||||
|
(showOnlyClass != null && className != showOnlyClass)) return [];
|
||||||
|
|
||||||
|
final pattern = RegExp('.{1,800}'); // 800 is the size of each chunk
|
||||||
|
List<String> result = [];
|
||||||
|
|
||||||
|
for (var line in output.split('\n')) {
|
||||||
|
result.addAll(pattern.allMatches(line).map((match) {
|
||||||
|
if (kReleaseMode) {
|
||||||
|
return match.group(0)!;
|
||||||
|
} else {
|
||||||
|
return color!(match.group(0)!);
|
||||||
|
}
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
String? _getMethodName() {
|
||||||
|
try {
|
||||||
|
final currentStack = StackTrace.current;
|
||||||
|
final formattedStacktrace = _formatStackTrace(currentStack, 3);
|
||||||
|
if (kIsWeb) {
|
||||||
|
final classNameParts = _splitClassNameWords(className);
|
||||||
|
return _findMostMatchedTrace(formattedStacktrace!, classNameParts)
|
||||||
|
.split(' ')
|
||||||
|
.last;
|
||||||
|
} else {
|
||||||
|
final realFirstLine = formattedStacktrace
|
||||||
|
?.firstWhere((line) => line.contains(className), orElse: () => "");
|
||||||
|
|
||||||
|
final methodName = realFirstLine?.replaceAll('$className.', '');
|
||||||
|
return methodName;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
// There's no deliberate function call from our code so we return null;
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> _splitClassNameWords(String className) {
|
||||||
|
return className
|
||||||
|
.split(RegExp(r'(?=[A-Z])'))
|
||||||
|
.map((e) => e.toLowerCase())
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// When the faulty word exists in the begging this method will not be very usefull
|
||||||
|
String _findMostMatchedTrace(
|
||||||
|
List<String> stackTraces, List<String> keyWords) {
|
||||||
|
String match = stackTraces.firstWhere(
|
||||||
|
(trace) => _doesTraceContainsAllKeywords(trace, keyWords),
|
||||||
|
orElse: () => '');
|
||||||
|
if (match.isEmpty) {
|
||||||
|
match = _findMostMatchedTrace(
|
||||||
|
stackTraces, keyWords.sublist(0, keyWords.length - 1));
|
||||||
|
}
|
||||||
|
return match;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _doesTraceContainsAllKeywords(String stackTrace, List<String> keywords) {
|
||||||
|
final formattedKeywordsAsRegex = RegExp(keywords.join('.*'));
|
||||||
|
return stackTrace.contains(formattedKeywordsAsRegex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final stackTraceRegex = RegExp(r'#[0-9]+[\s]+(.+) \(([^\s]+)\)');
|
||||||
|
|
||||||
|
List<String>? _formatStackTrace(StackTrace stackTrace, int methodCount) {
|
||||||
|
var lines = stackTrace.toString().split('\n');
|
||||||
|
|
||||||
|
var formatted = <String>[];
|
||||||
|
var count = 0;
|
||||||
|
for (var line in lines) {
|
||||||
|
var match = stackTraceRegex.matchAsPrefix(line);
|
||||||
|
if (match != null) {
|
||||||
|
if (match.group(2)!.startsWith('package:logger')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var newLine = ("${match.group(1)}");
|
||||||
|
formatted.add(newLine.replaceAll('<anonymous closure>', '()'));
|
||||||
|
if (++count == methodCount) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
formatted.add(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (formatted.isEmpty) {
|
||||||
|
return null;
|
||||||
|
} else {
|
||||||
|
return formatted;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Logger getLogger(
|
||||||
|
String className, {
|
||||||
|
bool printCallingFunctionName = true,
|
||||||
|
bool printCallstack = false,
|
||||||
|
List<String> exludeLogsFromClasses = const [],
|
||||||
|
String? showOnlyClass,
|
||||||
|
}) {
|
||||||
|
return Logger(
|
||||||
|
printer: SimpleLogPrinter(
|
||||||
|
className,
|
||||||
|
printCallingFunctionName: printCallingFunctionName,
|
||||||
|
printCallStack: printCallstack,
|
||||||
|
showOnlyClass: showOnlyClass,
|
||||||
|
exludeLogsFromClasses: exludeLogsFromClasses,
|
||||||
|
),
|
||||||
|
output: MultiOutput([
|
||||||
|
if (!kReleaseMode) ConsoleOutput(),
|
||||||
|
]),
|
||||||
|
);
|
||||||
|
}
|
404
lib/app/app.router.dart
Normal file
@ -0,0 +1,404 @@
|
|||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// StackedNavigatorGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
// ignore_for_file: no_leading_underscores_for_library_prefixes
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/admin_first_page/admin_first_page_view.dart'
|
||||||
|
as _i6;
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/admin_index_tracking_view.dart'
|
||||||
|
as _i4;
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_area/halaman_area_view.dart'
|
||||||
|
as _i7;
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_caleg/halaman_caleg_view.dart'
|
||||||
|
as _i8;
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/halaman_pengaturan/halaman_pengaturan_view.dart'
|
||||||
|
as _i10;
|
||||||
|
import 'package:cek_suara/ui/views/admin_index_tracking/tim_survei/tim_survei_view.dart'
|
||||||
|
as _i9;
|
||||||
|
import 'package:cek_suara/ui/views/login_screen/login_screen_view.dart' as _i3;
|
||||||
|
import 'package:cek_suara/ui/views/splash_screen/splash_screen_view.dart'
|
||||||
|
as _i2;
|
||||||
|
import 'package:flutter/material.dart' as _i5;
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart' as _i1;
|
||||||
|
import 'package:stacked_services/stacked_services.dart' as _i11;
|
||||||
|
|
||||||
|
class Routes {
|
||||||
|
static const splashScreenView = '/';
|
||||||
|
|
||||||
|
static const loginScreenView = '/login-screen-view';
|
||||||
|
|
||||||
|
static const adminIndexTrackingView = '/admin-index-tracking-view';
|
||||||
|
|
||||||
|
static const all = <String>{
|
||||||
|
splashScreenView,
|
||||||
|
loginScreenView,
|
||||||
|
adminIndexTrackingView,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class StackedRouter extends _i1.RouterBase {
|
||||||
|
final _routes = <_i1.RouteDef>[
|
||||||
|
_i1.RouteDef(
|
||||||
|
Routes.splashScreenView,
|
||||||
|
page: _i2.SplashScreenView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
Routes.loginScreenView,
|
||||||
|
page: _i3.LoginScreenView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
Routes.adminIndexTrackingView,
|
||||||
|
page: _i4.AdminIndexTrackingView,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
||||||
|
_i2.SplashScreenView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i2.SplashScreenView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i3.LoginScreenView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i3.LoginScreenView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i4.AdminIndexTrackingView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i4.AdminIndexTrackingView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<_i1.RouteDef> get routes => _routes;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
class AdminIndexTrackingViewRoutes {
|
||||||
|
static const adminFirstPageView = '';
|
||||||
|
|
||||||
|
static const halamanAreaView = 'halaman-area-view';
|
||||||
|
|
||||||
|
static const halamanCalegView = 'halaman-caleg-view';
|
||||||
|
|
||||||
|
static const timSurveiView = 'tim-survei-view';
|
||||||
|
|
||||||
|
static const halamanPengaturanView = 'halaman-pengaturan-view';
|
||||||
|
|
||||||
|
static const all = <String>{
|
||||||
|
adminFirstPageView,
|
||||||
|
halamanAreaView,
|
||||||
|
halamanCalegView,
|
||||||
|
timSurveiView,
|
||||||
|
halamanPengaturanView,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class AdminIndexTrackingViewRouter extends _i1.RouterBase {
|
||||||
|
final _routes = <_i1.RouteDef>[
|
||||||
|
_i1.RouteDef(
|
||||||
|
AdminIndexTrackingViewRoutes.adminFirstPageView,
|
||||||
|
page: _i6.AdminFirstPageView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
AdminIndexTrackingViewRoutes.halamanAreaView,
|
||||||
|
page: _i7.HalamanAreaView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
AdminIndexTrackingViewRoutes.halamanCalegView,
|
||||||
|
page: _i8.HalamanCalegView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
AdminIndexTrackingViewRoutes.timSurveiView,
|
||||||
|
page: _i9.TimSurveiView,
|
||||||
|
),
|
||||||
|
_i1.RouteDef(
|
||||||
|
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
||||||
|
page: _i10.HalamanPengaturanView,
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
final _pagesMap = <Type, _i1.StackedRouteFactory>{
|
||||||
|
_i6.AdminFirstPageView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i6.AdminFirstPageView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i7.HalamanAreaView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i7.HalamanAreaView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i8.HalamanCalegView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i8.HalamanCalegView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i9.TimSurveiView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i9.TimSurveiView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
_i10.HalamanPengaturanView: (data) {
|
||||||
|
return _i5.MaterialPageRoute<dynamic>(
|
||||||
|
builder: (context) => const _i10.HalamanPengaturanView(),
|
||||||
|
settings: data,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
@override
|
||||||
|
List<_i1.RouteDef> get routes => _routes;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Map<Type, _i1.StackedRouteFactory> get pagesMap => _pagesMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
extension NavigatorStateExtension on _i11.NavigationService {
|
||||||
|
Future<dynamic> navigateToSplashScreenView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(Routes.splashScreenView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> navigateToLoginScreenView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(Routes.loginScreenView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> navigateToAdminIndexTrackingView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(Routes.adminIndexTrackingView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
navigateToNestedAdminFirstPageViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(AdminIndexTrackingViewRoutes.adminFirstPageView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
navigateToNestedHalamanAreaViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(AdminIndexTrackingViewRoutes.halamanAreaView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
navigateToNestedHalamanCalegViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(AdminIndexTrackingViewRoutes.halamanCalegView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> navigateToNestedTimSurveiViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(AdminIndexTrackingViewRoutes.timSurveiView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
navigateToNestedHalamanPengaturanViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return navigateTo<dynamic>(
|
||||||
|
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> replaceWithSplashScreenView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(Routes.splashScreenView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> replaceWithLoginScreenView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(Routes.loginScreenView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> replaceWithAdminIndexTrackingView([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(Routes.adminIndexTrackingView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
replaceWithNestedAdminFirstPageViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(AdminIndexTrackingViewRoutes.adminFirstPageView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
replaceWithNestedHalamanAreaViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(AdminIndexTrackingViewRoutes.halamanAreaView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
replaceWithNestedHalamanCalegViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(AdminIndexTrackingViewRoutes.halamanCalegView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> replaceWithNestedTimSurveiViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(AdminIndexTrackingViewRoutes.timSurveiView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic>
|
||||||
|
replaceWithNestedHalamanPengaturanViewInAdminIndexTrackingViewRouter([
|
||||||
|
int? routerId,
|
||||||
|
bool preventDuplicates = true,
|
||||||
|
Map<String, String>? parameters,
|
||||||
|
Widget Function(BuildContext, Animation<double>, Animation<double>, Widget)?
|
||||||
|
transition,
|
||||||
|
]) async {
|
||||||
|
return replaceWith<dynamic>(
|
||||||
|
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
||||||
|
id: routerId,
|
||||||
|
preventDuplicates: preventDuplicates,
|
||||||
|
parameters: parameters,
|
||||||
|
transition: transition);
|
||||||
|
}
|
||||||
|
}
|
57
lib/app/core/custom_base_view_model.dart
Executable file
@ -0,0 +1,57 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
|
import '../../services/global_var.dart';
|
||||||
|
import '../../services/http_services.dart';
|
||||||
|
import '../../services/my_easyloading.dart';
|
||||||
|
import '../app.locator.dart';
|
||||||
|
import '../themes/app_colors.dart';
|
||||||
|
|
||||||
|
class CustomBaseViewModel extends BaseViewModel {
|
||||||
|
final dialogService = locator<DialogService>();
|
||||||
|
final navigationService = locator<NavigationService>();
|
||||||
|
final bottomSheetService = locator<BottomSheetService>();
|
||||||
|
final snackbarService = locator<SnackbarService>();
|
||||||
|
final easyLoading = locator<MyEasyLoading>();
|
||||||
|
final httpService = locator<MyHttpServices>();
|
||||||
|
final globalVar = locator<GlobalVar>();
|
||||||
|
|
||||||
|
void back() {
|
||||||
|
navigationService.back();
|
||||||
|
}
|
||||||
|
|
||||||
|
quitApp(BuildContext context) {
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: const Text('Keluar'),
|
||||||
|
content: const Text('Apakah Anda yakin ingin keluar?'),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
Navigator.of(context).pop(false);
|
||||||
|
},
|
||||||
|
child: const Text('Batal'),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
child: const Text(
|
||||||
|
'Keluar',
|
||||||
|
style: TextStyle(color: dangerColor),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
).then((value) {
|
||||||
|
if (value == true) {
|
||||||
|
SystemNavigator.pop();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
30
lib/app/themes/app_colors.dart
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
import 'dart:ui';
|
||||||
|
|
||||||
|
const Color mainColor = Color(0xFF25C0F1);
|
||||||
|
const Color secondaryColor = Color(0xFFB72025);
|
||||||
|
const Color dangerColor = Color(0xFFFF4B68);
|
||||||
|
const Color warningColor = Color(0xFFFBFFA3);
|
||||||
|
const Color lightColor = Color(0xFFF4FAFE);
|
||||||
|
const Color lightGreyColor = Color(0xFFFCFCFC);
|
||||||
|
const Color stockColor = Color(0xFFEEF3F6);
|
||||||
|
|
||||||
|
const Color backgroundColor = Color(0xFFE5E5E5);
|
||||||
|
const Color backgroundColor3 = Color(0xFFF6F7F8);
|
||||||
|
|
||||||
|
const Color orangeColor = Color.fromARGB(255, 250, 145, 84);
|
||||||
|
const Color blueColor = Color(0xFF026AA2);
|
||||||
|
const Color greenColor = Color(0xFF2ABB52);
|
||||||
|
const Color redColor = Color(0xFFED1717);
|
||||||
|
const Color greyBlueColor = Color(0xFF363F72);
|
||||||
|
|
||||||
|
const Color fontColor = Color(0xFF101828);
|
||||||
|
const Color fontSecondaryColor = Color(0xFF667085);
|
||||||
|
const Color fontParagraphColor = Color(0xFFB2B2B2);
|
||||||
|
const Color fontGrey = Color(0xFF1C1C1C);
|
||||||
|
|
||||||
|
const Color mainGrey = Color(0xFF8991A4);
|
||||||
|
const Color secondaryGrey = Color(0xFFD0D5DD);
|
||||||
|
const Color thirdGrey = Color(0xFFF2F4F7);
|
||||||
|
const Color fourthGrey = Color(0xFF5C5C5C);
|
||||||
|
const Color fifthGrey = Color(0xFFEBEBEB);
|
||||||
|
const Color sixthGrey = Color(0xFF151515);
|
44
lib/app/themes/app_text.dart
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'app_colors.dart';
|
||||||
|
|
||||||
|
const regularTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: fontColor);
|
||||||
|
|
||||||
|
const italicTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 14,
|
||||||
|
color: fontColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
);
|
||||||
|
|
||||||
|
const mediumTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
color: fontColor,
|
||||||
|
);
|
||||||
|
|
||||||
|
const semiBoldTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
color: fontColor,
|
||||||
|
);
|
||||||
|
|
||||||
|
const boldTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w700,
|
||||||
|
color: fontColor,
|
||||||
|
);
|
||||||
|
|
||||||
|
const extraBoldTextStyle = TextStyle(
|
||||||
|
fontFamily: 'Arial',
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
color: fontColor,
|
||||||
|
);
|
126
lib/app/themes/app_theme.dart
Executable file
@ -0,0 +1,126 @@
|
|||||||
|
// ignore_for_file: deprecated_member_use
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'app_colors.dart';
|
||||||
|
import 'app_text.dart';
|
||||||
|
|
||||||
|
ThemeData appTheme = ThemeData(
|
||||||
|
useMaterial3: true,
|
||||||
|
primaryColor: mainColor,
|
||||||
|
scaffoldBackgroundColor: Colors.white,
|
||||||
|
canvasColor: Colors.white,
|
||||||
|
fontFamily: 'Poppins',
|
||||||
|
appBarTheme: AppBarTheme(
|
||||||
|
elevation: 0,
|
||||||
|
titleTextStyle: boldTextStyle.copyWith(fontSize: 16, color: fontGrey),
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
textTheme: TextTheme(
|
||||||
|
headline1: regularTextStyle.copyWith(fontSize: 32),
|
||||||
|
headline2: regularTextStyle.copyWith(fontSize: 20),
|
||||||
|
headline3: regularTextStyle.copyWith(fontSize: 18),
|
||||||
|
),
|
||||||
|
elevatedButtonTheme: ElevatedButtonThemeData(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: mainColor,
|
||||||
|
foregroundColor: Colors.white,
|
||||||
|
disabledBackgroundColor: mainColor.withOpacity(.3),
|
||||||
|
minimumSize: const Size(double.maxFinite, 58),
|
||||||
|
textStyle: boldTextStyle,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
shadowColor: Colors.transparent,
|
||||||
|
elevation: 0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||||
|
style: OutlinedButton.styleFrom(
|
||||||
|
textStyle: boldTextStyle,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
side: const BorderSide(
|
||||||
|
color: mainColor,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
foregroundColor: mainColor,
|
||||||
|
// disabledForegroundColor: mainColor.withOpacity(.3),
|
||||||
|
minimumSize: const Size(double.maxFinite, 58),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
textButtonTheme: TextButtonThemeData(
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
foregroundColor: mainColor,
|
||||||
|
disabledForegroundColor: mainColor.withOpacity(.3),
|
||||||
|
elevation: 0,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
textStyle: semiBoldTextStyle,
|
||||||
|
shadowColor: Colors.transparent,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
iconTheme: const IconThemeData(
|
||||||
|
color: mainColor,
|
||||||
|
),
|
||||||
|
listTileTheme: ListTileThemeData(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
checkboxTheme: CheckboxThemeData(
|
||||||
|
fillColor: MaterialStateProperty.all(mainColor),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
),
|
||||||
|
side: const BorderSide(
|
||||||
|
color: secondaryGrey,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
radioTheme: RadioThemeData(
|
||||||
|
fillColor: MaterialStateProperty.all(mainColor),
|
||||||
|
),
|
||||||
|
tabBarTheme: TabBarTheme(
|
||||||
|
labelColor: mainColor,
|
||||||
|
unselectedLabelColor: secondaryGrey,
|
||||||
|
labelStyle: boldTextStyle.copyWith(fontSize: 16),
|
||||||
|
unselectedLabelStyle: mediumTextStyle.copyWith(fontSize: 16),
|
||||||
|
),
|
||||||
|
chipTheme: ChipThemeData(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
disabledColor: Colors.white,
|
||||||
|
selectedColor: Colors.white,
|
||||||
|
secondarySelectedColor: Colors.white,
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 16),
|
||||||
|
side: const BorderSide(color: fifthGrey),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(6),
|
||||||
|
),
|
||||||
|
labelStyle: regularTextStyle.copyWith(fontSize: 12, color: fontGrey),
|
||||||
|
secondaryLabelStyle:
|
||||||
|
regularTextStyle.copyWith(fontSize: 12, color: secondaryColor),
|
||||||
|
deleteIconColor: fontGrey,
|
||||||
|
showCheckmark: false,
|
||||||
|
),
|
||||||
|
popupMenuTheme: PopupMenuThemeData(
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: const BorderSide(
|
||||||
|
color: fifthGrey,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
colorScheme: const ColorScheme.light(
|
||||||
|
primary: mainColor,
|
||||||
|
secondary: secondaryColor,
|
||||||
|
onPrimary: Colors.white,
|
||||||
|
onSecondary: Colors.white,
|
||||||
|
error: dangerColor,
|
||||||
|
onError: dangerColor,
|
||||||
|
background: backgroundColor,
|
||||||
|
).copyWith(background: Colors.white),
|
||||||
|
);
|
40
lib/main.dart
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
|
import 'app/app.dialogs.dart';
|
||||||
|
import 'app/app.locator.dart';
|
||||||
|
import 'app/app.router.dart';
|
||||||
|
import 'app/themes/app_theme.dart';
|
||||||
|
|
||||||
|
Future main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
await dotenv.load(fileName: ".env");
|
||||||
|
await setupAllLocator();
|
||||||
|
runApp(const MyApp());
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatelessWidget {
|
||||||
|
const MyApp({super.key});
|
||||||
|
|
||||||
|
// This widget is the root of your application.
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
title: 'Cek Suara',
|
||||||
|
theme: appTheme,
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
navigatorKey: StackedService.navigatorKey,
|
||||||
|
onGenerateRoute: StackedRouter().onGenerateRoute,
|
||||||
|
builder: EasyLoading.init(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> setupAllLocator() async {
|
||||||
|
await setupLocator();
|
||||||
|
setupDialogUi();
|
||||||
|
// setupBottomsheetUi();
|
||||||
|
// setupSnackbarUi();
|
||||||
|
}
|
44
lib/model/area_model.dart
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
class AreaListModel {
|
||||||
|
List<AreaModel>? area;
|
||||||
|
int? jumlah;
|
||||||
|
|
||||||
|
AreaListModel({this.area, this.jumlah});
|
||||||
|
|
||||||
|
AreaListModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['area'] != null) {
|
||||||
|
area = <AreaModel>[];
|
||||||
|
json['area'].forEach((v) {
|
||||||
|
area!.add(AreaModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
jumlah = json['jumlah'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (area != null) {
|
||||||
|
data['area'] = area!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['jumlah'] = jumlah;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AreaModel {
|
||||||
|
int? idArea;
|
||||||
|
String? namaArea;
|
||||||
|
|
||||||
|
AreaModel({this.idArea, this.namaArea});
|
||||||
|
|
||||||
|
AreaModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
idArea = json['id_area'];
|
||||||
|
namaArea = json['nama_area'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id_area'] = idArea;
|
||||||
|
data['nama_area'] = namaArea;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
50
lib/model/caleg_model.dart
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
class CalegListModel {
|
||||||
|
List<CalegModel>? caleg;
|
||||||
|
int? jumlah;
|
||||||
|
|
||||||
|
CalegListModel({this.caleg, this.jumlah});
|
||||||
|
|
||||||
|
CalegListModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
if (json['caleg'] != null) {
|
||||||
|
caleg = <CalegModel>[];
|
||||||
|
json['caleg'].forEach((v) {
|
||||||
|
caleg!.add(CalegModel.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
jumlah = json['jumlah'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
if (caleg != null) {
|
||||||
|
data['caleg'] = caleg!.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['jumlah'] = jumlah;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CalegModel {
|
||||||
|
int? idCaleg;
|
||||||
|
String? namaCaleg;
|
||||||
|
int? nomorUrutCaleg;
|
||||||
|
String? foto;
|
||||||
|
|
||||||
|
CalegModel({this.idCaleg, this.namaCaleg, this.nomorUrutCaleg, this.foto});
|
||||||
|
|
||||||
|
CalegModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
idCaleg = json['id_caleg'];
|
||||||
|
namaCaleg = json['nama_caleg'];
|
||||||
|
nomorUrutCaleg = json['nomor_urut_caleg'];
|
||||||
|
foto = json['foto'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['id_caleg'] = idCaleg;
|
||||||
|
data['nama_caleg'] = namaCaleg;
|
||||||
|
data['nomor_urut_caleg'] = nomorUrutCaleg;
|
||||||
|
data['foto'] = foto;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
21
lib/model/my_response.model.dart
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
class MyResponseModel {
|
||||||
|
String? message;
|
||||||
|
dynamic data;
|
||||||
|
bool? status;
|
||||||
|
|
||||||
|
MyResponseModel({this.message, this.data, this.status});
|
||||||
|
|
||||||
|
MyResponseModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
message = json['message'];
|
||||||
|
data = json['data'];
|
||||||
|
status = json['status'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
|
data['message'] = message;
|
||||||
|
data['data'] = this.data;
|
||||||
|
data['status'] = status;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
3
lib/services/global_var.dart
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
class GlobalVar {
|
||||||
|
String backPressed = 'backNormal';
|
||||||
|
}
|
40
lib/services/http_services.dart
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter_dotenv/flutter_dotenv.dart';
|
||||||
|
|
||||||
|
class MyHttpServices {
|
||||||
|
final _options = BaseOptions(
|
||||||
|
baseUrl: dotenv.env['api_url']!,
|
||||||
|
connectTimeout: const Duration(milliseconds: 60000),
|
||||||
|
receiveTimeout: const Duration(milliseconds: 60000),
|
||||||
|
);
|
||||||
|
|
||||||
|
late Dio _dio;
|
||||||
|
|
||||||
|
MyHttpServices() {
|
||||||
|
_dio = Dio(_options);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Response> get(String path) async {
|
||||||
|
try {
|
||||||
|
return await _dio.get(path);
|
||||||
|
} on DioException {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Response> postWithFormData(String path, FormData formData) async {
|
||||||
|
try {
|
||||||
|
return await _dio.post(path, data: formData);
|
||||||
|
} on DioException {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<Response> delete(String path) async {
|
||||||
|
try {
|
||||||
|
return await _dio.delete(path);
|
||||||
|
} on DioException {
|
||||||
|
rethrow;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
39
lib/services/my_easyloading.dart
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||||
|
|
||||||
|
class MyEasyLoading {
|
||||||
|
showLoading() {
|
||||||
|
EasyLoading.show(
|
||||||
|
status: 'loading...',
|
||||||
|
maskType: EasyLoadingMaskType.black,
|
||||||
|
dismissOnTap: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
dismissLoading() {
|
||||||
|
EasyLoading.dismiss();
|
||||||
|
}
|
||||||
|
|
||||||
|
customLoading(String message) {
|
||||||
|
EasyLoading.show(
|
||||||
|
status: message,
|
||||||
|
maskType: EasyLoadingMaskType.black,
|
||||||
|
dismissOnTap: false,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
showSuccess(String message) {
|
||||||
|
EasyLoading.showSuccess(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
showError(String message) {
|
||||||
|
EasyLoading.showError(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
showInfo(String message) {
|
||||||
|
EasyLoading.showInfo(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
showProgress(double progress, String status) {
|
||||||
|
EasyLoading.showProgress(progress, status: status);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,117 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../app/themes/app_text.dart';
|
||||||
|
import '../../../widgets/top_container.dart';
|
||||||
|
import './admin_first_page_view_model.dart';
|
||||||
|
|
||||||
|
class AdminFirstPageView extends StatelessWidget {
|
||||||
|
const AdminFirstPageView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<AdminFirstPageViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => AdminFirstPageViewModel(),
|
||||||
|
onViewModelReady: (AdminFirstPageViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
AdminFirstPageViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
body: WillPopScope(
|
||||||
|
onWillPop: () async {
|
||||||
|
// model.log.i('backPressed: ${model.globalVar.backPressed}');
|
||||||
|
if (model.globalVar.backPressed == 'exitApp') {
|
||||||
|
// model.back();
|
||||||
|
model.quitApp(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const TopContainer(
|
||||||
|
title: 'Jumlah Area',
|
||||||
|
value: '10 Area',
|
||||||
|
icon: Icons.place_outlined,
|
||||||
|
background: warningColor,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
const TopContainer(
|
||||||
|
title: 'Jumlah Caleg',
|
||||||
|
value: '10 Caleg',
|
||||||
|
icon: Icons.co_present_outlined,
|
||||||
|
background: greenColor,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
const TopContainer(
|
||||||
|
title: 'Jumlah Pemilih',
|
||||||
|
value: '10 Pemilih',
|
||||||
|
icon: Icons.people_alt_outlined,
|
||||||
|
background: blueColor,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: 'Selamat Datang, ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
children: [
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Admin\n',
|
||||||
|
style: boldTextStyle,
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'Silahkan tambahkan data ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: 'Area ',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: greenColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text: 'terlebih dahulu sebelum menambahkan data ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
TextSpan(
|
||||||
|
text: 'Caleg',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: greenColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text:
|
||||||
|
'.\n\nData Pemilih akan diambil dari data yang dimasukkan oleh tim survei\n\n',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
const TextSpan(
|
||||||
|
text:
|
||||||
|
'Jika terjadi kesalahan pada data, silahkan hubungi ',
|
||||||
|
style: regularTextStyle,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
class AdminFirstPageViewModel extends CustomBaseViewModel {
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,71 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
import 'package:stylish_bottom_bar/model/bar_items.dart';
|
||||||
|
import 'package:stylish_bottom_bar/stylish_bottom_bar.dart';
|
||||||
|
|
||||||
|
import '../../../app/app.router.dart';
|
||||||
|
import '../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../app/themes/app_text.dart';
|
||||||
|
import './admin_index_tracking_view_model.dart';
|
||||||
|
|
||||||
|
class AdminIndexTrackingView extends StatelessWidget {
|
||||||
|
const AdminIndexTrackingView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<AdminIndexTrackingViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => AdminIndexTrackingViewModel(),
|
||||||
|
onViewModelReady: (AdminIndexTrackingViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
AdminIndexTrackingViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
extendBody: false,
|
||||||
|
body: ExtendedNavigator(
|
||||||
|
router: AdminIndexTrackingViewRouter(),
|
||||||
|
navigatorKey: StackedService.nestedNavigationKey(2),
|
||||||
|
),
|
||||||
|
bottomNavigationBar: StylishBottomBar(
|
||||||
|
items: [
|
||||||
|
for (var item in model.bottomNavBarList)
|
||||||
|
BottomBarItem(
|
||||||
|
icon: Icon(item['icon'],
|
||||||
|
color: model.currentIndex ==
|
||||||
|
model.bottomNavBarList.indexOf(item)
|
||||||
|
? warningColor
|
||||||
|
: fontColor),
|
||||||
|
title: Text(
|
||||||
|
item['name'],
|
||||||
|
style: regularTextStyle.copyWith(
|
||||||
|
color: model.currentIndex ==
|
||||||
|
model.bottomNavBarList.indexOf(item)
|
||||||
|
? warningColor
|
||||||
|
: fontColor,
|
||||||
|
),
|
||||||
|
// textAlign: TextAlign.l,
|
||||||
|
),
|
||||||
|
backgroundColor:
|
||||||
|
model.currentIndex == model.bottomNavBarList.indexOf(item)
|
||||||
|
? fontColor
|
||||||
|
: fontColor,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
currentIndex: model.currentIndex,
|
||||||
|
option: BubbleBarOptions(),
|
||||||
|
hasNotch: true,
|
||||||
|
backgroundColor: warningColor,
|
||||||
|
onTap: (value) {
|
||||||
|
model.handleNavigation(value);
|
||||||
|
},
|
||||||
|
// fabLocation: StylishBarFabLocation.center,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,68 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
|
||||||
|
import '../../../app/app.locator.dart';
|
||||||
|
import '../../../app/app.logger.dart';
|
||||||
|
import '../../../app/app.router.dart';
|
||||||
|
import '../../../services/global_var.dart';
|
||||||
|
|
||||||
|
class AdminIndexTrackingViewModel extends IndexTrackingViewModel {
|
||||||
|
final log = getLogger('AdminIndexTrackingViewModel');
|
||||||
|
final globalVar = locator<GlobalVar>();
|
||||||
|
final navigationService = locator<NavigationService>();
|
||||||
|
|
||||||
|
final _bottomNavBarList = [
|
||||||
|
{
|
||||||
|
'name': 'Area',
|
||||||
|
'icon': Icons.place_outlined,
|
||||||
|
'header': 'Halaman Area',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Caleg',
|
||||||
|
'icon': Icons.co_present_outlined,
|
||||||
|
'header': 'Halaman Caleg',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Tim\nSurvei',
|
||||||
|
'icon': Icons.people_outlined,
|
||||||
|
'header': 'Tim Survei',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'name': 'Pengaturan',
|
||||||
|
'icon': Icons.settings_outlined,
|
||||||
|
'header': 'Halaman Pengaturan',
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
String header = 'Halaman Utama';
|
||||||
|
|
||||||
|
List<Map<String, dynamic>> get bottomNavBarList => _bottomNavBarList;
|
||||||
|
|
||||||
|
final List<String> _views = [
|
||||||
|
AdminIndexTrackingViewRoutes.halamanAreaView,
|
||||||
|
AdminIndexTrackingViewRoutes.halamanCalegView,
|
||||||
|
AdminIndexTrackingViewRoutes.timSurveiView,
|
||||||
|
AdminIndexTrackingViewRoutes.halamanPengaturanView,
|
||||||
|
];
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setIndex(3);
|
||||||
|
// await super.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
void handleNavigation(int index) {
|
||||||
|
// log.d("handleNavigation: $index");
|
||||||
|
// log.d("currentIndex: $currentIndex");
|
||||||
|
|
||||||
|
// if (currentIndex == index) return;
|
||||||
|
|
||||||
|
setIndex(index);
|
||||||
|
header = _bottomNavBarList[index]['header'] as String;
|
||||||
|
navigationService.navigateTo(
|
||||||
|
_views[index],
|
||||||
|
id: 2,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,139 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:validatorless/validatorless.dart';
|
||||||
|
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../widgets/my_button.dart';
|
||||||
|
import '../../../widgets/my_textformfield.dart';
|
||||||
|
import './halaman_area_view_model.dart';
|
||||||
|
|
||||||
|
class HalamanAreaView extends StatelessWidget {
|
||||||
|
const HalamanAreaView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<HalamanAreaViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => HalamanAreaViewModel(),
|
||||||
|
onViewModelReady: (HalamanAreaViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
HalamanAreaViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
body: WillPopScope(
|
||||||
|
onWillPop: () async {
|
||||||
|
// model.log.i('backPressed: ${model.globalVar.backPressed}');
|
||||||
|
if (model.globalVar.backPressed == 'exitApp') {
|
||||||
|
// model.back();
|
||||||
|
model.quitApp(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: SafeArea(
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Form(
|
||||||
|
key: model.formKey,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
MyTextFormField(
|
||||||
|
hintText: 'Nama Area',
|
||||||
|
labelText: 'Nama Area',
|
||||||
|
controller: model.namaAreaController,
|
||||||
|
validator: Validatorless.required(
|
||||||
|
'Nama Area tidak boleh kosong'),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
SizedBox(
|
||||||
|
width: 250,
|
||||||
|
child: MyButton(
|
||||||
|
text: 'Tambah Area',
|
||||||
|
onPressed: () async {
|
||||||
|
if (model.formKey.currentState!.validate()) {
|
||||||
|
// close keyboard
|
||||||
|
FocusScope.of(context).unfocus();
|
||||||
|
bool res = await model.addArea();
|
||||||
|
model.log.i('res: $res');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Container(
|
||||||
|
height: double.infinity,
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.grey),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: warningColor,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'Jumlah Area: ${model.jumlahArea} area',
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
if (model.isBusy)
|
||||||
|
const Center(
|
||||||
|
child: CircularProgressIndicator()),
|
||||||
|
if (!model.isBusy)
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
if (model.jumlahArea == 0)
|
||||||
|
const Center(
|
||||||
|
child: Text(
|
||||||
|
'Belum ada area diinput')),
|
||||||
|
if (model.jumlahArea > 0)
|
||||||
|
for (var i = 0;
|
||||||
|
i < model.jumlahArea;
|
||||||
|
i++)
|
||||||
|
Card(
|
||||||
|
child: ListTile(
|
||||||
|
leading: Text('${i + 1}'),
|
||||||
|
title: Text(
|
||||||
|
'${model.listAreaModel[i].namaArea}'),
|
||||||
|
trailing: IconButton(
|
||||||
|
// trash bin icon
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.delete,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
model.deleteArea(model
|
||||||
|
.listAreaModel[i]
|
||||||
|
.idArea!);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,105 @@
|
|||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../../../app/app.logger.dart';
|
||||||
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../model/area_model.dart';
|
||||||
|
import '../../../../model/my_response.model.dart';
|
||||||
|
|
||||||
|
class HalamanAreaViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('HalamanAreaViewModel');
|
||||||
|
|
||||||
|
// variabel
|
||||||
|
List<AreaModel> listAreaModel = [];
|
||||||
|
int jumlahArea = 0;
|
||||||
|
|
||||||
|
// add area form
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
|
TextEditingController namaAreaController = TextEditingController();
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
await getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
getData() async {
|
||||||
|
log.i('getData');
|
||||||
|
setBusy(true);
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
try {
|
||||||
|
var response = await httpService.get('area');
|
||||||
|
log.i(response.data);
|
||||||
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
|
AreaListModel areaListModel =
|
||||||
|
AreaListModel.fromJson(myResponseModel.data);
|
||||||
|
listAreaModel = areaListModel.area!;
|
||||||
|
jumlahArea = areaListModel.jumlah!;
|
||||||
|
|
||||||
|
log.i('listAreaModel: $listAreaModel');
|
||||||
|
log.i('jumlahArea: $jumlahArea');
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
} finally {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> addArea() async {
|
||||||
|
log.i('addArea');
|
||||||
|
setBusy(true);
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
easyLoading.customLoading('Tambah Area..');
|
||||||
|
|
||||||
|
var formData = FormData.fromMap({
|
||||||
|
'area': namaAreaController.text,
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
var response = await httpService.postWithFormData('area', formData);
|
||||||
|
log.i(response.data);
|
||||||
|
await getData();
|
||||||
|
return true;
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
return false;
|
||||||
|
} finally {
|
||||||
|
easyLoading.dismissLoading();
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteArea(int idArea) {
|
||||||
|
dialogService
|
||||||
|
.showDialog(
|
||||||
|
title: 'Hapus Area',
|
||||||
|
description: 'Apakah Anda yakin ingin menghapus area ini?',
|
||||||
|
buttonTitle: 'Hapus',
|
||||||
|
cancelTitle: 'Batal',
|
||||||
|
buttonTitleColor: dangerColor,
|
||||||
|
cancelTitleColor: mainColor,
|
||||||
|
)
|
||||||
|
.then((value) async {
|
||||||
|
if (value!.confirmed) {
|
||||||
|
log.i('deleteArea id_area: $idArea');
|
||||||
|
setBusy(true);
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
easyLoading.customLoading('Hapus Area..');
|
||||||
|
|
||||||
|
try {
|
||||||
|
var response = await httpService.delete('area/$idArea');
|
||||||
|
log.i(response.data);
|
||||||
|
await getData();
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
} finally {
|
||||||
|
easyLoading.dismissLoading();
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,131 @@
|
|||||||
|
import 'package:cek_suara/app/themes/app_text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import '../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../widgets/top_container.dart';
|
||||||
|
import './halaman_caleg_view_model.dart';
|
||||||
|
|
||||||
|
class HalamanCalegView extends StatelessWidget {
|
||||||
|
const HalamanCalegView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<HalamanCalegViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => HalamanCalegViewModel(),
|
||||||
|
onViewModelReady: (HalamanCalegViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
HalamanCalegViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
body: WillPopScope(
|
||||||
|
onWillPop: () async {
|
||||||
|
// model.log.i('backPressed: ${model.globalVar.backPressed}');
|
||||||
|
if (model.globalVar.backPressed == 'exitApp') {
|
||||||
|
// model.back();
|
||||||
|
model.quitApp(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: SafeArea(
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height,
|
||||||
|
padding: const EdgeInsets.all(20),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
TopContainer(
|
||||||
|
title: 'Jumlah Caleg',
|
||||||
|
value: '${model.jumlahCaleg} Caleg',
|
||||||
|
icon: Icons.co_present_outlined,
|
||||||
|
background: greenColor,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 15),
|
||||||
|
Expanded(
|
||||||
|
// flex: 3,
|
||||||
|
child: Container(
|
||||||
|
height: double.infinity,
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border.all(color: Colors.grey),
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: warningColor,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.max,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: model.isBusy
|
||||||
|
? MainAxisAlignment.center
|
||||||
|
: (model.listCalegModel.isNotEmpty
|
||||||
|
? MainAxisAlignment.start
|
||||||
|
: MainAxisAlignment.center),
|
||||||
|
children: [
|
||||||
|
if (model.isBusy)
|
||||||
|
const LinearProgressIndicator(
|
||||||
|
minHeight: 5,
|
||||||
|
color: mainColor,
|
||||||
|
),
|
||||||
|
if (!model.isBusy &&
|
||||||
|
model.listCalegModel.isNotEmpty)
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
for (var i = 0;
|
||||||
|
i < model.jumlahCaleg;
|
||||||
|
i++)
|
||||||
|
Card(
|
||||||
|
child: ListTile(
|
||||||
|
leading: Text('${i + 1}'),
|
||||||
|
title: Text(
|
||||||
|
model
|
||||||
|
.listCalegModel[i].namaCaleg!,
|
||||||
|
style: boldTextStyle,
|
||||||
|
),
|
||||||
|
subtitle: Text(
|
||||||
|
'No. Urut: ${model.listCalegModel[i].nomorUrutCaleg!}',
|
||||||
|
style: italicTextStyle,
|
||||||
|
),
|
||||||
|
trailing: IconButton(
|
||||||
|
icon: const Icon(Icons.edit,
|
||||||
|
color: mainColor),
|
||||||
|
onPressed: () {},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (!model.isBusy && model.listCalegModel.isEmpty)
|
||||||
|
const Center(
|
||||||
|
child: Text(
|
||||||
|
'Tidak ada data caleg diinput sebelumnya',
|
||||||
|
style: italicTextStyle,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
floatingActionButton: FloatingActionButton(
|
||||||
|
onPressed: () {
|
||||||
|
model.addCaleg();
|
||||||
|
},
|
||||||
|
child: const Icon(Icons.add),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,53 @@
|
|||||||
|
import '../../../../app/app.dialogs.dart';
|
||||||
|
import '../../../../app/app.logger.dart';
|
||||||
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
import '../../../../model/caleg_model.dart';
|
||||||
|
import '../../../../model/my_response.model.dart';
|
||||||
|
|
||||||
|
class HalamanCalegViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('HalamanCalegViewModel');
|
||||||
|
|
||||||
|
// variabel
|
||||||
|
List<CalegModel> listCalegModel = [];
|
||||||
|
int jumlahCaleg = 0;
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
await getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
getData() async {
|
||||||
|
log.i('getData');
|
||||||
|
setBusy(true);
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
try {
|
||||||
|
var response = await httpService.get('caleg');
|
||||||
|
log.i(response.data);
|
||||||
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
|
CalegListModel calegListModel =
|
||||||
|
CalegListModel.fromJson(myResponseModel.data);
|
||||||
|
listCalegModel = calegListModel.caleg!;
|
||||||
|
jumlahCaleg = calegListModel.jumlah!;
|
||||||
|
|
||||||
|
log.i('listCalegModel: $listCalegModel');
|
||||||
|
log.i('jumlahCaleg: $jumlahCaleg');
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
} finally {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addCaleg() async {
|
||||||
|
// log.i('addCaleg');
|
||||||
|
var res = await dialogService.showCustomDialog(
|
||||||
|
variant: DialogType.tambahEditCalegView,
|
||||||
|
data: {
|
||||||
|
'title': 'Tambah Caleg',
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
log.i(res?.confirmed);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,216 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
import 'package:stacked_services/stacked_services.dart';
|
||||||
|
import 'package:validatorless/validatorless.dart';
|
||||||
|
|
||||||
|
import '../../../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../../../app/themes/app_text.dart';
|
||||||
|
import '../../../../widgets/my_button.dart';
|
||||||
|
import '../../../../widgets/my_textformfield.dart';
|
||||||
|
import './tambah_edit_caleg_view_model.dart';
|
||||||
|
|
||||||
|
class TambahEditCalegView extends StatelessWidget {
|
||||||
|
final DialogRequest? request;
|
||||||
|
final Function(DialogResponse)? completer;
|
||||||
|
|
||||||
|
const TambahEditCalegView({
|
||||||
|
Key? key,
|
||||||
|
this.request,
|
||||||
|
this.completer,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<TambahEditCalegViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => TambahEditCalegViewModel(),
|
||||||
|
onViewModelReady: (TambahEditCalegViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
TambahEditCalegViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Dialog(
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(15),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
color: backgroundColor,
|
||||||
|
),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Form(
|
||||||
|
key: model.formKey,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
request?.data['title'] ?? '',
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
CircleAvatar(
|
||||||
|
radius: 50,
|
||||||
|
backgroundColor: fontParagraphColor,
|
||||||
|
child: model.imageBytes == null
|
||||||
|
? const Icon(
|
||||||
|
Icons.person,
|
||||||
|
size: 50,
|
||||||
|
color: Colors.white,
|
||||||
|
)
|
||||||
|
: ClipRRect(
|
||||||
|
borderRadius: BorderRadius.circular(50),
|
||||||
|
child: Image.memory(
|
||||||
|
model.imageBytes!,
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
bottom: 0,
|
||||||
|
right: 0,
|
||||||
|
child: CircleAvatar(
|
||||||
|
radius: 15,
|
||||||
|
backgroundColor: warningColor,
|
||||||
|
child: IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
model.addImage();
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.add,
|
||||||
|
color: fontColor,
|
||||||
|
size: 15,
|
||||||
|
)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MyTextFormField(
|
||||||
|
hintText: 'Masukan Nama Caleg',
|
||||||
|
labelText: 'Nama Caleg',
|
||||||
|
controller: model.namaController,
|
||||||
|
validator: Validatorless.required(
|
||||||
|
'Nama Caleg tidak boleh kosong'),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
MyTextFormField(
|
||||||
|
hintText: 'Area',
|
||||||
|
labelText: 'Pencarian Area',
|
||||||
|
controller: model.cariAreaController,
|
||||||
|
suffixIcon: GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// remove keyboard focus
|
||||||
|
FocusScope.of(context).unfocus();
|
||||||
|
model.cariArea();
|
||||||
|
},
|
||||||
|
child: const Icon(Icons.search),
|
||||||
|
),
|
||||||
|
|
||||||
|
// controller: model.partaiController,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
SizedBox(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.3,
|
||||||
|
width: double.infinity,
|
||||||
|
|
||||||
|
// create 10 random checkbox
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (model.isBusy)
|
||||||
|
const Center(child: CircularProgressIndicator()),
|
||||||
|
if (!model.isBusy && model.listAreaModel.isNotEmpty)
|
||||||
|
// FutureBuilder(future: , builder: builder)
|
||||||
|
Wrap(
|
||||||
|
spacing: 10,
|
||||||
|
children: List.generate(
|
||||||
|
model.listAreaModel.length,
|
||||||
|
(index) => Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Checkbox(
|
||||||
|
value: model.listAreaId.contains(
|
||||||
|
model.listAreaModel[index].idArea!),
|
||||||
|
onChanged: (value) {
|
||||||
|
model.tambahHapusArea(
|
||||||
|
model.listAreaModel[index].idArea!,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
model.listAreaModel[index].namaArea!,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (!model.isBusy && model.listAreaModel.isEmpty)
|
||||||
|
Center(
|
||||||
|
child: RichText(
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
text: TextSpan(
|
||||||
|
text: 'Tidak ada pencarian area\n',
|
||||||
|
style: regularTextStyle,
|
||||||
|
children: [
|
||||||
|
TextSpan(
|
||||||
|
text:
|
||||||
|
' ${model.cariAreaController.text}',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
color: dangerColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
SizedBox(
|
||||||
|
width: 250,
|
||||||
|
child: MyButton(
|
||||||
|
text: 'Tambah Caleg',
|
||||||
|
onPressed: () async {
|
||||||
|
if (model.listAreaId.isEmpty) {
|
||||||
|
model.snackbarService.showSnackbar(
|
||||||
|
message:
|
||||||
|
'Pilih Area Calon Legislatif terlebih dahulu',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model.imageBytes == null) {
|
||||||
|
model.snackbarService.showSnackbar(
|
||||||
|
message:
|
||||||
|
'Pilih Foto Calon Legislatif terlebih dahulu',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (model.formKey.currentState!.validate()) {
|
||||||
|
model.addCaleg();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,165 @@
|
|||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:typed_data';
|
||||||
|
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:http_parser/http_parser.dart';
|
||||||
|
|
||||||
|
import '../../../../../app/app.logger.dart';
|
||||||
|
import '../../../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
|
import '../../../../../model/area_model.dart';
|
||||||
|
import '../../../../../model/my_response.model.dart';
|
||||||
|
|
||||||
|
class TambahEditCalegViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('TambahEditCalegViewModel');
|
||||||
|
|
||||||
|
// variabel list area
|
||||||
|
List<AreaModel> listAreaModel = [];
|
||||||
|
List<AreaModel> allListAreaModel = [];
|
||||||
|
|
||||||
|
// form variable
|
||||||
|
final formKey = GlobalKey<FormState>();
|
||||||
|
TextEditingController namaController = TextEditingController();
|
||||||
|
TextEditingController cariAreaController = TextEditingController();
|
||||||
|
List<int> listAreaId = [];
|
||||||
|
|
||||||
|
// image picker
|
||||||
|
String? _imagePath;
|
||||||
|
final ImagePicker _picker = ImagePicker();
|
||||||
|
XFile? imageFile;
|
||||||
|
Uint8List? imageBytes;
|
||||||
|
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
await getData();
|
||||||
|
}
|
||||||
|
|
||||||
|
getData() async {
|
||||||
|
log.i('getData');
|
||||||
|
setBusy(true);
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
try {
|
||||||
|
var response = await httpService.get('area');
|
||||||
|
log.i(response.data);
|
||||||
|
MyResponseModel myResponseModel = MyResponseModel.fromJson(response.data);
|
||||||
|
AreaListModel areaListModel =
|
||||||
|
AreaListModel.fromJson(myResponseModel.data);
|
||||||
|
listAreaModel = areaListModel.area!;
|
||||||
|
allListAreaModel = areaListModel.area!;
|
||||||
|
// jumlahArea = areaListModel.jumlah!;
|
||||||
|
|
||||||
|
log.i('listAreaModel: $listAreaModel');
|
||||||
|
// log.i('jumlahArea: $jumlahArea');
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
} finally {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setBusy(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void addImage() async {
|
||||||
|
try {
|
||||||
|
final XFile? image = await _picker.pickImage(source: ImageSource.gallery);
|
||||||
|
if (image != null) {
|
||||||
|
imageFile = image;
|
||||||
|
_imagePath = image.path;
|
||||||
|
imageBytes = await image.readAsBytes();
|
||||||
|
|
||||||
|
log.i('image path: $_imagePath');
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tambahHapusArea(int idArea) {
|
||||||
|
log.i('tambahHapusArea');
|
||||||
|
if (listAreaId.contains(idArea)) {
|
||||||
|
listAreaId.remove(idArea);
|
||||||
|
} else {
|
||||||
|
listAreaId.add(idArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
cariArea() {
|
||||||
|
log.i('cariArea ${cariAreaController.text}');
|
||||||
|
|
||||||
|
if (cariAreaController.text.isEmpty) {
|
||||||
|
listAreaModel = allListAreaModel;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
listAreaModel = allListAreaModel
|
||||||
|
.where((element) => element.namaArea!
|
||||||
|
.toLowerCase()
|
||||||
|
.contains(cariAreaController.text.toLowerCase()))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
addCaleg() async {
|
||||||
|
dialogService
|
||||||
|
.showDialog(
|
||||||
|
title: 'Tambah Caleg',
|
||||||
|
description:
|
||||||
|
'Apakah anda yakin ingin menambahkan Caleg ${namaController.text}?',
|
||||||
|
buttonTitle: 'Ya',
|
||||||
|
cancelTitle: 'Tidak',
|
||||||
|
)
|
||||||
|
.then((value) async {
|
||||||
|
if (value!.confirmed) {
|
||||||
|
log.i('addCaleg');
|
||||||
|
setBusy(true);
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
easyLoading.customLoading('Tambah Caleg..');
|
||||||
|
|
||||||
|
var formData = FormData.fromMap({
|
||||||
|
'nama': namaController.text,
|
||||||
|
'area': const JsonEncoder().convert(listAreaId),
|
||||||
|
'foto': await MultipartFile.fromFile(
|
||||||
|
imageFile!.path,
|
||||||
|
filename: imageFile!.name,
|
||||||
|
contentType: MediaType('image', 'jpeg'),
|
||||||
|
)
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
var response = await httpService.postWithFormData('caleg', formData);
|
||||||
|
log.i(response.data);
|
||||||
|
await getData();
|
||||||
|
|
||||||
|
navigationService.back();
|
||||||
|
// navigationService.back();
|
||||||
|
snackbarService.showSnackbar(
|
||||||
|
message: 'Berhasil menambahkan Caleg',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
);
|
||||||
|
// navigationService.popRepeated(2);
|
||||||
|
} catch (e) {
|
||||||
|
log.e(e);
|
||||||
|
|
||||||
|
// navigationService.back();
|
||||||
|
snackbarService.showSnackbar(
|
||||||
|
message: 'Gagal menambahkan Caleg, ${e.toString()}',
|
||||||
|
duration: const Duration(seconds: 2),
|
||||||
|
);
|
||||||
|
} finally {
|
||||||
|
easyLoading.dismissLoading();
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
setBusy(false);
|
||||||
|
// navigationService.back();
|
||||||
|
// Navigator.of(context!).pop();
|
||||||
|
// remove all dialog
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import './halaman_pengaturan_view_model.dart';
|
||||||
|
|
||||||
|
class HalamanPengaturanView extends StatelessWidget {
|
||||||
|
const HalamanPengaturanView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<HalamanPengaturanViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => HalamanPengaturanViewModel(),
|
||||||
|
onViewModelReady: (HalamanPengaturanViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
HalamanPengaturanViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
body: WillPopScope(
|
||||||
|
onWillPop: () async {
|
||||||
|
// model.log.i('backPressed: ${model.globalVar.backPressed}');
|
||||||
|
if (model.globalVar.backPressed == 'exitApp') {
|
||||||
|
// model.back();
|
||||||
|
model.quitApp(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: const Center(
|
||||||
|
child: Text(
|
||||||
|
'HalamanPengaturanView',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
class HalamanPengaturanViewModel extends CustomBaseViewModel {
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import './tim_survei_view_model.dart';
|
||||||
|
|
||||||
|
class TimSurveiView extends StatelessWidget {
|
||||||
|
const TimSurveiView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<TimSurveiViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => TimSurveiViewModel(),
|
||||||
|
onViewModelReady: (TimSurveiViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
TimSurveiViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
body: WillPopScope(
|
||||||
|
onWillPop: () async {
|
||||||
|
// model.log.i('backPressed: ${model.globalVar.backPressed}');
|
||||||
|
if (model.globalVar.backPressed == 'exitApp') {
|
||||||
|
// model.back();
|
||||||
|
model.quitApp(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: const Center(
|
||||||
|
child: Text(
|
||||||
|
'TimSurveiView',
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,7 @@
|
|||||||
|
import '../../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
class TimSurveiViewModel extends CustomBaseViewModel {
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'exitApp';
|
||||||
|
}
|
||||||
|
}
|
102
lib/ui/views/login_screen/login_screen_view.dart
Normal file
@ -0,0 +1,102 @@
|
|||||||
|
import 'package:cek_suara/app/themes/app_colors.dart';
|
||||||
|
import 'package:cek_suara/ui/widgets/my_button.dart';
|
||||||
|
import 'package:cek_suara/ui/widgets/my_textformfield.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import './login_screen_view_model.dart';
|
||||||
|
|
||||||
|
class LoginScreenView extends StatelessWidget {
|
||||||
|
const LoginScreenView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<LoginScreenViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => LoginScreenViewModel(),
|
||||||
|
onViewModelReady: (LoginScreenViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
LoginScreenViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: warningColor,
|
||||||
|
body: WillPopScope(
|
||||||
|
onWillPop: () async {
|
||||||
|
model.log.i('backPressed: ${model.globalVar.backPressed}');
|
||||||
|
if (model.globalVar.backPressed == 'backNormal') {
|
||||||
|
// model.back();
|
||||||
|
model.quitApp(context);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
child: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.symmetric(horizontal: 15, vertical: 10),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 50,
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/logo.png',
|
||||||
|
width: 200,
|
||||||
|
height: 200,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
'Halaman Login',
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
const MyTextFormField(
|
||||||
|
// controller: model.usernameController,
|
||||||
|
hintText: 'Username',
|
||||||
|
// prefixIcon: Icons.person,
|
||||||
|
obscureText: false,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
const MyTextFormField(
|
||||||
|
// controller: model.passwordController,
|
||||||
|
hintText: 'Password',
|
||||||
|
suffixIcon: Icon(Icons.lock),
|
||||||
|
obscureText: true,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 250,
|
||||||
|
child: MyButton(
|
||||||
|
// theBackgroundColor: lightColor,
|
||||||
|
textColor: fontColor,
|
||||||
|
text: 'Login',
|
||||||
|
onPressed: () {
|
||||||
|
model.login();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
21
lib/ui/views/login_screen/login_screen_view_model.dart
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
import '../../../app/app.router.dart';
|
||||||
|
|
||||||
|
import '../../../app/app.logger.dart';
|
||||||
|
import '../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
class LoginScreenViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('LoginScreenViewModel');
|
||||||
|
Future<void> init() async {
|
||||||
|
globalVar.backPressed = 'backNormal';
|
||||||
|
}
|
||||||
|
|
||||||
|
login() async {
|
||||||
|
easyLoading.customLoading('Login..');
|
||||||
|
globalVar.backPressed = 'cantBack';
|
||||||
|
await Future.delayed(const Duration(seconds: 2));
|
||||||
|
easyLoading.dismissLoading();
|
||||||
|
globalVar.backPressed = 'backNormal';
|
||||||
|
// navigationService.pushNamedAndRemoveUntil('/home-screen');
|
||||||
|
await navigationService.navigateToAdminIndexTrackingView();
|
||||||
|
}
|
||||||
|
}
|
90
lib/ui/views/splash_screen/splash_screen_view.dart
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:stacked/stacked.dart';
|
||||||
|
|
||||||
|
import '../../../app/themes/app_colors.dart';
|
||||||
|
import '../../../app/themes/app_text.dart';
|
||||||
|
import './splash_screen_view_model.dart';
|
||||||
|
|
||||||
|
class SplashScreenView extends StatelessWidget {
|
||||||
|
const SplashScreenView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ViewModelBuilder<SplashScreenViewModel>.reactive(
|
||||||
|
viewModelBuilder: () => SplashScreenViewModel(),
|
||||||
|
onViewModelReady: (SplashScreenViewModel model) async {
|
||||||
|
await model.init();
|
||||||
|
},
|
||||||
|
builder: (
|
||||||
|
BuildContext context,
|
||||||
|
SplashScreenViewModel model,
|
||||||
|
Widget? child,
|
||||||
|
) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: warningColor,
|
||||||
|
body: Center(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: SizedBox(
|
||||||
|
height: 100,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Image.asset(
|
||||||
|
'assets/logo.png',
|
||||||
|
width: 200,
|
||||||
|
height: 200,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'SISTEM CEK SUARA',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
// color: backgroundColor,
|
||||||
|
fontSize: 20,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'(Admin App)',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
// color: backgroundColor,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
const Expanded(child: SizedBox()),
|
||||||
|
Text(
|
||||||
|
'Created By',
|
||||||
|
style: regularTextStyle.copyWith(
|
||||||
|
fontSize: 12,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'Kicap Karan',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 13,
|
||||||
|
fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'www.kicap-karan.com',
|
||||||
|
style: boldTextStyle.copyWith(
|
||||||
|
fontSize: 13,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
12
lib/ui/views/splash_screen/splash_screen_view_model.dart
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import '../../../app/app.logger.dart';
|
||||||
|
import '../../../app/app.router.dart';
|
||||||
|
import '../../../app/core/custom_base_view_model.dart';
|
||||||
|
|
||||||
|
class SplashScreenViewModel extends CustomBaseViewModel {
|
||||||
|
final log = getLogger('SplashScreenViewModel');
|
||||||
|
Future<void> init() async {
|
||||||
|
// await 3 seconds then go to login
|
||||||
|
await Future.delayed(const Duration(seconds: 3));
|
||||||
|
await navigationService.navigateTo(Routes.loginScreenView);
|
||||||
|
}
|
||||||
|
}
|
38
lib/ui/widgets/my_button.dart
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../../app/themes/app_colors.dart';
|
||||||
|
|
||||||
|
class MyButton extends StatelessWidget {
|
||||||
|
const MyButton({
|
||||||
|
Key? key,
|
||||||
|
required this.text,
|
||||||
|
this.theBackgroundColor = mainColor,
|
||||||
|
this.textColor = backgroundColor,
|
||||||
|
this.onPressed,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final String text;
|
||||||
|
final VoidCallback? onPressed;
|
||||||
|
final Color theBackgroundColor;
|
||||||
|
final Color textColor;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ElevatedButton(
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: theBackgroundColor,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(30),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: onPressed,
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
style: TextStyle(
|
||||||
|
color: textColor,
|
||||||
|
fontSize: 18,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|