first commit
|
@ -0,0 +1,43 @@
|
||||||
|
# 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
|
||||||
|
.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
|
|
@ -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: "300451adae589accbece3490f4396f10bdf15e6e"
|
||||||
|
channel: "stable"
|
||||||
|
|
||||||
|
project_type: app
|
||||||
|
|
||||||
|
# Tracks metadata for the flutter migrate command
|
||||||
|
migration:
|
||||||
|
platforms:
|
||||||
|
- platform: root
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
- platform: android
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
- platform: ios
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
- platform: linux
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
- platform: macos
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
- platform: web
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
- platform: windows
|
||||||
|
create_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
base_revision: 300451adae589accbece3490f4396f10bdf15e6e
|
||||||
|
|
||||||
|
# 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'
|
|
@ -0,0 +1,16 @@
|
||||||
|
# discover_module
|
||||||
|
|
||||||
|
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.
|
|
@ -0,0 +1,28 @@
|
||||||
|
# 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.dev/lints.
|
||||||
|
#
|
||||||
|
# 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
|
|
@ -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
|
|
@ -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.discover_module"
|
||||||
|
compileSdk 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.discover_module"
|
||||||
|
// 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 {}
|
|
@ -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>
|
|
@ -0,0 +1,44 @@
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<application
|
||||||
|
android:label="discover_module"
|
||||||
|
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>
|
||||||
|
<!-- Required to query activities that can process text, see:
|
||||||
|
https://developer.android.com/training/package-visibility?hl=en and
|
||||||
|
https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.
|
||||||
|
|
||||||
|
In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. -->
|
||||||
|
<queries>
|
||||||
|
<intent>
|
||||||
|
<action android:name="android.intent.action.PROCESS_TEXT"/>
|
||||||
|
<data android:mimeType="text/plain"/>
|
||||||
|
</intent>
|
||||||
|
</queries>
|
||||||
|
</manifest>
|
|
@ -0,0 +1,5 @@
|
||||||
|
package com.example.discover_module
|
||||||
|
|
||||||
|
import io.flutter.embedding.android.FlutterActivity
|
||||||
|
|
||||||
|
class MainActivity: FlutterActivity()
|
|
@ -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>
|
|
@ -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>
|
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 442 B |
After Width: | Height: | Size: 721 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.4 KiB |
|
@ -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>
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1,18 @@
|
||||||
|
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
|
||||||
|
}
|
|
@ -0,0 +1,3 @@
|
||||||
|
org.gradle.jvmargs=-Xmx4G
|
||||||
|
android.useAndroidX=true
|
||||||
|
android.enableJetifier=true
|
|
@ -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.6.3-all.zip
|
|
@ -0,0 +1,26 @@
|
||||||
|
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")
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
google()
|
||||||
|
mavenCentral()
|
||||||
|
gradlePluginPortal()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
|
||||||
|
id "com.android.application" version "7.3.0" apply false
|
||||||
|
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
include ":app"
|
|
@ -0,0 +1,61 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 24.2.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="300px" height="54px" viewBox="0 0 300 54" style="enable-background:new 0 0 300 54;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#FFFFFF;}
|
||||||
|
.st1{fill:#F96731;}
|
||||||
|
.st2{fill:#2B9AF3;}
|
||||||
|
</style>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M10,52.2V1h6.3v29.2l14.9-15.1h8.1L25.1,28.8l15.6,23.3H33l-12.2-19l-4.4,4.3v14.7H10z"/>
|
||||||
|
<path class="st0" d="M85.5,52.2V15.1h5.7v5.3c2.7-4.1,6.7-6.1,11.8-6.1c2.2,0,4.3,0.4,6.2,1.2c1.9,0.8,3.3,1.9,4.2,3.2
|
||||||
|
c0.9,1.3,1.6,2.9,2,4.6c0.2,1.2,0.3,3.2,0.3,6.1v22.8h-6.3V29.6c0-2.6-0.2-4.5-0.7-5.7c-0.5-1.3-1.4-2.3-2.6-3
|
||||||
|
c-1.2-0.8-2.7-1.1-4.4-1.1c-2.7,0-5,0.8-6.9,2.5c-1.9,1.7-2.9,4.9-2.9,9.7v20.2H85.5z"/>
|
||||||
|
<path class="st0" d="M150.6,40.2l6.5,0.8c-1,3.8-2.9,6.7-5.7,8.8c-2.8,2.1-6.3,3.1-10.6,3.1c-5.4,0-9.7-1.7-12.9-5
|
||||||
|
c-3.2-3.3-4.8-8-4.8-14c0-6.2,1.6-11.1,4.8-14.5c3.2-3.4,7.4-5.2,12.5-5.2c5,0,9,1.7,12.1,5.1c3.1,3.4,4.7,8.1,4.7,14.2
|
||||||
|
c0,0.4,0,0.9,0,1.7h-27.6c0.2,4.1,1.4,7.2,3.5,9.4c2.1,2.2,4.7,3.2,7.7,3.2c2.3,0,4.3-0.6,5.9-1.8
|
||||||
|
C148.4,44.8,149.6,42.9,150.6,40.2z M130,30.1h20.7c-0.3-3.1-1.1-5.5-2.4-7c-2-2.4-4.6-3.6-7.8-3.6c-2.9,0-5.3,1-7.3,2.9
|
||||||
|
C131.3,24.3,130.2,26.8,130,30.1z"/>
|
||||||
|
<path class="st0" d="M189.2,38.6l6.2,0.8c-0.7,4.3-2.4,7.6-5.2,10c-2.8,2.4-6.2,3.6-10.2,3.6c-5.1,0-9.1-1.7-12.2-5
|
||||||
|
c-3.1-3.3-4.6-8.1-4.6-14.3c0-4,0.7-7.5,2-10.5c1.3-3,3.3-5.3,6.1-6.8c2.7-1.5,5.7-2.3,8.8-2.3c4,0,7.3,1,9.9,3.1
|
||||||
|
c2.6,2,4.2,4.9,4.9,8.7l-6.1,0.9c-0.6-2.5-1.6-4.4-3.1-5.6c-1.5-1.3-3.3-1.9-5.4-1.9c-3.2,0-5.7,1.1-7.7,3.4
|
||||||
|
c-2,2.3-3,5.9-3,10.8c0,5,1,8.6,2.9,10.9c1.9,2.3,4.4,3.4,7.5,3.4c2.5,0,4.5-0.8,6.2-2.3C187.7,44.1,188.7,41.7,189.2,38.6z"/>
|
||||||
|
<path class="st0" d="M214.4,46.5l0.9,5.5c-1.8,0.4-3.4,0.6-4.7,0.6c-2.3,0-4-0.4-5.3-1.1c-1.3-0.7-2.1-1.7-2.7-2.8
|
||||||
|
c-0.5-1.2-0.8-3.6-0.8-7.4V20h-4.6v-4.9h4.6V5.9l6.2-3.8v12.9h6.3V20h-6.3v21.7c0,1.8,0.1,2.9,0.3,3.5c0.2,0.5,0.6,0.9,1.1,1.2
|
||||||
|
c0.5,0.3,1.2,0.5,2.1,0.5C212.4,46.8,213.3,46.7,214.4,46.5z"/>
|
||||||
|
<path class="st0" d="M244.8,47.6c-2.3,2-4.6,3.4-6.7,4.2c-2.2,0.8-4.5,1.2-6.9,1.2c-4.1,0-7.2-1-9.4-3c-2.2-2-3.3-4.5-3.3-7.6
|
||||||
|
c0-1.8,0.4-3.5,1.2-5c0.8-1.5,1.9-2.7,3.2-3.6c1.3-0.9,2.8-1.6,4.5-2.1c1.2-0.3,3.1-0.6,5.6-0.9c5.1-0.6,8.8-1.3,11.2-2.2
|
||||||
|
c0-0.9,0-1.4,0-1.6c0-2.6-0.6-4.4-1.8-5.4c-1.6-1.4-4-2.1-7.2-2.1c-3,0-5.1,0.5-6.5,1.6c-1.4,1-2.4,2.9-3.1,5.5l-6.1-0.8
|
||||||
|
c0.6-2.6,1.5-4.8,2.8-6.4c1.3-1.6,3.1-2.9,5.5-3.7c2.4-0.9,5.2-1.3,8.4-1.3c3.2,0,5.7,0.4,7.7,1.1c2,0.7,3.4,1.7,4.4,2.8
|
||||||
|
c0.9,1.1,1.6,2.6,2,4.3c0.2,1.1,0.3,3,0.3,5.8v8.4c0,5.8,0.1,9.5,0.4,11.1c0.3,1.5,0.8,3,1.6,4.4H246
|
||||||
|
C245.4,50.9,244.9,49.3,244.8,47.6z M244.2,33.6c-2.3,0.9-5.7,1.7-10.3,2.4c-2.6,0.4-4.4,0.8-5.5,1.3c-1.1,0.5-1.9,1.1-2.5,2
|
||||||
|
c-0.6,0.9-0.9,1.9-0.9,3c0,1.7,0.6,3.1,1.9,4.2c1.3,1.1,3.1,1.7,5.6,1.7c2.4,0,4.6-0.5,6.5-1.6c1.9-1.1,3.3-2.5,4.2-4.3
|
||||||
|
c0.7-1.4,1-3.5,1-6.3V33.6z"/>
|
||||||
|
<path class="st0" d="M260.3,52.2V15.1h5.7v5.6c1.4-2.6,2.8-4.4,4-5.2c1.2-0.8,2.6-1.3,4-1.3c2.1,0,4.3,0.7,6.5,2l-2.2,5.8
|
||||||
|
c-1.5-0.9-3.1-1.4-4.6-1.4c-1.4,0-2.6,0.4-3.7,1.2c-1.1,0.8-1.9,2-2.3,3.4c-0.7,2.2-1,4.7-1,7.3v19.4H260.3z"/>
|
||||||
|
<g>
|
||||||
|
<circle class="st1" cx="60.7" cy="48.6" r="3.5"/>
|
||||||
|
<circle class="st1" cx="60.7" cy="17.8" r="3.5"/>
|
||||||
|
<path class="st2" d="M57.3,44.8c-5-1.5-8.6-6.1-8.6-11.6c0-5.4,3.6-10.1,8.6-11.6c-1.1-1-1.7-2.3-1.7-3.9c0-1,0.3-1.9,0.7-2.7
|
||||||
|
c0,0,0,0,0,0c-8.1,2-14.2,9.4-14.2,18.1c0,8.7,6,16.1,14.2,18.1c0,0,0,0,0,0c-0.5-0.8-0.7-1.7-0.7-2.7
|
||||||
|
C55.5,47.1,56.2,45.7,57.3,44.8z"/>
|
||||||
|
<path class="st2" d="M65.2,15.1c0.5,0.8,0.8,1.7,0.8,2.7c0,1.5-0.7,2.9-1.7,3.9c5,1.5,8.6,6.1,8.6,11.6
|
||||||
|
c0,5.4-3.6,10.1-8.6,11.6c1.1,1,1.7,2.3,1.7,3.9c0,1-0.3,1.9-0.8,2.7c8.1-2,14.2-9.4,14.2-18.1C79.4,24.5,73.3,17.1,65.2,15.1z
|
||||||
|
"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M290,8c0,3.4-2.7,6.1-6.1,6.1c-3.4,0-6.2-2.7-6.2-6.1c0-3.3,2.7-6,6.2-6C287.3,2,290,4.7,290,8z M279.2,8
|
||||||
|
c0,2.7,2,4.8,4.7,4.8c2.6,0,4.6-2.1,4.6-4.8c0-2.7-1.9-4.8-4.6-4.8C281.2,3.2,279.2,5.4,279.2,8z M282.9,11.1h-1.4v-6
|
||||||
|
C282,5,282.8,5,283.8,5c1.1,0,1.6,0.2,2.1,0.4c0.3,0.3,0.6,0.7,0.6,1.3c0,0.7-0.5,1.2-1.2,1.4v0.1c0.6,0.2,0.9,0.7,1.1,1.5
|
||||||
|
c0.2,0.9,0.3,1.3,0.4,1.5h-1.5c-0.2-0.2-0.3-0.8-0.5-1.5c-0.1-0.7-0.5-1-1.2-1h-0.7V11.1z M282.9,7.7h0.7c0.8,0,1.4-0.3,1.4-0.9
|
||||||
|
c0-0.5-0.4-0.9-1.3-0.9c-0.4,0-0.6,0-0.8,0.1V7.7z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.5 KiB |
|
@ -0,0 +1,58 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 23.0.6, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
width="230px" height="42px" viewBox="0 0 230 42" style="enable-background:new 0 0 230 42;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#FFFFFF;}
|
||||||
|
</style>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M2.8,41.2V0.1h5v23.4l11.9-12.1h6.5L15,22.5l12.5,18.7h-6.2L11.4,26l-3.6,3.4v11.8H2.8z"/>
|
||||||
|
<path class="st0" d="M63.5,41.2V11.4H68v4.2c2.2-3.3,5.3-4.9,9.5-4.9c1.8,0,3.4,0.3,5,1c1.5,0.6,2.6,1.5,3.4,2.5
|
||||||
|
c0.7,1,1.3,2.3,1.6,3.7c0.2,0.9,0.3,2.6,0.3,4.9v18.3h-5V23.1c0-2.1-0.2-3.6-0.6-4.6c-0.4-1-1.1-1.8-2.1-2.4
|
||||||
|
c-1-0.6-2.2-0.9-3.5-0.9c-2.2,0-4,0.7-5.6,2c-1.6,1.4-2.3,4-2.3,7.8v16.3H63.5z"/>
|
||||||
|
<path class="st0" d="M115.8,31.6l5.2,0.6c-0.8,3-2.3,5.4-4.6,7.1c-2.2,1.7-5.1,2.5-8.5,2.5c-4.4,0-7.8-1.3-10.4-4
|
||||||
|
c-2.6-2.7-3.8-6.4-3.8-11.3c0-5,1.3-8.9,3.9-11.7c2.6-2.8,5.9-4.2,10-4.2c4,0,7.2,1.4,9.8,4.1c2.5,2.7,3.8,6.5,3.8,11.4
|
||||||
|
c0,0.3,0,0.7,0,1.3H99c0.2,3.3,1.1,5.8,2.8,7.5c1.7,1.7,3.7,2.6,6.2,2.6c1.9,0,3.4-0.5,4.7-1.5C114,35.3,115.1,33.8,115.8,31.6z
|
||||||
|
M99.2,23.5h16.6c-0.2-2.5-0.9-4.4-1.9-5.6c-1.6-1.9-3.7-2.9-6.3-2.9c-2.3,0-4.3,0.8-5.8,2.3C100.3,18.8,99.4,20.9,99.2,23.5z"
|
||||||
|
/>
|
||||||
|
<path class="st0" d="M146.8,30.3l5,0.6c-0.5,3.4-1.9,6.1-4.2,8c-2.2,1.9-5,2.9-8.2,2.9c-4.1,0-7.4-1.3-9.8-4
|
||||||
|
c-2.5-2.7-3.7-6.5-3.7-11.5c0-3.2,0.5-6,1.6-8.4s2.7-4.2,4.9-5.4c2.2-1.2,4.5-1.8,7.1-1.8c3.2,0,5.9,0.8,7.9,2.5
|
||||||
|
c2.1,1.6,3.4,4,4,7l-4.9,0.8c-0.5-2-1.3-3.5-2.5-4.5c-1.2-1-2.6-1.5-4.3-1.5c-2.5,0-4.6,0.9-6.2,2.7c-1.6,1.8-2.4,4.7-2.4,8.7
|
||||||
|
c0,4,0.8,6.9,2.3,8.7c1.5,1.8,3.5,2.7,6,2.7c2,0,3.6-0.6,5-1.8C145.6,34.7,146.5,32.8,146.8,30.3z"/>
|
||||||
|
<path class="st0" d="M167.1,36.7l0.7,4.5c-1.4,0.3-2.7,0.4-3.8,0.4c-1.8,0-3.3-0.3-4.3-0.9c-1-0.6-1.7-1.3-2.1-2.3
|
||||||
|
c-0.4-0.9-0.6-2.9-0.6-6V15.4h-3.7v-3.9h3.7V4.1l5-3v10.4h5.1v3.9H162v17.4c0,1.4,0.1,2.4,0.3,2.8c0.2,0.4,0.5,0.7,0.9,1
|
||||||
|
c0.4,0.2,1,0.4,1.7,0.4C165.5,36.9,166.2,36.8,167.1,36.7z"/>
|
||||||
|
<path class="st0" d="M191.5,37.5c-1.9,1.6-3.7,2.7-5.4,3.4c-1.7,0.7-3.6,1-5.6,1c-3.3,0-5.8-0.8-7.5-2.4
|
||||||
|
c-1.8-1.6-2.6-3.6-2.6-6.1c0-1.5,0.3-2.8,1-4c0.7-1.2,1.5-2.2,2.6-2.9c1.1-0.7,2.3-1.3,3.6-1.7c1-0.3,2.5-0.5,4.5-0.8
|
||||||
|
c4.1-0.5,7.1-1.1,9-1.7c0-0.7,0-1.1,0-1.3c0-2.1-0.5-3.5-1.4-4.3c-1.3-1.1-3.2-1.7-5.8-1.7c-2.4,0-4.1,0.4-5.3,1.2
|
||||||
|
c-1.1,0.8-2,2.3-2.5,4.4l-4.9-0.7c0.4-2.1,1.2-3.8,2.2-5.1c1-1.3,2.5-2.3,4.5-3c1.9-0.7,4.2-1.1,6.8-1.1c2.5,0,4.6,0.3,6.2,0.9
|
||||||
|
c1.6,0.6,2.8,1.4,3.5,2.3c0.7,0.9,1.3,2.1,1.6,3.4c0.2,0.9,0.3,2.4,0.3,4.7v6.7c0,4.7,0.1,7.7,0.3,8.9c0.2,1.2,0.6,2.4,1.3,3.6
|
||||||
|
h-5.3C192,40.2,191.6,39,191.5,37.5z M191.1,26.3c-1.8,0.7-4.6,1.4-8.2,1.9c-2.1,0.3-3.5,0.6-4.4,1c-0.9,0.4-1.5,0.9-2,1.6
|
||||||
|
c-0.5,0.7-0.7,1.5-0.7,2.4c0,1.3,0.5,2.5,1.5,3.4c1,0.9,2.5,1.3,4.5,1.3c1.9,0,3.7-0.4,5.2-1.3c1.5-0.9,2.6-2,3.3-3.5
|
||||||
|
c0.5-1.1,0.8-2.8,0.8-5V26.3z"/>
|
||||||
|
<path class="st0" d="M204,41.2V11.4h4.5V16c1.2-2.1,2.2-3.5,3.2-4.2c1-0.7,2.1-1,3.2-1c1.7,0,3.4,0.5,5.2,1.6l-1.7,4.7
|
||||||
|
c-1.2-0.7-2.5-1.1-3.7-1.1c-1.1,0-2.1,0.3-3,1c-0.9,0.7-1.5,1.6-1.9,2.8c-0.6,1.8-0.8,3.8-0.8,5.9v15.6H204z"/>
|
||||||
|
<g>
|
||||||
|
<circle class="st0" cx="43.6" cy="38.4" r="2.8"/>
|
||||||
|
<circle class="st0" cx="43.6" cy="13.6" r="2.8"/>
|
||||||
|
<path class="st0" d="M40.8,35.3c-4-1.2-6.9-4.9-6.9-9.3c0-4.4,2.9-8.1,6.9-9.3c-0.8-0.8-1.4-1.9-1.4-3.1c0-0.8,0.2-1.5,0.6-2.1
|
||||||
|
c0,0,0,0,0,0C33.5,13.1,28.6,19,28.6,26c0,7,4.9,12.9,11.4,14.5c0,0,0,0,0,0c-0.4-0.6-0.6-1.4-0.6-2.1
|
||||||
|
C39.4,37.1,39.9,36,40.8,35.3z"/>
|
||||||
|
<path class="st0" d="M47.2,11.4c0.4,0.6,0.6,1.4,0.6,2.2c0,1.2-0.5,2.3-1.4,3.1c4,1.2,6.9,4.9,6.9,9.3c0,4.4-2.9,8.1-6.9,9.3
|
||||||
|
c0.8,0.8,1.4,1.9,1.4,3.1c0,0.8-0.2,1.5-0.6,2.2C53.7,38.9,58.6,33,58.6,26C58.6,19,53.7,13,47.2,11.4z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path class="st0" d="M227.2,6c0,2.1-1.7,3.8-3.8,3.8c-2.1,0-3.8-1.7-3.8-3.8c0-2.1,1.7-3.7,3.8-3.7C225.5,2.3,227.2,4,227.2,6z
|
||||||
|
M220.5,6c0,1.7,1.2,3,2.9,3c1.6,0,2.8-1.3,2.8-2.9c0-1.7-1.2-3-2.9-3C221.7,3.1,220.5,4.4,220.5,6z M222.8,8h-0.9V4.3
|
||||||
|
c0.3-0.1,0.8-0.1,1.4-0.1c0.7,0,1,0.1,1.3,0.3c0.2,0.2,0.4,0.5,0.4,0.8c0,0.4-0.3,0.7-0.8,0.9v0c0.4,0.1,0.6,0.4,0.7,0.9
|
||||||
|
c0.1,0.6,0.2,0.8,0.3,0.9h-0.9c-0.1-0.1-0.2-0.5-0.3-0.9c-0.1-0.4-0.3-0.6-0.8-0.6h-0.4V8z M222.8,5.9h0.4c0.5,0,0.9-0.2,0.9-0.5
|
||||||
|
c0-0.3-0.2-0.6-0.8-0.6c-0.2,0-0.4,0-0.5,0V5.9z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 4.4 KiB |
|
@ -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
|
|
@ -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>12.0</string>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1 @@
|
||||||
|
#include "Generated.xcconfig"
|
|
@ -0,0 +1 @@
|
||||||
|
#include "Generated.xcconfig"
|
|
@ -0,0 +1,616 @@
|
||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 54;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
|
||||||
|
331C808B294A63AB00263BE5 /* RunnerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 331C807B294A618700263BE5 /* RunnerTests.swift */; };
|
||||||
|
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 */; };
|
||||||
|
/* 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>"; };
|
||||||
|
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; };
|
||||||
|
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>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
97C146EB1CF9000F007C117D /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
331C8082294A63A400263BE5 /* RunnerTests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
331C807B294A618700263BE5 /* RunnerTests.swift */,
|
||||||
|
);
|
||||||
|
path = RunnerTests;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
9740EEB11CF90186004384FC /* Flutter */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
|
||||||
|
9740EEB21CF90195004384FC /* Debug.xcconfig */,
|
||||||
|
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
|
||||||
|
9740EEB31CF90195004384FC /* Generated.xcconfig */,
|
||||||
|
);
|
||||||
|
name = Flutter;
|
||||||
|
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 */,
|
||||||
|
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 = 1510;
|
||||||
|
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;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
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;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
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 = 12.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.discoverModule;
|
||||||
|
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;
|
||||||
|
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.discoverModule.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;
|
||||||
|
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.discoverModule.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;
|
||||||
|
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.discoverModule.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;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
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;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
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 = 12.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;
|
||||||
|
ASSETCATALOG_COMPILER_GENERATE_SWIFT_ASSET_SYMBOL_EXTENSIONS = YES;
|
||||||
|
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;
|
||||||
|
ENABLE_USER_SCRIPT_SANDBOXING = NO;
|
||||||
|
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 = 12.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.discoverModule;
|
||||||
|
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.discoverModule;
|
||||||
|
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 */;
|
||||||
|
}
|
|
@ -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>
|
|
@ -0,0 +1,98 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "1510"
|
||||||
|
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>
|
|
@ -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>
|
|
@ -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)
|
||||||
|
}
|
||||||
|
}
|
|
@ -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 |
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 68 B |
After Width: | Height: | Size: 68 B |
|
@ -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.
|
|
@ -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>
|
|
@ -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>
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?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>Discover Module</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>discover_module</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>CADisableMinimumFrameDurationOnPhone</key>
|
||||||
|
<true/>
|
||||||
|
<key>UIApplicationSupportsIndirectInputEvents</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
|
@ -0,0 +1 @@
|
||||||
|
#import "GeneratedPluginRegistrant.h"
|
|
@ -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.
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class ElevationBtn extends StatefulWidget {
|
||||||
|
ElevationBtn(
|
||||||
|
{this.text, this.color, required this.onPressed, this.textcolor});
|
||||||
|
String? text;
|
||||||
|
Color? color;
|
||||||
|
final VoidCallback onPressed;
|
||||||
|
Color? textcolor;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ElevationBtn> createState() => _ElevationBtnState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ElevationBtnState extends State<ElevationBtn> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ElevatedButton(
|
||||||
|
onPressed: widget.onPressed,
|
||||||
|
style: ElevatedButton.styleFrom(
|
||||||
|
backgroundColor: widget.color?.withOpacity(0.9),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
widget.text!,
|
||||||
|
style: TextStyle(color: widget.textcolor),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class FloatingBtn extends StatefulWidget {
|
||||||
|
FloatingBtn({
|
||||||
|
this.height,
|
||||||
|
this.width,
|
||||||
|
required this.title,
|
||||||
|
this.onTap,
|
||||||
|
required this.icon,
|
||||||
|
});
|
||||||
|
|
||||||
|
double? height;
|
||||||
|
double? width;
|
||||||
|
String title;
|
||||||
|
VoidCallback? onTap;
|
||||||
|
IconData? icon;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<FloatingBtn> createState() => _FloatingBtnState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FloatingBtnState extends State<FloatingBtn> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return FloatingActionButton(
|
||||||
|
onPressed: widget.onTap,
|
||||||
|
child: Icon(Icons.add),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
import 'package:discover_module/custom_widget/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Alert extends StatefulWidget {
|
||||||
|
const Alert({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Alert> createState() => _AlertState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AlertState extends State<Alert> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text1(
|
||||||
|
title: "Alert",
|
||||||
|
txtfont: 22.0,
|
||||||
|
),
|
||||||
|
content: Text1(
|
||||||
|
title: "User Added Successfully",
|
||||||
|
txtfont: 18.0,
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Text("Cancel"))
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class Text1 extends StatefulWidget {
|
||||||
|
Text1({
|
||||||
|
super.key,
|
||||||
|
required this.title,
|
||||||
|
this.txtcolor,
|
||||||
|
this.txtfont,
|
||||||
|
this.fontweight,
|
||||||
|
});
|
||||||
|
final String title;
|
||||||
|
Color? txtcolor;
|
||||||
|
double? txtfont;
|
||||||
|
FontWeight? fontweight;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Text1> createState() => _Text1State();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Text1State extends State<Text1> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Text(
|
||||||
|
widget.title,
|
||||||
|
style: TextStyle(
|
||||||
|
color: widget.txtcolor,
|
||||||
|
fontSize: widget.txtfont,
|
||||||
|
fontWeight: widget.fontweight),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class TxtField extends StatefulWidget {
|
||||||
|
TxtField(
|
||||||
|
{super.key,
|
||||||
|
required this.text,
|
||||||
|
this.voidCallback,
|
||||||
|
this.contentPadding,
|
||||||
|
this.icon,
|
||||||
|
this.border,
|
||||||
|
this.decoration});
|
||||||
|
|
||||||
|
final String? text;
|
||||||
|
final VoidCallback? voidCallback;
|
||||||
|
final Padding? contentPadding;
|
||||||
|
Icon? icon;
|
||||||
|
Border? border;
|
||||||
|
Decoration? decoration;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<TxtField> createState() => _TxtFieldState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _TxtFieldState extends State<TxtField> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return TextField();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,172 @@
|
||||||
|
import 'package:discover_module/ui_screen/contacts.dart';
|
||||||
|
import 'package:discover_module/ui_screen/discover.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart';
|
||||||
|
import 'package:discover_module/ui_screen/listview.dart';
|
||||||
|
import 'package:discover_module/ui_screen/filters_menu.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
Future<void> main() async {
|
||||||
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
// SystemChrome.setPreferredOrientations([
|
||||||
|
// DeviceOrientation.portraitUp,
|
||||||
|
// ]);
|
||||||
|
|
||||||
|
// WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
// SystemChrome.setPreferredOrientations([
|
||||||
|
// DeviceOrientation.landscapeLeft,
|
||||||
|
// ]);
|
||||||
|
await Hive.initFlutter();
|
||||||
|
|
||||||
|
Hive.registerAdapter(SaveInteractionAdapter());
|
||||||
|
Hive.registerAdapter(InteractionConfigDataAdapter());
|
||||||
|
|
||||||
|
Hive.registerAdapter(InteractionResultDataAdapter());
|
||||||
|
Hive.registerAdapter(FormFieldDataAdapter());
|
||||||
|
Hive.registerAdapter(ValidationAdapter());
|
||||||
|
Hive.registerAdapter(SectionListAdapter());
|
||||||
|
Hive.registerAdapter(InputClassAdapter());
|
||||||
|
Hive.registerAdapter(InteractionWidgetAdapter());
|
||||||
|
|
||||||
|
// Hive.registerAdapter(UserDataAdapter());
|
||||||
|
Hive.registerAdapter(SendSaveJsonAdapter());
|
||||||
|
Hive.registerAdapter(MultipleSectionListAdapter());
|
||||||
|
Hive.registerAdapter(SaveAdapter());
|
||||||
|
Hive.registerAdapter(SaveInteractionFormJsonAdapter());
|
||||||
|
await Hive.openBox<SaveInteraction>('InteractionDataBox');
|
||||||
|
|
||||||
|
await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox');
|
||||||
|
|
||||||
|
var box = await Hive.openBox('mycontact');
|
||||||
|
var box1 = await Hive.openBox('myfilter');
|
||||||
|
|
||||||
|
runApp(MultiProvider(
|
||||||
|
providers: [
|
||||||
|
ChangeNotifierProvider(create: (_) => InteractionProvider()),
|
||||||
|
ChangeNotifierProvider(create: (_) => ViewInteractionProvider()),
|
||||||
|
//ChangeNotifierProvider(create: (_) => ConfigDataProvider()),
|
||||||
|
ChangeNotifierProvider<HiveDataRepository>(
|
||||||
|
create: (_) => HiveDataRepository(
|
||||||
|
Hive.box<InteractionConfigData>('InteractionConfigDataBox'))),
|
||||||
|
],
|
||||||
|
child: MyApp(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyApp extends StatefulWidget {
|
||||||
|
const MyApp({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MyApp> createState() => _MyAppState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyAppState extends State<MyApp> {
|
||||||
|
// This widget is the root of your application.
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return MaterialApp(
|
||||||
|
debugShowCheckedModeBanner: false,
|
||||||
|
title: 'Flutter Demo',
|
||||||
|
theme: ThemeData(
|
||||||
|
appBarTheme: const AppBarTheme(
|
||||||
|
backgroundColor: Color.fromARGB(255, 0, 71, 132),
|
||||||
|
foregroundColor: Colors.white //here you can give the text color
|
||||||
|
)),
|
||||||
|
home: const MyHomePage(title: 'Flutter Demo Home Page'),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class MyHomePage extends StatefulWidget {
|
||||||
|
const MyHomePage({super.key, required this.title});
|
||||||
|
|
||||||
|
// This widget is the home page of your application. It is stateful, meaning
|
||||||
|
// that it has a State object (defined below) that contains fields that affect
|
||||||
|
// how it looks.
|
||||||
|
|
||||||
|
// This class is the configuration for the state. It holds the values (in this
|
||||||
|
// case the title) provided by the parent (in this case the App widget) and
|
||||||
|
// used by the build method of the State. Fields in a Widget subclass are
|
||||||
|
// always marked "final".
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<MyHomePage> createState() => _MyHomePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _MyHomePageState extends State<MyHomePage> {
|
||||||
|
final String outerTabValue = 'value1';
|
||||||
|
|
||||||
|
late bool menuview = true;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// This method is rerun every time setState is called, for instance as done
|
||||||
|
// by the _incrementCounter method above.
|
||||||
|
//
|
||||||
|
// The Flutter framework has been optimized to make rerunning build methods
|
||||||
|
// fast, so that you can just rebuild anything that needs updating rather
|
||||||
|
// than having to individually change instances of widgets.
|
||||||
|
initState() {
|
||||||
|
menuview = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
body: DefaultTabController(
|
||||||
|
length: 3,
|
||||||
|
child: Scaffold(
|
||||||
|
drawerEnableOpenDragGesture: false, // Prevent user sliding open
|
||||||
|
|
||||||
|
appBar: AppBar(
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
title: SvgPicture.asset(
|
||||||
|
'assets/konectar_white_logo.svg',
|
||||||
|
width: 100.0,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
bottom: const TabBar(
|
||||||
|
indicatorColor: Colors.white,
|
||||||
|
labelColor: Colors.white,
|
||||||
|
unselectedLabelColor: Colors.grey,
|
||||||
|
tabs: [
|
||||||
|
Tab(
|
||||||
|
text: 'Contacts',
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: 'Discover',
|
||||||
|
),
|
||||||
|
Tab(
|
||||||
|
text: 'HCP Report',
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// endDrawer: MyWidget1(),
|
||||||
|
endDrawer: Drawer(
|
||||||
|
width: MediaQuery.of(context).size.width * 99.2,
|
||||||
|
child: Filters(),
|
||||||
|
),
|
||||||
|
|
||||||
|
body: TabBarView(
|
||||||
|
children: [
|
||||||
|
Center(child: Contacts()),
|
||||||
|
Center(child: Discover(outerTabValue)),
|
||||||
|
Center(child: DataTableDemo()),
|
||||||
|
],
|
||||||
|
// This trailing comma makes auto-formatting nicer for build methods.
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class AddEventScreen extends StatefulWidget {
|
||||||
|
const AddEventScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<AddEventScreen> createState() => _AddEventScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddEventScreenState extends State<AddEventScreen> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: const Text("Event Form"),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,199 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Addhcp extends StatefulWidget {
|
||||||
|
const Addhcp({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Addhcp> createState() => _AddhcpState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _AddhcpState extends State<Addhcp> {
|
||||||
|
late _DataSource _dataSource; // Instance variable for _DataSource
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
print("hii_initState");
|
||||||
|
_dataSource = _DataSource(context); // Initialize _DataSource
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
body: ListView(
|
||||||
|
padding: const EdgeInsets.all(3),
|
||||||
|
children: [
|
||||||
|
PaginatedDataTable(
|
||||||
|
header: const Text(
|
||||||
|
'HCP RANKING',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 18.0,
|
||||||
|
fontStyle: FontStyle.normal),
|
||||||
|
),
|
||||||
|
showFirstLastButtons: true,
|
||||||
|
showEmptyRows: false,
|
||||||
|
showCheckboxColumn: true,
|
||||||
|
rowsPerPage: 5,
|
||||||
|
columns: const [
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Name',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Tier',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Rank',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Score',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Event',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Affliations',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Publications',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
DataColumn(
|
||||||
|
label: Text('Trails',
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontStyle: FontStyle.normal))),
|
||||||
|
],
|
||||||
|
source: _dataSource,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
floatingActionButton: Visibility(
|
||||||
|
visible: true,
|
||||||
|
child: FloatingActionButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: Icon(Icons.add),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Row {
|
||||||
|
_Row(this.identifier, this.valueA, this.valueC, this.valueD, this.valueE,
|
||||||
|
this.valueF, this.valueG, this.valueH, this.valueI);
|
||||||
|
|
||||||
|
final int identifier;
|
||||||
|
final String valueA;
|
||||||
|
final String valueC;
|
||||||
|
final String valueD;
|
||||||
|
final String valueE;
|
||||||
|
final String valueF;
|
||||||
|
final String valueG;
|
||||||
|
final String valueH;
|
||||||
|
final String valueI;
|
||||||
|
|
||||||
|
bool selected = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DataSource extends DataTableSource {
|
||||||
|
final BuildContext context;
|
||||||
|
late List<_Row> _rows;
|
||||||
|
// late List<int> _selectedRowsIndexes = []; // List to track selected rows
|
||||||
|
final List<String> _selectedRowIds = [];
|
||||||
|
|
||||||
|
_DataSource(this.context) {
|
||||||
|
_rows = <_Row>[
|
||||||
|
for (int i = 0; i < 20; i++)
|
||||||
|
_Row(i, 'pooja', 'Tier1', '1', '0', '0', '0', '0', '0'),
|
||||||
|
];
|
||||||
|
//}
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> getSelectedRowIds() {
|
||||||
|
return _selectedRowIds; // Return a copy to prevent direct modification
|
||||||
|
}
|
||||||
|
|
||||||
|
int _selectedCount = 0;
|
||||||
|
|
||||||
|
@override
|
||||||
|
DataRow? getRow(int index) {
|
||||||
|
assert(index >= 0);
|
||||||
|
if (index >= _rows.length) return null;
|
||||||
|
final row = _rows[index];
|
||||||
|
return DataRow.byIndex(
|
||||||
|
index: index,
|
||||||
|
selected: row.selected,
|
||||||
|
onSelectChanged: (value) {
|
||||||
|
if (row.selected != value) {
|
||||||
|
// _selectedCount += value! ? 1 : -1;
|
||||||
|
// assert(_selectedCount >= 0);
|
||||||
|
row.selected = value!;
|
||||||
|
|
||||||
|
if (value) {
|
||||||
|
print("Selected");
|
||||||
|
_selectedRowIds.add(row.valueA); // Add the row ID to the list
|
||||||
|
print("Selected_selectedRowIds :$_selectedRowIds");
|
||||||
|
} else {
|
||||||
|
_selectedRowIds
|
||||||
|
.remove(row.valueA); // Remove the row ID from the list
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
|
||||||
|
print("Selectedddd_is $value");
|
||||||
|
print("Selectedddd_value ${row.valueA}");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
cells: [
|
||||||
|
DataCell(
|
||||||
|
Text(row.valueA),
|
||||||
|
onTap: () {
|
||||||
|
print("hiii Data cell tap ${row.valueA}");
|
||||||
|
|
||||||
|
// Navigator.push(
|
||||||
|
// context, MaterialPageRoute(builder: (context) => Profile()));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
DataCell(Text(row.valueC)),
|
||||||
|
DataCell(Text(row.valueD.toString())),
|
||||||
|
DataCell(Text(row.valueE)),
|
||||||
|
DataCell(Text(row.valueF)),
|
||||||
|
DataCell(Text(row.valueG)),
|
||||||
|
DataCell(Text(row.valueH)),
|
||||||
|
DataCell(Text(row.valueI)),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get rowCount => _rows.length;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool get isRowCountApproximate => false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get selectedRowCount => _selectedCount;
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
// import 'package:pwa_ios/model/interaction_data.dart';
|
||||||
|
|
||||||
|
part 'event_model.g.dart';
|
||||||
|
|
||||||
|
class UIDataEventResponse {
|
||||||
|
bool success;
|
||||||
|
String message;
|
||||||
|
|
||||||
|
List<FormFieldData> formFields;
|
||||||
|
|
||||||
|
UIDataEventResponse({
|
||||||
|
required this.success,
|
||||||
|
required this.message,
|
||||||
|
required this.formFields,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory UIDataEventResponse.fromJson(Map<String, dynamic> json) =>
|
||||||
|
UIDataEventResponse(
|
||||||
|
success: json["success"],
|
||||||
|
message: json["message"],
|
||||||
|
formFields: List<FormFieldData>.from(
|
||||||
|
json["data"].map((x) => FormFieldData.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"success": success,
|
||||||
|
"message": message,
|
||||||
|
"form-fields": List<dynamic>.from(formFields.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
// TODO: implement toString
|
||||||
|
return List<dynamic>.from(formFields.map((x) => x.toJson())).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 20)
|
||||||
|
class EventConfigData {
|
||||||
|
@HiveField(1)
|
||||||
|
InteractionResultData widgets;
|
||||||
|
@HiveField(2)
|
||||||
|
String id;
|
||||||
|
@HiveField(3)
|
||||||
|
String name;
|
||||||
|
|
||||||
|
EventConfigData({
|
||||||
|
required this.widgets,
|
||||||
|
required this.id,
|
||||||
|
required this.name,
|
||||||
|
});
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {"widgets": widgets};
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'event_model.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class EventConfigDataAdapter extends TypeAdapter<EventConfigData> {
|
||||||
|
@override
|
||||||
|
final int typeId = 20;
|
||||||
|
|
||||||
|
@override
|
||||||
|
EventConfigData read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return EventConfigData(
|
||||||
|
widgets: fields[1] as InteractionResultData,
|
||||||
|
id: fields[2] as String,
|
||||||
|
name: fields[3] as String,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, EventConfigData obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(3)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.widgets)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is EventConfigDataAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
|
@ -0,0 +1,251 @@
|
||||||
|
// import 'package:flutter/material.dart';
|
||||||
|
// import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
|
||||||
|
// class Chart extends StatefulWidget {
|
||||||
|
// const Chart({super.key});
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// State<Chart> createState() => _ChartState();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// class _ChartState extends State<Chart> {
|
||||||
|
// @override
|
||||||
|
// Widget build(BuildContext context) {
|
||||||
|
// return Center(
|
||||||
|
// child: Container(
|
||||||
|
// height: 200,
|
||||||
|
// child: _buildChart(),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Widget _buildChart() {
|
||||||
|
// final data = [
|
||||||
|
// LinearSales("Jan", [50, 100]),
|
||||||
|
// LinearSales("Feb", [75, 25]),
|
||||||
|
// LinearSales("Mar", [50, 0]),
|
||||||
|
// LinearSales("Apr", [25, 85]),
|
||||||
|
// LinearSales("May", [10, 20]),
|
||||||
|
// ];
|
||||||
|
// final chart = charts.BarChart(
|
||||||
|
// [
|
||||||
|
// charts.Series<LinearSales, String>(
|
||||||
|
// id: 'Sales',
|
||||||
|
// colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
|
||||||
|
// domainFn: (LinearSales sales, _) => sales.month,
|
||||||
|
// // measureFn: (LinearSales sales, _) => sales.sales,
|
||||||
|
// measureFn: (LinearSales sales, _) =>
|
||||||
|
// sales.sales.reduce((value, element) => value + element),
|
||||||
|
|
||||||
|
// // measureFn: (LinearSales sales, _) {
|
||||||
|
// // sales.month;
|
||||||
|
// // sales.affliations;
|
||||||
|
// // },
|
||||||
|
// data: data,
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// animate: true,
|
||||||
|
// );
|
||||||
|
// return chart;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// class LinearSales {
|
||||||
|
// final String month;
|
||||||
|
// final List<int> sales; // List of values for the y-axis
|
||||||
|
|
||||||
|
// // final int sales;
|
||||||
|
// // final int affliations;
|
||||||
|
// // LinearSales(this.month, this.sales, this.affliations);
|
||||||
|
// LinearSales(this.month, this.sales);
|
||||||
|
// }
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:charts_flutter/flutter.dart' as charts;
|
||||||
|
|
||||||
|
class Chart extends StatefulWidget {
|
||||||
|
const Chart({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Chart> createState() => _ChartState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ChartState extends State<Chart> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Center(
|
||||||
|
child: Container(
|
||||||
|
height: 200,
|
||||||
|
child: _buildChart(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildChart() {
|
||||||
|
final data = [
|
||||||
|
LinearSales("Jan12weas", [50, 100]),
|
||||||
|
LinearSales("Febghfctgfc", [75, 35]),
|
||||||
|
LinearSales("Mardfdxfdx", [50, 20]),
|
||||||
|
LinearSales("Apr", [25, 85]),
|
||||||
|
LinearSales("May", [10, 50]),
|
||||||
|
LinearSales("May1", [10, 50]),
|
||||||
|
];
|
||||||
|
|
||||||
|
final chart = charts.BarChart(
|
||||||
|
[
|
||||||
|
charts.Series<LinearSales, String>(
|
||||||
|
id: 'Sales',
|
||||||
|
colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
|
||||||
|
domainFn: (LinearSales sales, _) => sales.month,
|
||||||
|
measureFn: (LinearSales sales, _) =>
|
||||||
|
sales.sales.reduce((value, element) => value + element),
|
||||||
|
data: data,
|
||||||
|
fillColorFn: (LinearSales sales, _) {
|
||||||
|
print("Salesss");
|
||||||
|
print(sales.sales.length);
|
||||||
|
if (sales.sales.length == 2) {
|
||||||
|
print("hii");
|
||||||
|
|
||||||
|
print(sales.sales.indexOf(
|
||||||
|
sales.sales.reduce((value, element) => value + element)) ==
|
||||||
|
1);
|
||||||
|
print(sales.sales.indexOf(
|
||||||
|
sales.sales.reduce((value, element) => value + element)));
|
||||||
|
//print(sales.sales.indexOf(2));
|
||||||
|
|
||||||
|
// final maxIndex = sales.sales.indexOf(sales.sales
|
||||||
|
// .reduce((value, element) => value > element ? value : element));
|
||||||
|
// return sales.sales[0] == 50
|
||||||
|
// ? charts.MaterialPalette.red.shadeDefault.lighter
|
||||||
|
// : charts.MaterialPalette.green.shadeDefault.lighter;
|
||||||
|
|
||||||
|
final totalSales =
|
||||||
|
sales.sales.reduce((value, element) => value + element);
|
||||||
|
|
||||||
|
print("totalSales $totalSales");
|
||||||
|
print(sales.sales[0]);
|
||||||
|
|
||||||
|
int index = data.indexOf(sales);
|
||||||
|
print("totalSales $index");
|
||||||
|
|
||||||
|
return totalSales == sales.sales[0]
|
||||||
|
? charts.MaterialPalette.red.shadeDefault
|
||||||
|
: charts.MaterialPalette.green.shadeDefault;
|
||||||
|
} else {
|
||||||
|
// If there are more than two values, assign color based on the total sales
|
||||||
|
final totalSales =
|
||||||
|
sales.sales.reduce((value, element) => value + element);
|
||||||
|
return totalSales == sales.sales[0]
|
||||||
|
? charts.MaterialPalette.red.shadeDefault.lighter
|
||||||
|
: charts.MaterialPalette.green.shadeDefault.lighter;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
animate: true,
|
||||||
|
);
|
||||||
|
|
||||||
|
return SizedBox(
|
||||||
|
height: 300, // Adjust the height as needed
|
||||||
|
child: chart,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
class LinearSales {
|
||||||
|
final String month;
|
||||||
|
final List<int> sales;
|
||||||
|
|
||||||
|
LinearSales(this.month, this.sales);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Widget _buildChart() {
|
||||||
|
// final data = [
|
||||||
|
// LinearSales("Jan", [50, 100]),
|
||||||
|
// LinearSales("Feb", [75, 35]),
|
||||||
|
// LinearSales("Mar", [50, 20]),
|
||||||
|
// LinearSales("Apr", [25, 85]),
|
||||||
|
// LinearSales("May", [10, 50]),
|
||||||
|
// ];
|
||||||
|
|
||||||
|
// final chart = charts.BarChart(
|
||||||
|
// [
|
||||||
|
// charts.Series<LinearSales, String>(
|
||||||
|
// id: 'Sales',
|
||||||
|
// colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
|
||||||
|
// domainFn: (LinearSales sales, _) => sales.month,
|
||||||
|
// measureFn: (LinearSales sales, _) =>
|
||||||
|
// sales.sales.reduce((value, element) => value + element),
|
||||||
|
// data: data,
|
||||||
|
// fillColorFn: (LinearSales sales, _) {
|
||||||
|
// final totalSales =
|
||||||
|
// sales.sales.reduce((value, element) => value + element);
|
||||||
|
// print("Salessss: ");
|
||||||
|
// print(sales.sales[0]);
|
||||||
|
// if (sales.sales.length > 1) {
|
||||||
|
// return totalSales == sales.sales[0]
|
||||||
|
// ? charts.MaterialPalette.red.shadeDefault.lighter
|
||||||
|
// : charts.MaterialPalette.red.shadeDefault.lighter;
|
||||||
|
// } else {
|
||||||
|
// return totalSales == sales.sales[0]
|
||||||
|
// ? charts.MaterialPalette.red.shadeDefault.lighter
|
||||||
|
// : charts.MaterialPalette.green.shadeDefault.lighter;
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// animate: true,
|
||||||
|
// );
|
||||||
|
|
||||||
|
// return SizedBox(
|
||||||
|
// height: 300, // Adjust the height as needed
|
||||||
|
// child: chart,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// class LinearSales {
|
||||||
|
// final String month;
|
||||||
|
// final List<int> sales;
|
||||||
|
|
||||||
|
// LinearSales(this.month, this.sales);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Widget _buildChart() {
|
||||||
|
// final data = [
|
||||||
|
// LinearSales("Jan", [50, 100]),
|
||||||
|
// LinearSales("Feb", [75, 35]),
|
||||||
|
// LinearSales("Mar", [50, 20]),
|
||||||
|
// LinearSales("Apr", [25, 85]),
|
||||||
|
// LinearSales("May", [10, 50]),
|
||||||
|
// ];
|
||||||
|
// final chart = charts.BarChart(
|
||||||
|
// [
|
||||||
|
// charts.Series<LinearSales, String>(
|
||||||
|
// id: 'Sales',
|
||||||
|
// colorFn: (_, __) => charts.MaterialPalette.blue.shadeDefault,
|
||||||
|
// domainFn: (LinearSales sales, _) => sales.month,
|
||||||
|
// // measureFn: (LinearSales sales, _) => sales.sales,
|
||||||
|
// measureFn: (LinearSales sales, _) =>
|
||||||
|
// sales.sales.reduce((value, element) => value + element),
|
||||||
|
|
||||||
|
// // measureFn: (LinearSales sales, _) {
|
||||||
|
// // sales.month;
|
||||||
|
// // sales.affliations;
|
||||||
|
// // },
|
||||||
|
// data: data,
|
||||||
|
// ),
|
||||||
|
// ],
|
||||||
|
// animate: true,
|
||||||
|
// );
|
||||||
|
// return chart;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// class LinearSales {
|
||||||
|
// final String month;
|
||||||
|
// final List<int> sales; // List of values for the y-axis
|
||||||
|
|
||||||
|
// // final int sales;
|
||||||
|
// // final int affliations;
|
||||||
|
// // LinearSales(this.month, this.sales, this.affliations);
|
||||||
|
// LinearSales(this.month, this.sales);
|
||||||
|
// }
|
|
@ -0,0 +1,147 @@
|
||||||
|
import 'package:discover_module/ui_screen/profile.dart';
|
||||||
|
import 'package:discover_module/ui_screen/ranking.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_profile_picture/flutter_profile_picture.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
class Contacts extends StatefulWidget {
|
||||||
|
const Contacts({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Contacts> createState() => _ContactsState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ContactsState extends State<Contacts> {
|
||||||
|
// final _contactbox = Hive.box('mycontact');
|
||||||
|
static final _contactbox = Hive.box("mycontact");
|
||||||
|
|
||||||
|
bool _switchValue = false;
|
||||||
|
|
||||||
|
// List<dynamic> alldata = _contactbox.values.toList();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
print(
|
||||||
|
"newdata_is: ${_contactbox.values.toList()},${_contactbox.values.toList().length}");
|
||||||
|
|
||||||
|
print(
|
||||||
|
"Data_newww: ${HiveFunctions.getAllUsers()} ,${HiveFunctions.getAllUsers().length} ");
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
// appBar: AppBar(
|
||||||
|
// title: const Text('Contacts'),
|
||||||
|
// ),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment
|
||||||
|
.center, // Align children to start and end of the row
|
||||||
|
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 45.0),
|
||||||
|
child: Text(
|
||||||
|
_switchValue ? "My Contacts" : "All Contacts",
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 20.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
fontStyle: FontStyle.normal,
|
||||||
|
color: _switchValue ? Colors.black : Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// Expanded(
|
||||||
|
Row(
|
||||||
|
// Adjust alignment as needed
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
_switchValue
|
||||||
|
? const Text(
|
||||||
|
'All',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
decoration: TextDecoration.lineThrough,
|
||||||
|
decorationThickness: 0.85,
|
||||||
|
),
|
||||||
|
// TODO: implement dispose
|
||||||
|
)
|
||||||
|
: const Text('All',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
)),
|
||||||
|
CupertinoSwitch(
|
||||||
|
activeColor: Color.fromARGB(255, 0, 71, 132),
|
||||||
|
value: _switchValue,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
print("Switch_value_is : $value");
|
||||||
|
_switchValue = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(right: 8.0),
|
||||||
|
child: !_switchValue
|
||||||
|
? const Text(
|
||||||
|
'My',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
decoration: TextDecoration.lineThrough,
|
||||||
|
decorationThickness: 0.85,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const Text('My',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
)),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// ),
|
||||||
|
]),
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: HiveFunctions.getAllUsers().length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
var data = HiveFunctions.getAllUsers()[index];
|
||||||
|
|
||||||
|
print("dataaaa_isss:$data");
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(context,
|
||||||
|
MaterialPageRoute(builder: (context) => Profile()));
|
||||||
|
},
|
||||||
|
// title: Text(_contactbox.values.toString()),
|
||||||
|
leading: ProfilePicture(
|
||||||
|
name: data["name"],
|
||||||
|
radius: 20,
|
||||||
|
fontsize: 12,
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
data["name"],
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18.0, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
subtitle: const Text(
|
||||||
|
"Added by Pooja.K",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.0, fontWeight: FontWeight.normal),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
import 'package:discover_module/ui_screen/ranking.dart';
|
||||||
|
import 'package:discover_module/ui_screen/rising_stars.dart';
|
||||||
|
import 'package:discover_module/ui_screen/trends.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Discover extends StatefulWidget {
|
||||||
|
const Discover(this.outerTab, {super.key});
|
||||||
|
|
||||||
|
final String outerTab;
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Discover> createState() => _DiscoverState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DiscoverState extends State<Discover> with TickerProviderStateMixin {
|
||||||
|
late final TabController _tabController;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_tabController = TabController(length: 3, vsync: this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
_tabController.dispose();
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Column(
|
||||||
|
children: <Widget>[
|
||||||
|
TabBar.secondary(
|
||||||
|
controller: _tabController,
|
||||||
|
labelStyle:
|
||||||
|
const TextStyle(fontSize: 12.0, fontWeight: FontWeight.bold),
|
||||||
|
indicatorWeight: 1.0,
|
||||||
|
indicatorColor: const Color.fromARGB(255, 0, 71, 135),
|
||||||
|
labelPadding: EdgeInsets.all(0.0),
|
||||||
|
tabs: const <Widget>[
|
||||||
|
Tab(text: 'Ranking'),
|
||||||
|
// Tab(text: 'Chart'),
|
||||||
|
Tab(text: 'Trends'),
|
||||||
|
//Tab(text: 'Referral'),
|
||||||
|
Tab(text: 'Rising Stars '),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TabBarView(
|
||||||
|
controller: _tabController,
|
||||||
|
children: <Widget>[
|
||||||
|
Ranking(),
|
||||||
|
// const Chart1(),
|
||||||
|
const Trends(),
|
||||||
|
//const Referral(),
|
||||||
|
const RisingStar(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,309 @@
|
||||||
|
import 'package:discover_module/custom_widget/elevation_btn.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
class Filters extends StatefulWidget {
|
||||||
|
const Filters({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<Filters> createState() => _FiltersState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FiltersState extends State<Filters> {
|
||||||
|
late bool value = true;
|
||||||
|
|
||||||
|
var _selectedItem;
|
||||||
|
var _selectedItem1;
|
||||||
|
|
||||||
|
Label? selectedColor;
|
||||||
|
bool shouldDisplay = false;
|
||||||
|
|
||||||
|
double? checkwidth;
|
||||||
|
|
||||||
|
TextEditingController txt1 = TextEditingController();
|
||||||
|
TextEditingController txt2 = TextEditingController();
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
if (MediaQuery.of(context).orientation == Orientation.portrait) {
|
||||||
|
print("it is Portrait");
|
||||||
|
checkwidth = MediaQuery.of(context).size.width * 0.90;
|
||||||
|
} else {
|
||||||
|
// is landscape
|
||||||
|
print("it is landscape");
|
||||||
|
checkwidth = MediaQuery.of(context).size.width * 0.95;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () => FocusScope.of(context).unfocus(),
|
||||||
|
child: ListView(
|
||||||
|
children: <Widget>[
|
||||||
|
// DrawerHeader removed
|
||||||
|
ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
const Icon(
|
||||||
|
Icons.filter_alt,
|
||||||
|
size: 30.0,
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
"Filters",
|
||||||
|
style:
|
||||||
|
TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
// print("hiii");
|
||||||
|
},
|
||||||
|
child: const Icon(Icons.cancel))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
ListTile(
|
||||||
|
title: Container(
|
||||||
|
padding: const EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(color: Colors.grey),
|
||||||
|
),
|
||||||
|
child: DropdownButtonFormField<String>(
|
||||||
|
decoration: const InputDecoration.collapsed(hintText: ''),
|
||||||
|
value: _selectedItem,
|
||||||
|
onChanged: (String? value) {
|
||||||
|
setState(() {
|
||||||
|
_selectedItem = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
items: <String>[
|
||||||
|
'Ivoclar EU Staging',
|
||||||
|
'Cardiology',
|
||||||
|
'CYTK_EU',
|
||||||
|
'Otolaryngology'
|
||||||
|
].map<DropdownMenuItem<String>>((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
hint: const Text('Select an Project Scope'),
|
||||||
|
isExpanded: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: TextField(
|
||||||
|
controller: txt1,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixIcon: const Icon(Icons.search),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
labelText: 'Keyword',
|
||||||
|
isDense: false,
|
||||||
|
contentPadding: const EdgeInsets.all(3),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: TextField(
|
||||||
|
controller: txt2,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixIcon: const Icon(Icons.search),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10.0),
|
||||||
|
),
|
||||||
|
labelText: 'Drugs',
|
||||||
|
isDense: false,
|
||||||
|
contentPadding: const EdgeInsets.all(3), // Added this
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.all(0.0),
|
||||||
|
child: Container(
|
||||||
|
padding: const EdgeInsets.all(9.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border.all(color: Colors.grey),
|
||||||
|
),
|
||||||
|
child: DropdownButtonFormField<String>(
|
||||||
|
decoration: const InputDecoration.collapsed(hintText: ''),
|
||||||
|
value: _selectedItem1,
|
||||||
|
onChanged: (String? value) {
|
||||||
|
setState(() {
|
||||||
|
_selectedItem1 = value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
items: <String>['Tag', 'Specialities', 'Country', 'Region']
|
||||||
|
.map<DropdownMenuItem<String>>((String value) {
|
||||||
|
return DropdownMenuItem<String>(
|
||||||
|
value: value,
|
||||||
|
child: Text(value),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
hint: const Text('Select an Filter'),
|
||||||
|
isExpanded: true,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
title: SizedBox(
|
||||||
|
width: checkwidth,
|
||||||
|
child: DropdownMenu(
|
||||||
|
// width: MediaQuery.of(context).size.width * 0.95,
|
||||||
|
// width: MediaQuery.of(context).size.width * 0.90,
|
||||||
|
width: checkwidth,
|
||||||
|
|
||||||
|
// width: 340.0,
|
||||||
|
requestFocusOnTap: true,
|
||||||
|
hintText: "Select text",
|
||||||
|
enableFilter: true,
|
||||||
|
onSelected: (color) {
|
||||||
|
if (color != null) {
|
||||||
|
setState(() {
|
||||||
|
// _themeColor =color;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
inputDecorationTheme: InputDecorationTheme(
|
||||||
|
isDense: false,
|
||||||
|
contentPadding: const EdgeInsets.symmetric(horizontal: 10),
|
||||||
|
constraints: BoxConstraints.tight(const Size.fromHeight(45)),
|
||||||
|
border: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// ignore: prefer_const_literals_to_create_immutables
|
||||||
|
dropdownMenuEntries: <DropdownMenuEntry<Color>>[
|
||||||
|
const DropdownMenuEntry(
|
||||||
|
value: Colors.white, label: 'Cardiovascular Disease'),
|
||||||
|
const DropdownMenuEntry(
|
||||||
|
value: Colors.red, label: 'Interventional Cardiology'),
|
||||||
|
const DropdownMenuEntry(
|
||||||
|
value: Colors.pinkAccent, label: 'Oncology'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
ListTile(
|
||||||
|
title: Padding(
|
||||||
|
padding: const EdgeInsets.only(left: 40.0, right: 40.0),
|
||||||
|
child: ElevationBtn(
|
||||||
|
onPressed: () {
|
||||||
|
print(_selectedItem);
|
||||||
|
|
||||||
|
print(_selectedItem1);
|
||||||
|
print(selectedColor);
|
||||||
|
print("Txt1 : ${txt1.text}");
|
||||||
|
print("Txt2 ${txt2.text}");
|
||||||
|
// Respond to button press
|
||||||
|
|
||||||
|
HiveFunctions1.createUser({
|
||||||
|
"name": _selectedItem,
|
||||||
|
"name1": _selectedItem1,
|
||||||
|
"name2": txt1.text,
|
||||||
|
"name3": txt2.text
|
||||||
|
});
|
||||||
|
|
||||||
|
print("StoredHive datais: ${HiveFunctions1.getAllUsers()}");
|
||||||
|
setState(() {
|
||||||
|
shouldDisplay = !shouldDisplay;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
text: "ADD",
|
||||||
|
color: Color.fromARGB(255, 0, 71, 132),
|
||||||
|
textcolor: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
shrinkWrap: true,
|
||||||
|
itemCount: HiveFunctions1.getAllUsers().length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
var data = HiveFunctions1.getAllUsers()[index];
|
||||||
|
|
||||||
|
// return Text("Data_isssss: ${data["name"]}");
|
||||||
|
|
||||||
|
return ListTile(
|
||||||
|
title: Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(data["name"],
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 21.0, fontWeight: FontWeight.bold)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
subtitle: Column(
|
||||||
|
children: [
|
||||||
|
Text(data["name1"],
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||||
|
Text(data["name2"],
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||||
|
Text(data["name3"],
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 18.0, fontWeight: FontWeight.bold)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String selectCity = "";
|
||||||
|
final cityselected = TextEditingController();
|
||||||
|
List<String> city = ["hubli", "dvg"];
|
||||||
|
|
||||||
|
enum Label {
|
||||||
|
Cardiology('Cardiology'),
|
||||||
|
Cardiac('Cardiac Surgery'),
|
||||||
|
Interventional('Interventional Cardiology'),
|
||||||
|
Cardiovascular('Cardiovascular Disease');
|
||||||
|
//grey('Grey');
|
||||||
|
|
||||||
|
const Label(
|
||||||
|
this.label,
|
||||||
|
);
|
||||||
|
final String label;
|
||||||
|
}
|
||||||
|
|
||||||
|
class HiveFunctions1 {
|
||||||
|
// String userHiveBox="User Box";
|
||||||
|
// Box which will use to store the things
|
||||||
|
static final _contactbox = Hive.box("myfilter");
|
||||||
|
|
||||||
|
static createUser(Map data) {
|
||||||
|
print("Dataa_isssss: $data");
|
||||||
|
_contactbox.add(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static List getAllUsers() {
|
||||||
|
final data = _contactbox.keys.map((key) {
|
||||||
|
final value = _contactbox.get(key);
|
||||||
|
return {
|
||||||
|
"name": value["name"],
|
||||||
|
"name1": value["name1"],
|
||||||
|
"name2": value["name2"],
|
||||||
|
"name3": value["name3"]
|
||||||
|
};
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
return data.reversed.toList();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
class HorizontalScrollView extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
State<HorizontalScrollView> createState() => _HorizontalScrollViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _HorizontalScrollViewState extends State<HorizontalScrollView> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Center(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(03.0),
|
||||||
|
child: Card(
|
||||||
|
surfaceTintColor: Colors.white,
|
||||||
|
elevation: 10.0,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
const Padding(
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: SearchBar(
|
||||||
|
leading: Icon(Icons.search),
|
||||||
|
hintText: "Search here",
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
child: DataTable(
|
||||||
|
columns: List.generate(
|
||||||
|
10, // Number of columns
|
||||||
|
(index) => DataColumn(label: Text('Column $index')),
|
||||||
|
),
|
||||||
|
rows: List.generate(
|
||||||
|
5, // Number of rows
|
||||||
|
(rowIndex) => DataRow(
|
||||||
|
cells: List.generate(
|
||||||
|
10, // Number of cells in each row
|
||||||
|
(cellIndex) => DataCell(
|
||||||
|
Text('Data 21223wewds $rowIndex'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
|
||||||
|
class NetworkConnectivity {
|
||||||
|
Future<bool> isInternetAvailable() async {
|
||||||
|
var connectivityResult = await (Connectivity().checkConnectivity());
|
||||||
|
return connectivityResult != ConnectivityResult.none;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,221 @@
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/NewtworkConnectivity.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/mockapi.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/util.dart';
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
class ConfigDataProvider extends ChangeNotifier {
|
||||||
|
Future<void> initConfigUIData() async {
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
// interactionConfigData = await fetchInteactionConfigData();
|
||||||
|
//interactionConfigData = fetchInteactionUIConfigData(jsonResult);
|
||||||
|
NetworkConnectivity networkConnectivity = NetworkConnectivity();
|
||||||
|
bool isOnline = await networkConnectivity.isInternetAvailable();
|
||||||
|
|
||||||
|
print("Checkonline: $isOnline");
|
||||||
|
if (isOnline) {
|
||||||
|
interactionConfigData = await fetchLocalInteactionConfigData();
|
||||||
|
print("interactionConfigData_is $interactionConfigData");
|
||||||
|
var box = Hive.box<InteractionConfigData>('InteractionConfigDataBox');
|
||||||
|
|
||||||
|
if (!box.isOpen) {
|
||||||
|
box = await Hive.openBox<InteractionConfigData>(
|
||||||
|
'InteractionConfigDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (box.isEmpty) {
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
box.clear();
|
||||||
|
print("IamELse");
|
||||||
|
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<InteractionConfigData>> fetchLocalInteactionConfigData() async {
|
||||||
|
// dynamic jsonResult = jsonDecode(
|
||||||
|
// await rootBundle.loadString("assets/images/interactiondata.json"));
|
||||||
|
dynamic jsonResult = await MockApiCall().getConfigData();
|
||||||
|
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
|
||||||
|
ResponseData responseData = ResponseDataFromJson(jsonResult);
|
||||||
|
print('Response_data_is: $responseData');
|
||||||
|
print('Response_data_dta_is: ${responseData.data}');
|
||||||
|
|
||||||
|
for (InteractionResultData obj in responseData.data) {
|
||||||
|
interactionConfigData
|
||||||
|
.add(InteractionConfigData(widgets: obj, id: obj.id, name: obj.name));
|
||||||
|
}
|
||||||
|
print("interactionConfigData_issss: ${interactionConfigData.length}");
|
||||||
|
return interactionConfigData;
|
||||||
|
}
|
||||||
|
|
||||||
|
//pooja
|
||||||
|
|
||||||
|
Future<void> initConfigUIData123() async {
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
// interactionConfigData = await fetchInteactionConfigData();
|
||||||
|
//interactionConfigData = fetchInteactionUIConfigData(jsonResult);
|
||||||
|
NetworkConnectivity networkConnectivity = NetworkConnectivity();
|
||||||
|
bool isOnline = await networkConnectivity.isInternetAvailable();
|
||||||
|
if (isOnline) {
|
||||||
|
interactionConfigData = await fetchLocalInteactionConfigData123();
|
||||||
|
var box = Hive.box<InteractionConfigData>('InteractionConfigDataBox');
|
||||||
|
|
||||||
|
if (!box.isOpen) {
|
||||||
|
box = await Hive.openBox<InteractionConfigData>(
|
||||||
|
'InteractionConfigDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (box.isEmpty) {
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
box.clear();
|
||||||
|
print("IamELse");
|
||||||
|
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<InteractionConfigData>>
|
||||||
|
fetchLocalInteactionConfigData123() async {
|
||||||
|
// dynamic jsonResult = jsonDecode(
|
||||||
|
// await rootBundle.loadString("assets/images/interactiondata.json"));
|
||||||
|
dynamic jsonResult = await MockApiCall().getConfigData123();
|
||||||
|
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
|
||||||
|
ResponseData responseData = ResponseDataFromJson(jsonResult);
|
||||||
|
print('Response_data_is: $responseData');
|
||||||
|
print('Response_data_dta_is: ${responseData.data}');
|
||||||
|
|
||||||
|
for (InteractionResultData obj in responseData.data) {
|
||||||
|
interactionConfigData
|
||||||
|
.add(InteractionConfigData(widgets: obj, id: obj.id, name: obj.name));
|
||||||
|
}
|
||||||
|
print("interactionConfigData_issss: ${interactionConfigData.length}");
|
||||||
|
return interactionConfigData;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initConfigUIDataMedical() async {
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
// interactionConfigData = await fetchInteactionConfigData();
|
||||||
|
//interactionConfigData = fetchInteactionUIConfigData(jsonResult);
|
||||||
|
|
||||||
|
NetworkConnectivity networkConnectivity = NetworkConnectivity();
|
||||||
|
bool isOnline = await networkConnectivity.isInternetAvailable();
|
||||||
|
if (isOnline) {
|
||||||
|
// if (await InternetConnectionChecker().hasConnection) {
|
||||||
|
interactionConfigData = await fetchLocalInteactionConfigDataMedical();
|
||||||
|
var box = Hive.box<InteractionConfigData>('InteractionConfigDataBox');
|
||||||
|
|
||||||
|
if (!box.isOpen) {
|
||||||
|
box = await Hive.openBox<InteractionConfigData>(
|
||||||
|
'InteractionConfigDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (box.isEmpty) {
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
box.clear();
|
||||||
|
print("IamELse");
|
||||||
|
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<InteractionConfigData>>
|
||||||
|
fetchLocalInteactionConfigDataMedical() async {
|
||||||
|
// dynamic jsonResult = jsonDecode(
|
||||||
|
// await rootBundle.loadString("assets/images/interactiondata.json"));
|
||||||
|
dynamic jsonResult = await MockApiCall().getConfigDataMedical();
|
||||||
|
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
|
||||||
|
ResponseData responseData = ResponseDataFromJson(jsonResult);
|
||||||
|
print('Response_data_is: $responseData');
|
||||||
|
print('Response_data_dta_is: ${responseData.data}');
|
||||||
|
|
||||||
|
for (InteractionResultData obj in responseData.data) {
|
||||||
|
interactionConfigData
|
||||||
|
.add(InteractionConfigData(widgets: obj, id: obj.id, name: obj.name));
|
||||||
|
}
|
||||||
|
print("interactionConfigData_issss: ${interactionConfigData.length}");
|
||||||
|
return interactionConfigData;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> initConfigUIDataEng() async {
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
// interactionConfigData = await fetchInteactionConfigData();
|
||||||
|
//interactionConfigData = fetchInteactionUIConfigData(jsonResult);
|
||||||
|
// if (await InternetConnectionChecker().hasConnection) {
|
||||||
|
|
||||||
|
NetworkConnectivity networkConnectivity = NetworkConnectivity();
|
||||||
|
bool isOnline = await networkConnectivity.isInternetAvailable();
|
||||||
|
if (isOnline) {
|
||||||
|
interactionConfigData = await fetchLocalInteactionConfigDataEng();
|
||||||
|
var box = Hive.box<InteractionConfigData>('InteractionConfigDataBox');
|
||||||
|
|
||||||
|
if (!box.isOpen) {
|
||||||
|
box = await Hive.openBox<InteractionConfigData>(
|
||||||
|
'InteractionConfigDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (box.isEmpty) {
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
box.clear();
|
||||||
|
print("IamELse");
|
||||||
|
|
||||||
|
for (InteractionConfigData data in interactionConfigData) {
|
||||||
|
box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<InteractionConfigData>>
|
||||||
|
fetchLocalInteactionConfigDataEng() async {
|
||||||
|
// dynamic jsonResult = jsonDecode(
|
||||||
|
// await rootBundle.loadString("assets/images/interactiondata.json"));
|
||||||
|
dynamic jsonResult = await MockApiCall().getConfigDataEng();
|
||||||
|
|
||||||
|
List<InteractionConfigData> interactionConfigData = [];
|
||||||
|
|
||||||
|
ResponseData responseData = ResponseDataFromJson(jsonResult);
|
||||||
|
print('Response_data_is: $responseData');
|
||||||
|
print('Response_data_dta_is: ${responseData.data}');
|
||||||
|
|
||||||
|
for (InteractionResultData obj in responseData.data) {
|
||||||
|
interactionConfigData
|
||||||
|
.add(InteractionConfigData(widgets: obj, id: obj.id, name: obj.name));
|
||||||
|
}
|
||||||
|
print("interactionConfigData_issss: ${interactionConfigData.length}");
|
||||||
|
return interactionConfigData;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,159 @@
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/interaction_screen.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/view_forms_list.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
class InteractionListScreen extends StatefulWidget {
|
||||||
|
const InteractionListScreen({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<InteractionListScreen> createState() => _InteractionListScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _InteractionListScreenState extends State<InteractionListScreen> {
|
||||||
|
List<SaveInteraction> savedList = [];
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||||
|
// if (!mytimer!.isActive) {
|
||||||
|
// activateTimer();
|
||||||
|
// }
|
||||||
|
print("interactionListt");
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
init() async {
|
||||||
|
print("init");
|
||||||
|
|
||||||
|
await Provider.of<InteractionProvider>(context, listen: false)
|
||||||
|
.initConfigData();
|
||||||
|
|
||||||
|
await Provider.of<InteractionProvider>(context, listen: false).getRecords();
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> getCount(String form, InteractionProvider provider) async {
|
||||||
|
await provider.getRecords();
|
||||||
|
|
||||||
|
return provider.savedList.where((element) => element.form == form).length;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Consumer<InteractionProvider>(
|
||||||
|
builder: (BuildContext context, provider, Widget? child) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
'Interaction Forms',
|
||||||
|
//style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||||
|
),
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
backgroundColor: const Color(0xFF2b9af3),
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
child: Center(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: provider.intConfigDataList.length,
|
||||||
|
cacheExtent: double.parse(
|
||||||
|
provider.intConfigDataList.length.toString()),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
title: Row(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
provider.intConfigDataList[index].name,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 20,
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) =>
|
||||||
|
InteractionScreen(
|
||||||
|
index: index,
|
||||||
|
form: provider
|
||||||
|
.intConfigDataList[index]
|
||||||
|
.name,
|
||||||
|
)));
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.arrow_circle_right_outlined,
|
||||||
|
size: 30,
|
||||||
|
color: Color.fromARGB(255, 8, 39, 92),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
trailing: provider.savedList.indexWhere((element) =>
|
||||||
|
element.form ==
|
||||||
|
provider.intConfigDataList[index].name) !=
|
||||||
|
-1
|
||||||
|
? InkWell(
|
||||||
|
onTap: () {
|
||||||
|
if (getCount(
|
||||||
|
provider
|
||||||
|
.intConfigDataList[index].name,
|
||||||
|
provider) !=
|
||||||
|
0) {
|
||||||
|
provider.savedList
|
||||||
|
.where((element) =>
|
||||||
|
element.form ==
|
||||||
|
provider.intConfigDataList[index]
|
||||||
|
.name)
|
||||||
|
.toList();
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) =>
|
||||||
|
SavedFormListScreen(
|
||||||
|
formname: provider
|
||||||
|
.intConfigDataList[
|
||||||
|
index]
|
||||||
|
.name,
|
||||||
|
)));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
child: FittedBox(
|
||||||
|
fit: BoxFit.scaleDown,
|
||||||
|
child: Text(
|
||||||
|
"${provider.savedList.where((element) => element.form == provider.intConfigDataList[index].name).length} record(s) saved",
|
||||||
|
style: TextStyle(
|
||||||
|
// fontSize: isTablet ? 18.0 : 14,
|
||||||
|
fontSize: 18.0,
|
||||||
|
color: Colors.blue.shade900),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) =>
|
||||||
|
InteractionScreen(
|
||||||
|
index: index,
|
||||||
|
form: provider
|
||||||
|
.intConfigDataList[index].name,
|
||||||
|
)));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const Divider(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,666 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
// import 'dart:html';
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/repository/hive_repository.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/util.dart';
|
||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart';
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/location_model.dart';
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
|
||||||
|
|
||||||
|
class InteractionProvider extends ChangeNotifier {
|
||||||
|
List<FormFieldData> interactionReponseList = [];
|
||||||
|
// List<dynamic> sectionList = [];
|
||||||
|
List<SectionList> sectionList = [];
|
||||||
|
late Location locationList;
|
||||||
|
List<TextEditingController> textEditingControllerList = [];
|
||||||
|
List<TextEditingController> multipletextEditingControllerList = [];
|
||||||
|
int textfieldIndex = 0;
|
||||||
|
|
||||||
|
List<InputClass> checkboxlist = [];
|
||||||
|
|
||||||
|
String radioValue = '';
|
||||||
|
bool checkboxValue = false;
|
||||||
|
|
||||||
|
//List<InteractionDatum> data = [];
|
||||||
|
List<SectionList> newList = [];
|
||||||
|
String sectionName = '';
|
||||||
|
late String selectedCity = 'Selected City', selectedState = 'Selected State';
|
||||||
|
|
||||||
|
String? selectedValue;
|
||||||
|
List<String> selectedItems = [];
|
||||||
|
InputClass? selectedObj;
|
||||||
|
List<SaveInteraction> savedList = [];
|
||||||
|
List<InteractionConfigData> intConfigDataList = [];
|
||||||
|
String? intId, intName;
|
||||||
|
final HiveDataRepository _hiveprovider = HiveDataRepository(
|
||||||
|
Hive.box<InteractionConfigData>('InteractionConfigDataBox'));
|
||||||
|
|
||||||
|
initConfigData() async {
|
||||||
|
_hiveprovider.openHiveBox();
|
||||||
|
intConfigDataList = _hiveprovider.getAllDataFromHive();
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> getRecords() async {
|
||||||
|
var box = Hive.box<SaveInteraction>('InteractionDataBox');
|
||||||
|
|
||||||
|
if (!box.isOpen) {
|
||||||
|
box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
savedList = box.values.toList();
|
||||||
|
print("savedListt: $savedList");
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
init(int index) async {
|
||||||
|
await initConfigData();
|
||||||
|
InteractionConfigData interactionConfigData = intConfigDataList[index];
|
||||||
|
intId = intConfigDataList[index].id;
|
||||||
|
intName = intConfigDataList[index].name;
|
||||||
|
|
||||||
|
radioValue = '';
|
||||||
|
print("data $intConfigDataList");
|
||||||
|
|
||||||
|
await fetchData(interactionConfigData.widgets);
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
initSavedForm(SaveInteraction saveInteractiondata) {
|
||||||
|
interactionReponseList = saveInteractiondata.save
|
||||||
|
.map((e) => FormFieldData(
|
||||||
|
multipleList: e.multipleList == null
|
||||||
|
? []
|
||||||
|
: e.multipleList!
|
||||||
|
.map((mobj) => SectionList(
|
||||||
|
depid: mobj.depid,
|
||||||
|
id: mobj.id,
|
||||||
|
inputList: mobj.inputList,
|
||||||
|
isRequired: mobj.isRequired,
|
||||||
|
name: mobj.name,
|
||||||
|
param: mobj.param,
|
||||||
|
selectedValue: mobj.selectedValue,
|
||||||
|
fileName: mobj.fileName,
|
||||||
|
extension: mobj.extension,
|
||||||
|
widget: mobj.widget,
|
||||||
|
controller: mobj.controller,
|
||||||
|
gid: mobj.gid,
|
||||||
|
input: mobj.input,
|
||||||
|
selectedId: mobj.selectedId,
|
||||||
|
value: mobj.value))
|
||||||
|
.toList(),
|
||||||
|
sectionList: e.sectionList
|
||||||
|
.map((obj) => SectionList(
|
||||||
|
depid: obj.depid,
|
||||||
|
id: obj.id,
|
||||||
|
inputList: obj.inputList,
|
||||||
|
isRequired: obj.isRequired,
|
||||||
|
name: obj.name,
|
||||||
|
param: obj.param,
|
||||||
|
fileName: obj.fileName,
|
||||||
|
extension: obj.extension,
|
||||||
|
selectedValue: obj.selectedValue,
|
||||||
|
widget: obj.widget,
|
||||||
|
controller: obj.controller,
|
||||||
|
gid: obj.gid,
|
||||||
|
input: obj.input,
|
||||||
|
selectedId: obj.selectedId,
|
||||||
|
value: obj.value,
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
sectionName: e.sectionName,
|
||||||
|
multiple: e.multiple))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
textEditingControllerList.clear();
|
||||||
|
|
||||||
|
for (var item in interactionReponseList) {
|
||||||
|
sectionList = item.sectionList;
|
||||||
|
for (var sectionItem in item.sectionList) {
|
||||||
|
if (sectionItem.widget == InteractionWidget.TEXT) {
|
||||||
|
var textEditingController = TextEditingController();
|
||||||
|
|
||||||
|
textEditingControllerList.add(textEditingController);
|
||||||
|
sectionItem.controller = textEditingControllerList.last;
|
||||||
|
}
|
||||||
|
if (sectionItem.widget == InteractionWidget.DROPDOWN ||
|
||||||
|
sectionItem.widget == InteractionWidget.AUTOCOMPLETE ||
|
||||||
|
sectionItem.widget == InteractionWidget.MULTISELECT) {
|
||||||
|
List<InputClass> list = sectionItem.inputList!;
|
||||||
|
sectionItem.value = list[0].id;
|
||||||
|
print("value : ${list.first} ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print(interactionReponseList);
|
||||||
|
print("check textcontrollers ${textEditingControllerList.length}");
|
||||||
|
}
|
||||||
|
|
||||||
|
String getDataValue(String widgetId, String id) {
|
||||||
|
print("issue *************");
|
||||||
|
if (id != "") {
|
||||||
|
List<InputClass> list = [];
|
||||||
|
String value = ' ';
|
||||||
|
|
||||||
|
for (FormFieldData obj1 in interactionReponseList) {
|
||||||
|
// List<InputClass> list =
|
||||||
|
for (SectionList obj in obj1.sectionList) {
|
||||||
|
if (obj.id == widgetId) {
|
||||||
|
list = obj.inputList!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (list.isNotEmpty) {
|
||||||
|
int index = list.indexWhere((element) => element.id.toString() == id);
|
||||||
|
|
||||||
|
if (index != -1) {
|
||||||
|
value = list[index].name;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return value;
|
||||||
|
} else {
|
||||||
|
return " ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Search for widget with depid and check if selected is not null and by selected id get the data of current widget
|
||||||
|
|
||||||
|
List<InputClass> getData2(SectionList sectionItem) {
|
||||||
|
List<InputClass> list = [];
|
||||||
|
// if (sectionItem.inputList != null) {
|
||||||
|
list = sectionItem.inputList!;
|
||||||
|
if (sectionItem.depid != "") {
|
||||||
|
// print("check depid : ${sectionItem.depid}");
|
||||||
|
int i = 0;
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
i = obj.sectionList
|
||||||
|
.indexWhere((element) => element.id == sectionItem.depid);
|
||||||
|
// print("check depid index: $i");
|
||||||
|
if (i != -1) {
|
||||||
|
//print("check depid value: ${obj.sectionList[i].value}");
|
||||||
|
if (obj.sectionList[i].value != null) {
|
||||||
|
if (list
|
||||||
|
.where((element) => element.pid == obj.sectionList[i].value)
|
||||||
|
.isNotEmpty) {
|
||||||
|
list = list
|
||||||
|
.where((element) => element.pid == obj.sectionList[i].value)
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
sectionItem.selectedObject = list[0];
|
||||||
|
} else {
|
||||||
|
// InputClass obj = InputClass(
|
||||||
|
// id: "obj.sectionList[i].value",
|
||||||
|
// name: "Select ${sectionItem.name}");
|
||||||
|
list = [];
|
||||||
|
// list.add(obj);
|
||||||
|
sectionItem.selectedObject = null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// int index = obj.sectionList
|
||||||
|
// .indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
|
||||||
|
// list = obj.sectionList[index].inputList;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// int index = data[i].data.indexWhere((element) => element.)
|
||||||
|
}
|
||||||
|
// }
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
setDropDownValue(String value, SectionList sectionItem, bool multiple) {
|
||||||
|
int i = 0;
|
||||||
|
print("selected $value");
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
if (multiple && obj.multipleList != null) {
|
||||||
|
i = obj.multipleList!
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (i != -1) {
|
||||||
|
obj.multipleList![i].value = value;
|
||||||
|
obj.multipleList![i].selectedValue!.add(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
i = obj.sectionList
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (i != -1) {
|
||||||
|
obj.sectionList[i].value = value;
|
||||||
|
obj.sectionList[i].selectedValue!.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
setTextValue(String value, SectionList sectionItem, bool multiple) {
|
||||||
|
int i = 0;
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
if (multiple && obj.multipleList != null) {
|
||||||
|
i = obj.multipleList!
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (i != -1) {
|
||||||
|
obj.multipleList![i].value = value;
|
||||||
|
obj.multipleList![i].selectedValue!.add(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
i = obj.sectionList
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (i != -1) {
|
||||||
|
obj.sectionList[i].value = value;
|
||||||
|
obj.sectionList[i].selectedValue!.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
setAutoCompleteValue(String value, SectionList sectionItem, bool multiple) {
|
||||||
|
int i = 0;
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
if (multiple && obj.multipleList != null) {
|
||||||
|
i = obj.multipleList!
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (i != -1) {
|
||||||
|
obj.multipleList![i].value = value;
|
||||||
|
obj.multipleList![i].selectedValue!.add(value);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
i = obj.sectionList
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (i != -1) {
|
||||||
|
obj.sectionList[i].value = value;
|
||||||
|
obj.sectionList[i].selectedValue!.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> fetchData(InteractionResultData interactionResultData) async {
|
||||||
|
InteractionResultData interactionConfig = interactionResultData;
|
||||||
|
|
||||||
|
print("itemCategoryModel Item = + ${interactionConfig.result}");
|
||||||
|
// }
|
||||||
|
interactionReponseList = interactionConfig.result;
|
||||||
|
print("check stored: $interactionReponseList");
|
||||||
|
|
||||||
|
textEditingControllerList.clear();
|
||||||
|
|
||||||
|
for (var item in interactionReponseList) {
|
||||||
|
sectionList = item.sectionList;
|
||||||
|
for (var sectionItem in item.sectionList) {
|
||||||
|
sectionItem.selectedValue = [];
|
||||||
|
if (sectionItem.widget == InteractionWidget.TEXT) {
|
||||||
|
var textEditingController = TextEditingController();
|
||||||
|
|
||||||
|
textEditingControllerList.add(textEditingController);
|
||||||
|
sectionItem.controller = textEditingControllerList.last;
|
||||||
|
}
|
||||||
|
if (sectionItem.widget == InteractionWidget.DROPDOWN ||
|
||||||
|
sectionItem.widget == InteractionWidget.AUTOCOMPLETE ||
|
||||||
|
sectionItem.widget == InteractionWidget.MULTISELECT) {
|
||||||
|
// int index = data
|
||||||
|
// .indexWhere((element) => element.widgetId == sectionItem.id);
|
||||||
|
// List<InputClass> list = data[index].data;
|
||||||
|
List<InputClass> list = sectionItem.inputList!;
|
||||||
|
sectionItem.value = list[0].id;
|
||||||
|
if (sectionItem.widget == InteractionWidget.MULTISELECT) {
|
||||||
|
sectionItem.selectedValue!.add(list[0].name);
|
||||||
|
} else {
|
||||||
|
sectionItem.selectedValue!.add(list[0].id);
|
||||||
|
}
|
||||||
|
|
||||||
|
sectionItem.selectedObject = list[0];
|
||||||
|
print("value : ${list.first} ");
|
||||||
|
} else if (sectionItem.widget == InteractionWidget.CHECKBOX) {
|
||||||
|
List<InputClass> list = sectionItem.inputList!;
|
||||||
|
if (list.isNotEmpty) {
|
||||||
|
for (var element in sectionItem.inputList!) {
|
||||||
|
element.ischecked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// sectionItem.value = list[0].id;
|
||||||
|
// sectionItem.selectedValue!.add(list[0].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print(interactionReponseList);
|
||||||
|
print("check textcontrollers ${textEditingControllerList.length}");
|
||||||
|
notifyListeners();
|
||||||
|
|
||||||
|
return "success";
|
||||||
|
}
|
||||||
|
|
||||||
|
resetAllWidgetsData() {
|
||||||
|
textEditingControllerList.clear();
|
||||||
|
|
||||||
|
for (var item in interactionReponseList) {
|
||||||
|
item.multipleList = [];
|
||||||
|
sectionList = item.sectionList;
|
||||||
|
for (var sectionItem in item.sectionList) {
|
||||||
|
sectionItem.selectedValue = [];
|
||||||
|
// sectionItem.value = '';
|
||||||
|
// sectionItem.selectedObject = InputClass(id: '', name: '');
|
||||||
|
if (sectionItem.widget == InteractionWidget.TEXT) {
|
||||||
|
var textEditingController = TextEditingController();
|
||||||
|
|
||||||
|
textEditingControllerList.add(textEditingController);
|
||||||
|
sectionItem.controller = textEditingControllerList.last;
|
||||||
|
}
|
||||||
|
if (item.sectionName != "Other") {
|
||||||
|
if (sectionItem.widget == InteractionWidget.DROPDOWN ||
|
||||||
|
sectionItem.widget == InteractionWidget.AUTOCOMPLETE ||
|
||||||
|
sectionItem.widget == InteractionWidget.MULTISELECT) {
|
||||||
|
// int index = data
|
||||||
|
// .indexWhere((element) => element.widgetId == sectionItem.id);
|
||||||
|
print("Selected widget : ${sectionItem.id}");
|
||||||
|
List<InputClass> list = sectionItem.inputList!;
|
||||||
|
sectionItem.value = list[0].id;
|
||||||
|
sectionItem.selectedObject = list[0];
|
||||||
|
print("value : ${list.first.name} ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print(interactionReponseList);
|
||||||
|
print("check textcontrollers ${textEditingControllerList.length}");
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
setRadioValue(SectionList sectionItem) {
|
||||||
|
List<InputClass> list = (sectionItem.input as List)
|
||||||
|
.map((itemWord) => InputClass.fromJson(itemWord))
|
||||||
|
.toList();
|
||||||
|
radioValue = list[0].name;
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
setcheckBoxValue(SectionList sectionItem, String sectionName, bool newValue,
|
||||||
|
String id, bool multiple) {
|
||||||
|
int index =
|
||||||
|
sectionItem.inputList!.indexWhere((element) => element.id == id);
|
||||||
|
sectionItem.inputList![index].ischecked = newValue;
|
||||||
|
// sectionItem.selectedValue.add(data[i].data[index].id);
|
||||||
|
int index2 = 0;
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
if (multiple && obj.multipleList != null) {
|
||||||
|
index2 = obj.multipleList!
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (index2 != -1) {
|
||||||
|
obj.multipleList![index2].value = sectionItem.inputList![index].id;
|
||||||
|
obj.multipleList![index2].selectedValue!
|
||||||
|
.add(sectionItem.inputList![index].id);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
index2 = obj.sectionList
|
||||||
|
.indexWhere((element) => element.id == sectionItem.id);
|
||||||
|
if (index2 != -1) {
|
||||||
|
obj.sectionList[index2].value = sectionItem.inputList![index].id;
|
||||||
|
obj.sectionList[index2].selectedValue!
|
||||||
|
.add(sectionItem.inputList![index].id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
getSectionItem(String sectionName) {
|
||||||
|
newList = [];
|
||||||
|
List<SectionList> addList = [];
|
||||||
|
int index = interactionReponseList
|
||||||
|
.indexWhere((element) => element.sectionName == sectionName);
|
||||||
|
|
||||||
|
addList = interactionReponseList[index]
|
||||||
|
.sectionList
|
||||||
|
.map((e) => SectionList(
|
||||||
|
depid: e.depid,
|
||||||
|
id: e.id,
|
||||||
|
inputList: e.inputList,
|
||||||
|
isRequired: e.isRequired,
|
||||||
|
name: e.name,
|
||||||
|
param: e.param,
|
||||||
|
selectedValue: [],
|
||||||
|
widget: e.widget,
|
||||||
|
controller: e.controller,
|
||||||
|
gid: e.gid,
|
||||||
|
input: e.input,
|
||||||
|
selectedId: e.selectedId,
|
||||||
|
value: e.value))
|
||||||
|
.toList();
|
||||||
|
SectionList delItem = SectionList(
|
||||||
|
name: "delete",
|
||||||
|
param: "deletebtn",
|
||||||
|
id: "deletebtn",
|
||||||
|
selectedValue: [],
|
||||||
|
depid: "",
|
||||||
|
widget: InteractionWidget.BUTTON,
|
||||||
|
inputList: [],
|
||||||
|
isRequired: true);
|
||||||
|
|
||||||
|
addList.add(delItem);
|
||||||
|
|
||||||
|
// if (interactionReponseList[index].multipleList!.isEmpty) {
|
||||||
|
// newList = addList;
|
||||||
|
// } else {
|
||||||
|
if (interactionReponseList[index].multipleList == null) {
|
||||||
|
interactionReponseList[index].multipleList = addList;
|
||||||
|
} else {
|
||||||
|
interactionReponseList[index].multipleList =
|
||||||
|
interactionReponseList[index].multipleList! + addList;
|
||||||
|
}
|
||||||
|
|
||||||
|
newList = interactionReponseList[index].multipleList!;
|
||||||
|
// newList = newList + addList;
|
||||||
|
// }
|
||||||
|
if (interactionReponseList[index].multipleList != null) {
|
||||||
|
for (SectionList obj in interactionReponseList[index].multipleList!) {
|
||||||
|
obj.gid = obj.gid ?? interactionReponseList[index].multipleList!.length;
|
||||||
|
if (obj.widget == InteractionWidget.TEXT) {
|
||||||
|
var textEditingController = TextEditingController();
|
||||||
|
|
||||||
|
multipletextEditingControllerList.add(textEditingController);
|
||||||
|
obj.controller = multipletextEditingControllerList.last;
|
||||||
|
}
|
||||||
|
// newList.add(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
print(
|
||||||
|
"check length : ${interactionReponseList[index].multipleList!.length}");
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteMultipleRows(
|
||||||
|
int gid, SectionList sectionItem, String selectedSectionName) {
|
||||||
|
int index = interactionReponseList
|
||||||
|
.indexWhere((element) => element.sectionName == selectedSectionName);
|
||||||
|
|
||||||
|
print("controllerssssss : ${multipletextEditingControllerList.length}");
|
||||||
|
interactionReponseList[index]
|
||||||
|
.multipleList!
|
||||||
|
.removeWhere((item) => item.gid == gid);
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool validateMultipleRows() {
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
if (obj.multipleList != null) {
|
||||||
|
for (var mulobj in obj.multipleList!) {
|
||||||
|
if (mulobj.widget == InteractionWidget.TEXT) {
|
||||||
|
if (mulobj.controller!.text.isEmpty) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool validateTextFields() {
|
||||||
|
for (var obj in interactionReponseList) {
|
||||||
|
for (var mulobj in obj.sectionList) {
|
||||||
|
if (mulobj.widget == InteractionWidget.TEXT) {
|
||||||
|
if (mulobj.controller!.text.isEmpty) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> saveJsonObject(BuildContext context, String form,
|
||||||
|
{bool isEdit = false}) async {
|
||||||
|
print("form_data: $form");
|
||||||
|
List<FormFieldData> resultData = interactionReponseList
|
||||||
|
.map((e) => FormFieldData(
|
||||||
|
multipleList: e.multipleList == null
|
||||||
|
? []
|
||||||
|
: e.multipleList!
|
||||||
|
.map((mobj) => SectionList(
|
||||||
|
depid: mobj.depid,
|
||||||
|
id: mobj.id,
|
||||||
|
inputList: mobj.inputList,
|
||||||
|
isRequired: mobj.isRequired,
|
||||||
|
name: mobj.name,
|
||||||
|
param: mobj.param,
|
||||||
|
selectedValue: mobj.selectedValue,
|
||||||
|
extension: mobj.extension,
|
||||||
|
fileName: mobj.fileName,
|
||||||
|
widget: mobj.widget,
|
||||||
|
// controller: mobj.controller,
|
||||||
|
gid: mobj.gid,
|
||||||
|
input: mobj.input,
|
||||||
|
selectedId: mobj.selectedId,
|
||||||
|
value: mobj.value))
|
||||||
|
.toList(),
|
||||||
|
sectionList: e.sectionList
|
||||||
|
.map((obj) => SectionList(
|
||||||
|
depid: obj.depid,
|
||||||
|
id: obj.id,
|
||||||
|
inputList: obj.inputList,
|
||||||
|
isRequired: obj.isRequired,
|
||||||
|
name: obj.name,
|
||||||
|
param: obj.param,
|
||||||
|
selectedValue: obj.selectedValue,
|
||||||
|
widget: obj.widget,
|
||||||
|
controller: obj.controller,
|
||||||
|
gid: obj.gid,
|
||||||
|
input: obj.input,
|
||||||
|
extension: obj.extension,
|
||||||
|
fileName: obj.fileName,
|
||||||
|
selectedId: obj.selectedId,
|
||||||
|
value: obj.value))
|
||||||
|
.toList(),
|
||||||
|
sectionName: e.sectionName,
|
||||||
|
multiple: e.multiple))
|
||||||
|
.toList();
|
||||||
|
|
||||||
|
String generateId = '${intId}R${await getNextAutoIncrementValue()}';
|
||||||
|
|
||||||
|
final data = SaveInteraction(
|
||||||
|
save: resultData,
|
||||||
|
id: generateId,
|
||||||
|
updatedTime: DateTime.now().toString(),
|
||||||
|
form: form,
|
||||||
|
intId: intId ?? "id",
|
||||||
|
intName: intName ?? "name");
|
||||||
|
var box = Hive.box<SaveInteraction>('InteractionDataBox');
|
||||||
|
|
||||||
|
if (!box.isOpen) {
|
||||||
|
box = await Hive.openBox<SaveInteraction>('InteractionDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
await box.put(await getNextAutoIncrementValue(), data);
|
||||||
|
// box.close();
|
||||||
|
await getRecords();
|
||||||
|
return generateId;
|
||||||
|
// await MockApiCall().postFormData(data);
|
||||||
|
// await prov.addOfflineData(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
List<MultipleSectionList> getModifiedList(List<SectionList> sectionList) {
|
||||||
|
List<MultipleSectionList> newSectionList = [];
|
||||||
|
for (var obj in sectionList) {
|
||||||
|
if (obj.id != 'deletebtn') {
|
||||||
|
if (obj.input == 'chooseFile') {
|
||||||
|
MultipleSectionList newobj = MultipleSectionList(
|
||||||
|
id: obj.id,
|
||||||
|
selectedValue: obj.selectedValue!,
|
||||||
|
extension: obj.extension!,
|
||||||
|
fileName: obj.fileName!,
|
||||||
|
);
|
||||||
|
|
||||||
|
newSectionList.add(newobj);
|
||||||
|
} else {
|
||||||
|
MultipleSectionList newobj = MultipleSectionList(
|
||||||
|
id: obj.id,
|
||||||
|
selectedValue: obj.selectedValue!,
|
||||||
|
);
|
||||||
|
newSectionList.add(newobj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return newSectionList;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<List<MultipleSectionList>> getMultipleSectionList(
|
||||||
|
List<SectionList> sectionList, List<SectionList> multipleList) {
|
||||||
|
List<List<MultipleSectionList>> list = [];
|
||||||
|
List<List<MultipleSectionList>> listing = [];
|
||||||
|
List<MultipleSectionList> secList = getModifiedList(sectionList);
|
||||||
|
List<MultipleSectionList> multipleList0 = getModifiedList(multipleList);
|
||||||
|
list.add(secList);
|
||||||
|
listing.add(secList);
|
||||||
|
// List<SectionList> listing = [];
|
||||||
|
if (multipleList.isNotEmpty) {
|
||||||
|
final releaseDateMap = multipleList.groupBy((m) => m.gid);
|
||||||
|
print("see map : $releaseDateMap");
|
||||||
|
|
||||||
|
if (releaseDateMap.isNotEmpty) {
|
||||||
|
listing = [];
|
||||||
|
List<List<SectionList>> mulList =
|
||||||
|
releaseDateMap.values.toList(growable: true);
|
||||||
|
for (var item in mulList) {
|
||||||
|
listing.add(getModifiedList(item));
|
||||||
|
}
|
||||||
|
listing.add(secList);
|
||||||
|
list = [...listing];
|
||||||
|
|
||||||
|
//});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveInteractionFormJson formJson(SaveInteraction saveInteraction) {
|
||||||
|
List<Save> saveList = [];
|
||||||
|
for (var obj in saveInteraction.save) {
|
||||||
|
Save saveobj = Save(
|
||||||
|
sectionName: obj.sectionName,
|
||||||
|
multipleSectionList:
|
||||||
|
getMultipleSectionList(obj.sectionList, obj.multipleList!));
|
||||||
|
saveList.add(saveobj);
|
||||||
|
}
|
||||||
|
|
||||||
|
SaveInteractionFormJson saveInteractionFormJson = SaveInteractionFormJson(
|
||||||
|
interactionForm1: saveInteraction.form!,
|
||||||
|
intId: saveInteraction.id,
|
||||||
|
intName: saveInteraction.intName,
|
||||||
|
save: saveList);
|
||||||
|
return saveInteractionFormJson;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,631 @@
|
||||||
|
import 'dart:convert';
|
||||||
|
import 'dart:developer';
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:dio/io.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart';
|
||||||
|
import 'package:http_mock_adapter/http_mock_adapter.dart';
|
||||||
|
// import 'package:pwa_ios/model/interaction_config_data.dart';
|
||||||
|
|
||||||
|
class MockApiCall {
|
||||||
|
Future<dynamic> getConfigData() async {
|
||||||
|
print("Iam_getConfig");
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
final dio = Dio();
|
||||||
|
|
||||||
|
final response = await dio.get('https://passvault.konectar.io/forms');
|
||||||
|
|
||||||
|
print("response1");
|
||||||
|
// print(response.data.toString());
|
||||||
|
log('${jsonEncode(response.data)}');
|
||||||
|
|
||||||
|
return response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> postConfigData(var jsonObj) async {
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
final dio = Dio();
|
||||||
|
|
||||||
|
dio.httpClientAdapter = IOHttpClientAdapter(
|
||||||
|
createHttpClient: () {
|
||||||
|
// Don't trust any certificate just because their root cert is trusted.
|
||||||
|
final HttpClient client =
|
||||||
|
HttpClient(context: SecurityContext(withTrustedRoots: false));
|
||||||
|
// You can test the intermediate / root cert here. We just ignore it.
|
||||||
|
client.badCertificateCallback =
|
||||||
|
((X509Certificate cert, String host, int port) => true);
|
||||||
|
return client;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
//final dioAdapter = DioAdapter(dio: dio);
|
||||||
|
// dynamic jsonResult = jsonDecode(
|
||||||
|
// await rootBundle.loadString("assets/images/interactiondata.json"));
|
||||||
|
// Set up a mock response for GET requests to "https://example.com"
|
||||||
|
// dio.get('192.168.2.64/passvault/public/forms'
|
||||||
|
// (server) => server.reply(
|
||||||
|
// 200,
|
||||||
|
// jsonResult,
|
||||||
|
// // Delay the response by 1 second
|
||||||
|
// delay: const Duration(seconds: 1),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// Send a GET request to "https://example.com" using Dio
|
||||||
|
final response = await dio
|
||||||
|
.post('http://192.168.2.64/konectar-app/public/forms', data: jsonObj);
|
||||||
|
|
||||||
|
UIDataResponse dataResponse = UIDataResponse.fromJson(response.data);
|
||||||
|
// The response should contain the mock data we registered
|
||||||
|
print("response2_iss");
|
||||||
|
print(response.data);
|
||||||
|
|
||||||
|
return dataResponse;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Future<void> getConfigWidgetData() async {
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
// final dioAdapter = DioAdapter(dio: dio);
|
||||||
|
// dynamic jsonResult = jsonDecode(
|
||||||
|
// await rootBundle.loadString("assets/images/interactiondata.json"));
|
||||||
|
// // Set up a mock response for GET requests to "https://example.com"
|
||||||
|
// dioAdapter.onGet(
|
||||||
|
// 'https://example.com',
|
||||||
|
// (server) => server.reply(
|
||||||
|
// 200,
|
||||||
|
// jsonResult,
|
||||||
|
// // Delay the response by 1 second
|
||||||
|
// delay: const Duration(seconds: 1),
|
||||||
|
// ),
|
||||||
|
// );
|
||||||
|
// // Send a GET request to "https://example.com" using Dio
|
||||||
|
// final response = await dio.get('https://example.com');
|
||||||
|
// // The response should contain the mock data we registered
|
||||||
|
// print(response.data); // {messa
|
||||||
|
// }
|
||||||
|
|
||||||
|
Future<void> postFormData(var jsonObj) async {
|
||||||
|
final dio = Dio(BaseOptions());
|
||||||
|
final dioAdapter = DioAdapter(dio: dio);
|
||||||
|
|
||||||
|
dioAdapter.onPost(
|
||||||
|
'https://example.com',
|
||||||
|
data: jsonObj,
|
||||||
|
(server) => server.reply(
|
||||||
|
200,
|
||||||
|
{"message": "success"},
|
||||||
|
// Delay the response by 1 second
|
||||||
|
delay: const Duration(seconds: 1),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
// Send a GET request to "https://example.com" using Dio
|
||||||
|
final response = await dio.post(
|
||||||
|
'http://192.168.2.64/konectar-app/public/push_data',
|
||||||
|
data: jsonObj);
|
||||||
|
// The response should contain the mock data we registered
|
||||||
|
print(response.data); // {messa
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> postSavedData(var jsonObj) async {
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
final dio = Dio();
|
||||||
|
// ignore: deprecated_member_use
|
||||||
|
(dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
||||||
|
(HttpClient client) {
|
||||||
|
client.badCertificateCallback =
|
||||||
|
(X509Certificate cert, String host, int port) => true;
|
||||||
|
return client;
|
||||||
|
};
|
||||||
|
|
||||||
|
final options = Options(
|
||||||
|
sendTimeout: const Duration(seconds: 15),
|
||||||
|
receiveTimeout: const Duration(seconds: 15),
|
||||||
|
);
|
||||||
|
|
||||||
|
final response = await dio.get('https://passvault.konectar.io/push_data',
|
||||||
|
options: options, data: jsonObj);
|
||||||
|
|
||||||
|
//UIDataResponse dataResponse = UIDataResponse.fromJson(response.data);
|
||||||
|
// The response should contain the mock data we registered
|
||||||
|
print("response3");
|
||||||
|
print(response.data);
|
||||||
|
return response.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> uploadFileAndJsonData(var jsonObj) async {
|
||||||
|
// {required File empFace, required String empCode}
|
||||||
|
const url = 'http://192.168.2.64/konectar-app/public/push_data';
|
||||||
|
try {
|
||||||
|
var formData = FormData.fromMap({
|
||||||
|
"files": [
|
||||||
|
MultipartFile.fromFileSync(
|
||||||
|
"/Users/aissel/Library/Developer/CoreSimulator/Devices/1E435121-7E65-45C6-9E0B-411C8B9915F5/data/Containers/Data/Application/3CBC1CFF-79AD-49FA-A6E0-13D0AA2959D2/tmp/Flutter Questionaire.pdf",
|
||||||
|
filename: "upload.txt"),
|
||||||
|
MultipartFile.fromFileSync("./example/upload.txt",
|
||||||
|
filename: "upload.txt"),
|
||||||
|
],
|
||||||
|
"data": jsonObj
|
||||||
|
});
|
||||||
|
final response = await Dio().post(
|
||||||
|
url,
|
||||||
|
data: jsonObj,
|
||||||
|
);
|
||||||
|
if (response.statusCode == 200) {
|
||||||
|
var map = response.data as Map;
|
||||||
|
print("result $map");
|
||||||
|
print('success');
|
||||||
|
if (map['status'] == 'Successfully registered') {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else if (response.statusCode != 200) {
|
||||||
|
var map = response.data as Map;
|
||||||
|
print("result $map");
|
||||||
|
//BotToast is a package for toasts available on pub.dev
|
||||||
|
// BotToast.showText(text: 'Validation Error Occurs');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} on DioException catch (error) {
|
||||||
|
log(error.message!);
|
||||||
|
|
||||||
|
throw 'Something Went Wrong';
|
||||||
|
} catch (_) {
|
||||||
|
log(_.toString());
|
||||||
|
throw 'Something Went Wrong';
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> getConfigData123() async {
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
final dio = Dio();
|
||||||
|
|
||||||
|
dio.httpClientAdapter = IOHttpClientAdapter(
|
||||||
|
createHttpClient: () {
|
||||||
|
// Don't trust any certificate just because their root cert is trusted.
|
||||||
|
final HttpClient client =
|
||||||
|
HttpClient(context: SecurityContext(withTrustedRoots: false));
|
||||||
|
// You can test the intermediate / root cert here. We just ignore it.
|
||||||
|
client.badCertificateCallback =
|
||||||
|
((X509Certificate cert, String host, int port) => true);
|
||||||
|
return client;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// final response = await dio.get('https://passvault.konectar.io/forms');
|
||||||
|
|
||||||
|
print("response123456");
|
||||||
|
// print(response.data.toString());
|
||||||
|
//log('${jsonEncode()}');
|
||||||
|
|
||||||
|
return {
|
||||||
|
"success": true,
|
||||||
|
"message": "New form generated",
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "form-pooja",
|
||||||
|
"name": "form-pooja1 demo",
|
||||||
|
"formtype": "Event",
|
||||||
|
"form-fields": [
|
||||||
|
{
|
||||||
|
"sectionName": "section0",
|
||||||
|
"multiple": false,
|
||||||
|
"sectionList": [
|
||||||
|
{
|
||||||
|
"name": "field_0_0",
|
||||||
|
"id": "field_0_0",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "checkbox",
|
||||||
|
"input": "radio",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_0_1",
|
||||||
|
"id": "field_0_1",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "dropdown",
|
||||||
|
"input": "checkbox",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_0_2",
|
||||||
|
"id": "field_0_2",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "text",
|
||||||
|
"input": "date",
|
||||||
|
"validation": {"isRequired": true}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"sectionName": "section1",
|
||||||
|
"multiple": true,
|
||||||
|
"sectionList": [
|
||||||
|
{
|
||||||
|
"name": "field_1_0",
|
||||||
|
"id": "field_1_0",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "multiselect",
|
||||||
|
"input": "number",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_1_1",
|
||||||
|
"id": "field_1_1",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "autocomplete",
|
||||||
|
"input": "checkbox",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_1_2",
|
||||||
|
"id": "field_1_2",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "checkbox",
|
||||||
|
"input": "dropdown",
|
||||||
|
"validation": {"isRequired": false},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_1_3",
|
||||||
|
"id": "field_1_3",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "checkbox",
|
||||||
|
"input": "date",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_1_4",
|
||||||
|
"id": "field_1_4",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "dropdown",
|
||||||
|
"input": "autocomplete",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> getConfigDataMedical() async {
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
final dio = Dio();
|
||||||
|
// (dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
||||||
|
// (HttpClient client) {
|
||||||
|
// client.badCertificateCallback =
|
||||||
|
// (X509Certificate cert, String host, int port) => true;
|
||||||
|
// return client;
|
||||||
|
// };
|
||||||
|
dio.httpClientAdapter = IOHttpClientAdapter(
|
||||||
|
createHttpClient: () {
|
||||||
|
// Don't trust any certificate just because their root cert is trusted.
|
||||||
|
final HttpClient client =
|
||||||
|
HttpClient(context: SecurityContext(withTrustedRoots: false));
|
||||||
|
// You can test the intermediate / root cert here. We just ignore it.
|
||||||
|
client.badCertificateCallback =
|
||||||
|
((X509Certificate cert, String host, int port) => true);
|
||||||
|
return client;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// final response = await dio.get('https://passvault.konectar.io/forms');
|
||||||
|
|
||||||
|
print("response123456");
|
||||||
|
// print(response.data.toString());
|
||||||
|
//log('${jsonEncode()}');
|
||||||
|
|
||||||
|
return {
|
||||||
|
"success": true,
|
||||||
|
"message": "New form generated",
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "form-med",
|
||||||
|
"name": "form-med demo",
|
||||||
|
"formtype": "Event",
|
||||||
|
"form-fields": [
|
||||||
|
{
|
||||||
|
"sectionName": "section0",
|
||||||
|
"multiple": false,
|
||||||
|
"sectionList": [
|
||||||
|
{
|
||||||
|
"name": "field_0_0",
|
||||||
|
"id": "field_0_0",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "checkbox",
|
||||||
|
"input": "radio",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_0_1",
|
||||||
|
"id": "field_0_1",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "dropdown",
|
||||||
|
"input": "checkbox",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_0_2",
|
||||||
|
"id": "field_0_2",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "text",
|
||||||
|
"input": "date",
|
||||||
|
"validation": {"isRequired": true}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<dynamic> getConfigDataEng() async {
|
||||||
|
// final dio = Dio(BaseOptions());
|
||||||
|
final dio = Dio();
|
||||||
|
// (dio.httpClientAdapter as IOHttpClientAdapter).onHttpClientCreate =
|
||||||
|
// (HttpClient client) {
|
||||||
|
// client.badCertificateCallback =
|
||||||
|
// (X509Certificate cert, String host, int port) => true;
|
||||||
|
// return client;
|
||||||
|
// };
|
||||||
|
|
||||||
|
dio.httpClientAdapter = IOHttpClientAdapter(
|
||||||
|
createHttpClient: () {
|
||||||
|
// Don't trust any certificate just because their root cert is trusted.
|
||||||
|
final HttpClient client =
|
||||||
|
HttpClient(context: SecurityContext(withTrustedRoots: false));
|
||||||
|
// You can test the intermediate / root cert here. We just ignore it.
|
||||||
|
client.badCertificateCallback =
|
||||||
|
((X509Certificate cert, String host, int port) => true);
|
||||||
|
return client;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
// final response = await dio.get('https://passvault.konectar.io/forms');
|
||||||
|
|
||||||
|
print("response123456");
|
||||||
|
// print(response.data.toString());
|
||||||
|
//log('${jsonEncode()}');
|
||||||
|
|
||||||
|
return {
|
||||||
|
"success": true,
|
||||||
|
"message": "New form generated",
|
||||||
|
"data": [
|
||||||
|
{
|
||||||
|
"id": "form-eng",
|
||||||
|
"name": "form-eng demo",
|
||||||
|
"formtype": "Event",
|
||||||
|
"form-fields": [
|
||||||
|
{
|
||||||
|
"sectionName": "section0",
|
||||||
|
"multiple": false,
|
||||||
|
"sectionList": [
|
||||||
|
{
|
||||||
|
"name": "field_0_0",
|
||||||
|
"id": "field_0_0",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "checkbox",
|
||||||
|
"input": "radio",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_0_1",
|
||||||
|
"id": "field_0_1",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "dropdown",
|
||||||
|
"input": "checkbox",
|
||||||
|
"validation": {"isRequired": true},
|
||||||
|
"inputList": [
|
||||||
|
{"id": "1", "name": "Option 1"},
|
||||||
|
{"id": "2", "name": "Option 2"},
|
||||||
|
{"id": "3", "name": "Option 3"},
|
||||||
|
{"id": "4", "name": "Option 4"},
|
||||||
|
{"id": "5", "name": "Option 5"},
|
||||||
|
{"id": "6", "name": "Option 6"},
|
||||||
|
{"id": "7", "name": "Option 7"}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "field_0_2",
|
||||||
|
"id": "field_0_2",
|
||||||
|
"depid": "",
|
||||||
|
"widget": "text",
|
||||||
|
"input": "date",
|
||||||
|
"validation": {"isRequired": true}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// "sectionName": "HCP",
|
||||||
|
// "multiple": true,
|
||||||
|
// "sectionList": [
|
||||||
|
// {
|
||||||
|
// "name": "name",
|
||||||
|
// "id": "field_0_2",
|
||||||
|
// "depid": "pooja",
|
||||||
|
// "widget": "text",
|
||||||
|
// "input": "text1",
|
||||||
|
// "validation": {"isRequired": true}
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "Role",
|
||||||
|
// "id": "field_0_1",
|
||||||
|
// "depid": "",
|
||||||
|
// "widget": "dropdown",
|
||||||
|
// "input": "checkbox",
|
||||||
|
// "validation": {"isRequired": true},
|
||||||
|
// "inputList": [
|
||||||
|
// {"id": "1", "name": "Option 1"},
|
||||||
|
// {"id": "2", "name": "Option 2"},
|
||||||
|
// {"id": "3", "name": "Option 3"},
|
||||||
|
// {"id": "4", "name": "Option 4"},
|
||||||
|
// {"id": "5", "name": "Option 5"},
|
||||||
|
// {"id": "6", "name": "Option 6"},
|
||||||
|
// {"id": "7", "name": "Option 7"}
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "Attended",
|
||||||
|
// "id": "field_0_1",
|
||||||
|
// "depid": "",
|
||||||
|
// "widget": "dropdown",
|
||||||
|
// "input": "checkbox",
|
||||||
|
// "validation": {"isRequired": true},
|
||||||
|
// "inputList": [
|
||||||
|
// {"id": "1", "name": "Option 1"},
|
||||||
|
// {"id": "2", "name": "Option 2"},
|
||||||
|
// {"id": "3", "name": "Option 3"},
|
||||||
|
// {"id": "4", "name": "Option 4"},
|
||||||
|
// {"id": "5", "name": "Option 5"},
|
||||||
|
// {"id": "6", "name": "Option 6"},
|
||||||
|
// {"id": "7", "name": "Option 7"}
|
||||||
|
// ]
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "Honorarium",
|
||||||
|
// "id": "field_0_2",
|
||||||
|
// "depid": "",
|
||||||
|
// "widget": "text",
|
||||||
|
// "input": "date",
|
||||||
|
// "validation": {"isRequired": true}
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "created by",
|
||||||
|
// "id": "field_0_2",
|
||||||
|
// "depid": "poojatk",
|
||||||
|
// "widget": "text",
|
||||||
|
// "input": "text1",
|
||||||
|
// "validation": {"isRequired": true}
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// "name": "created on",
|
||||||
|
// "id": "field_0_2",
|
||||||
|
// "depid": "13/05/2024",
|
||||||
|
// "widget": "text",
|
||||||
|
// "input": "text1",
|
||||||
|
// "validation": {"isRequired": true}
|
||||||
|
// },
|
||||||
|
// // {
|
||||||
|
// // "name": "field_0_0",
|
||||||
|
// // "id": "field_0_0",
|
||||||
|
// // "depid": "",
|
||||||
|
// // "widget": "checkbox",
|
||||||
|
// // "input": "radio",
|
||||||
|
// // "validation": {"isRequired": true},
|
||||||
|
// // "inputList": [
|
||||||
|
// // {"id": "1", "name": "Option 1"},
|
||||||
|
// // {"id": "2", "name": "Option 2"},
|
||||||
|
// // {"id": "3", "name": "Option 3"},
|
||||||
|
// // {"id": "4", "name": "Option 4"},
|
||||||
|
// // {"id": "5", "name": "Option 5"},
|
||||||
|
// // {"id": "6", "name": "Option 6"},
|
||||||
|
// // {"id": "7", "name": "Option 7"}
|
||||||
|
// // ]
|
||||||
|
// // },
|
||||||
|
// // {
|
||||||
|
// // "name": "field_0_2",
|
||||||
|
// // "id": "field_0_2",
|
||||||
|
// // "depid": "",
|
||||||
|
// // "widget": "text",
|
||||||
|
// // "input": "date",
|
||||||
|
// // "validation": {"isRequired": true}
|
||||||
|
// // }
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,121 @@
|
||||||
|
// import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
// import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
// // import 'package:pwa_ios/model/interaction_data.dart';
|
||||||
|
|
||||||
|
// part 'interaction_config_data.g.dart';
|
||||||
|
|
||||||
|
// class UIDataResponse {
|
||||||
|
// bool success;
|
||||||
|
// String message;
|
||||||
|
|
||||||
|
// List<FormFieldData> formFields;
|
||||||
|
|
||||||
|
// UIDataResponse({
|
||||||
|
// required this.success,
|
||||||
|
// required this.message,
|
||||||
|
// required this.formFields,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// factory UIDataResponse.fromJson(Map<String, dynamic> json) => UIDataResponse(
|
||||||
|
// success: json["success"],
|
||||||
|
// message: json["message"],
|
||||||
|
// formFields: List<FormFieldData>.from(
|
||||||
|
// json["data"].map((x) => FormFieldData.fromJson(x))),
|
||||||
|
// );
|
||||||
|
|
||||||
|
// Map<String, dynamic> toJson() => {
|
||||||
|
// "success": success,
|
||||||
|
// "message": message,
|
||||||
|
// "form-fields": List<dynamic>.from(formFields.map((x) => x.toJson())),
|
||||||
|
// };
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// String toString() {
|
||||||
|
// // TODO: implement toString
|
||||||
|
// return List<dynamic>.from(formFields.map((x) => x.toJson())).toString();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @HiveType(typeId: 19)
|
||||||
|
// class InteractionConfigData {
|
||||||
|
// @HiveField(1)
|
||||||
|
// InteractionResultData widgets;
|
||||||
|
// @HiveField(2)
|
||||||
|
// String id;
|
||||||
|
// @HiveField(3)
|
||||||
|
// String name;
|
||||||
|
|
||||||
|
// InteractionConfigData({
|
||||||
|
// required this.widgets,
|
||||||
|
// required this.id,
|
||||||
|
// required this.name,
|
||||||
|
// });
|
||||||
|
|
||||||
|
// Map<String, dynamic> toJson() => {"widgets": widgets};
|
||||||
|
// }
|
||||||
|
|
||||||
|
//pooja
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
// import 'package:pwa_ios/model/interaction_data.dart';
|
||||||
|
|
||||||
|
part 'interaction_config_data.g.dart';
|
||||||
|
|
||||||
|
class UIDataResponse {
|
||||||
|
bool success;
|
||||||
|
String message;
|
||||||
|
|
||||||
|
List<FormFieldData> formFields;
|
||||||
|
|
||||||
|
String? formtype;
|
||||||
|
|
||||||
|
UIDataResponse({
|
||||||
|
required this.success,
|
||||||
|
required this.message,
|
||||||
|
required this.formFields,
|
||||||
|
this.formtype,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory UIDataResponse.fromJson(Map<String, dynamic> json) => UIDataResponse(
|
||||||
|
success: json["success"],
|
||||||
|
message: json["message"],
|
||||||
|
formtype: json["formtype"],
|
||||||
|
formFields: List<FormFieldData>.from(
|
||||||
|
json["data"].map((x) => FormFieldData.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"success": success,
|
||||||
|
"message": message,
|
||||||
|
"formtype": formtype,
|
||||||
|
"form-fields": List<dynamic>.from(formFields.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
// TODO: implement toString
|
||||||
|
return List<dynamic>.from(formFields.map((x) => x.toJson())).toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 19)
|
||||||
|
class InteractionConfigData {
|
||||||
|
@HiveField(1)
|
||||||
|
InteractionResultData widgets;
|
||||||
|
@HiveField(2)
|
||||||
|
String id;
|
||||||
|
@HiveField(3)
|
||||||
|
String name;
|
||||||
|
@HiveField(4)
|
||||||
|
String? formtype;
|
||||||
|
|
||||||
|
InteractionConfigData({
|
||||||
|
required this.widgets,
|
||||||
|
required this.id,
|
||||||
|
required this.name,
|
||||||
|
this.formtype,
|
||||||
|
});
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {"widgets": widgets};
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'interaction_config_data.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class InteractionConfigDataAdapter extends TypeAdapter<InteractionConfigData> {
|
||||||
|
@override
|
||||||
|
final int typeId = 19;
|
||||||
|
|
||||||
|
@override
|
||||||
|
InteractionConfigData read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return InteractionConfigData(
|
||||||
|
widgets: fields[1] as InteractionResultData,
|
||||||
|
id: fields[2] as String,
|
||||||
|
name: fields[3] as String,
|
||||||
|
formtype: fields[4] as String?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, InteractionConfigData obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(4)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.widgets)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.name)
|
||||||
|
..writeByte(4)
|
||||||
|
..write(obj.formtype);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is InteractionConfigDataAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
// // GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
// part of 'interaction_config_data.dart';
|
||||||
|
|
||||||
|
// // **************************************************************************
|
||||||
|
// // TypeAdapterGenerator
|
||||||
|
// // **************************************************************************
|
||||||
|
|
||||||
|
// class InteractionConfigDataAdapter extends TypeAdapter<InteractionConfigData> {
|
||||||
|
// @override
|
||||||
|
// final int typeId = 19;
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// InteractionConfigData read(BinaryReader reader) {
|
||||||
|
// final numOfFields = reader.readByte();
|
||||||
|
// final fields = <int, dynamic>{
|
||||||
|
// for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
// };
|
||||||
|
// return InteractionConfigData(
|
||||||
|
// widgets: fields[1] as InteractionResultData,
|
||||||
|
// id: fields[2] as String,
|
||||||
|
// name: fields[3] as String,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// void write(BinaryWriter writer, InteractionConfigData obj) {
|
||||||
|
// writer
|
||||||
|
// ..writeByte(3)
|
||||||
|
// ..writeByte(1)
|
||||||
|
// ..write(obj.widgets)
|
||||||
|
// ..writeByte(2)
|
||||||
|
// ..write(obj.id)
|
||||||
|
// ..writeByte(3)
|
||||||
|
// ..write(obj.name);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
// @override
|
||||||
|
// bool operator ==(Object other) =>
|
||||||
|
// identical(this, other) ||
|
||||||
|
// other is InteractionConfigDataAdapter &&
|
||||||
|
// runtimeType == other.runtimeType &&
|
||||||
|
// typeId == other.typeId;
|
||||||
|
// }
|
|
@ -0,0 +1,334 @@
|
||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final welcome = welcomeFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
part 'interaction_data.g.dart';
|
||||||
|
|
||||||
|
// InteractionResultData welcomeFromJson(String str) =>
|
||||||
|
// InteractionResultData.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
// String welcomeToJson(InteractionResultData data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
ResponseData ResponseDataFromJson(Map<String, dynamic> str) =>
|
||||||
|
ResponseData.fromJson(str);
|
||||||
|
|
||||||
|
String ResponseDataToJson(ResponseData data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class ResponseData {
|
||||||
|
List<InteractionResultData> data;
|
||||||
|
|
||||||
|
ResponseData({
|
||||||
|
required this.data,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory ResponseData.fromJson(Map<String, dynamic> json) => ResponseData(
|
||||||
|
data: List<InteractionResultData>.from(
|
||||||
|
json["data"].map((x) => InteractionResultData.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"data": List<dynamic>.from(data.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 11)
|
||||||
|
class InteractionResultData {
|
||||||
|
@HiveField(0)
|
||||||
|
List<FormFieldData> result;
|
||||||
|
@HiveField(1)
|
||||||
|
String id;
|
||||||
|
@HiveField(2)
|
||||||
|
String name;
|
||||||
|
InteractionResultData(
|
||||||
|
{required this.result, required this.id, required this.name});
|
||||||
|
|
||||||
|
factory InteractionResultData.fromJson(Map<String, dynamic> json) =>
|
||||||
|
InteractionResultData(
|
||||||
|
result: List<FormFieldData>.from(
|
||||||
|
json["form-fields"].map((x) => FormFieldData.fromJson(x))),
|
||||||
|
id: json["id"],
|
||||||
|
name: json["name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"name": name,
|
||||||
|
"result": List<dynamic>.from(result.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
|
||||||
|
Map<String, dynamic> saveToJson() => {
|
||||||
|
"save": List<dynamic>.from(result.map((x) => x.saveToJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 4)
|
||||||
|
class FormFieldData {
|
||||||
|
@HiveField(0)
|
||||||
|
String sectionName;
|
||||||
|
@HiveField(1)
|
||||||
|
bool multiple;
|
||||||
|
@HiveField(2)
|
||||||
|
List<SectionList> sectionList;
|
||||||
|
@HiveField(3)
|
||||||
|
List<SectionList>? multipleList;
|
||||||
|
|
||||||
|
FormFieldData({
|
||||||
|
required this.sectionName,
|
||||||
|
required this.multiple,
|
||||||
|
required this.sectionList,
|
||||||
|
this.multipleList,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory FormFieldData.fromJson(Map<String, dynamic> json) => FormFieldData(
|
||||||
|
sectionName: json["sectionName"],
|
||||||
|
multiple: json["multiple"],
|
||||||
|
sectionList: List<SectionList>.from(
|
||||||
|
json["sectionList"].map((x) => SectionList.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"sectionName": sectionName,
|
||||||
|
"multiple": multiple,
|
||||||
|
"sectionList": List<dynamic>.from(sectionList.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
Map<String, dynamic> saveToJson() => {
|
||||||
|
"sectionName": sectionName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 5)
|
||||||
|
class SectionList {
|
||||||
|
@HiveField(0)
|
||||||
|
String name;
|
||||||
|
@HiveField(1)
|
||||||
|
String? param;
|
||||||
|
@HiveField(2)
|
||||||
|
String id;
|
||||||
|
@HiveField(3)
|
||||||
|
int? gid;
|
||||||
|
@HiveField(4)
|
||||||
|
List<dynamic>? selectedValue;
|
||||||
|
@HiveField(5)
|
||||||
|
String? depid;
|
||||||
|
@HiveField(6)
|
||||||
|
InteractionWidget? widget;
|
||||||
|
@HiveField(7)
|
||||||
|
String? input;
|
||||||
|
@HiveField(8)
|
||||||
|
List<InputClass>? inputList;
|
||||||
|
@HiveField(9)
|
||||||
|
bool? isRequired;
|
||||||
|
|
||||||
|
TextEditingController? controller;
|
||||||
|
@HiveField(10)
|
||||||
|
String? value;
|
||||||
|
@HiveField(11)
|
||||||
|
String? selectedId;
|
||||||
|
@HiveField(12)
|
||||||
|
InputClass? selectedObject;
|
||||||
|
@HiveField(13)
|
||||||
|
Validation? validation;
|
||||||
|
@HiveField(14)
|
||||||
|
String? chars;
|
||||||
|
@HiveField(15)
|
||||||
|
List<dynamic>? extension;
|
||||||
|
@HiveField(16)
|
||||||
|
List<dynamic>? fileName;
|
||||||
|
@HiveField(17)
|
||||||
|
List<dynamic>? tempselectedValue;
|
||||||
|
@HiveField(18)
|
||||||
|
String? max;
|
||||||
|
@HiveField(19)
|
||||||
|
String? min;
|
||||||
|
|
||||||
|
SectionList(
|
||||||
|
{required this.name,
|
||||||
|
this.param,
|
||||||
|
required this.id,
|
||||||
|
this.selectedValue,
|
||||||
|
this.depid,
|
||||||
|
this.widget,
|
||||||
|
this.input,
|
||||||
|
this.gid,
|
||||||
|
this.inputList,
|
||||||
|
this.isRequired,
|
||||||
|
this.controller,
|
||||||
|
this.selectedObject,
|
||||||
|
this.selectedId,
|
||||||
|
this.validation,
|
||||||
|
this.chars,
|
||||||
|
this.extension,
|
||||||
|
this.fileName,
|
||||||
|
this.tempselectedValue,
|
||||||
|
this.max,
|
||||||
|
this.min,
|
||||||
|
this.value});
|
||||||
|
|
||||||
|
factory SectionList.fromJson(Map<String, dynamic> json) => SectionList(
|
||||||
|
name: json["name"],
|
||||||
|
// param: json["param"],
|
||||||
|
id: json["id"],
|
||||||
|
// selectedValue: List<dynamic>.from(json["selectedValue"].map((x) => x)),
|
||||||
|
depid: json["depid"],
|
||||||
|
widget: widgetValues.map[json["widget"]]!,
|
||||||
|
input: json["input"],
|
||||||
|
inputList: json["inputList"] == null
|
||||||
|
? []
|
||||||
|
: List<InputClass>.from(
|
||||||
|
json["inputList"]!.map((x) => InputClass.fromJson(x))),
|
||||||
|
|
||||||
|
validation: Validation.fromJson(json["validation"]),
|
||||||
|
|
||||||
|
// chars: json["chars"],
|
||||||
|
max: json["max"],
|
||||||
|
min: json["min"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"name": name,
|
||||||
|
"param": param,
|
||||||
|
"id": id,
|
||||||
|
"selectedValue": List<dynamic>.from(selectedValue!.map((x) => x)),
|
||||||
|
"depid": depid,
|
||||||
|
"widget": widgetValues.reverse[widget],
|
||||||
|
"input": input,
|
||||||
|
"inputList": inputList == null
|
||||||
|
? []
|
||||||
|
: List<dynamic>.from(inputList!.map((x) => x.toJson())),
|
||||||
|
"isRequired": isRequired,
|
||||||
|
"chars": chars,
|
||||||
|
"fileName": List<dynamic>.from(fileName!.map((x) => x)),
|
||||||
|
"extension": List<dynamic>.from(extension!.map((x) => x)),
|
||||||
|
"max": max,
|
||||||
|
"min": min,
|
||||||
|
};
|
||||||
|
Map<String, dynamic> saveToJson() => {
|
||||||
|
"name": name,
|
||||||
|
"param": param,
|
||||||
|
"id": id,
|
||||||
|
"selectedValue": List<dynamic>.from(selectedValue!.map((x) => x)),
|
||||||
|
};
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
// TODO: implement toString
|
||||||
|
return name.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 6)
|
||||||
|
class InputClass {
|
||||||
|
@HiveField(0)
|
||||||
|
dynamic id;
|
||||||
|
@HiveField(1)
|
||||||
|
String name;
|
||||||
|
@HiveField(2)
|
||||||
|
bool? ischecked;
|
||||||
|
@HiveField(3)
|
||||||
|
String? selectedId;
|
||||||
|
@HiveField(4)
|
||||||
|
String? selectedName;
|
||||||
|
@HiveField(5)
|
||||||
|
List<String>? selectedItems;
|
||||||
|
@HiveField(6)
|
||||||
|
String? pid;
|
||||||
|
InputClass(
|
||||||
|
{required this.id,
|
||||||
|
required this.name,
|
||||||
|
this.ischecked,
|
||||||
|
this.pid,
|
||||||
|
this.selectedId,
|
||||||
|
this.selectedItems,
|
||||||
|
this.selectedName});
|
||||||
|
|
||||||
|
factory InputClass.fromJson(Map<String, dynamic> json) => InputClass(
|
||||||
|
id: json["id"],
|
||||||
|
name: json["name"],
|
||||||
|
pid: json["pid"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {"id": id, "name": name, "pid": pid};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 18)
|
||||||
|
class Validation {
|
||||||
|
@HiveField(0)
|
||||||
|
bool isRequired;
|
||||||
|
@HiveField(1)
|
||||||
|
bool? multipleFiles;
|
||||||
|
@HiveField(2)
|
||||||
|
String? type;
|
||||||
|
@HiveField(3)
|
||||||
|
String? chars;
|
||||||
|
|
||||||
|
Validation({
|
||||||
|
required this.isRequired,
|
||||||
|
this.multipleFiles,
|
||||||
|
this.type,
|
||||||
|
this.chars,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Validation.fromJson(Map<String, dynamic> json) => Validation(
|
||||||
|
isRequired: json["isRequired"],
|
||||||
|
multipleFiles: json["multipleFiles"],
|
||||||
|
type: json["type"],
|
||||||
|
chars: json["chars"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"isRequired": isRequired,
|
||||||
|
"multipleFiles": multipleFiles,
|
||||||
|
"type": type,
|
||||||
|
"chars": chars,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 12)
|
||||||
|
enum InteractionWidget {
|
||||||
|
@HiveField(0)
|
||||||
|
CHECKBOX,
|
||||||
|
@HiveField(1)
|
||||||
|
DROPDOWN,
|
||||||
|
@HiveField(2)
|
||||||
|
LABEL,
|
||||||
|
@HiveField(3)
|
||||||
|
RADIO,
|
||||||
|
@HiveField(4)
|
||||||
|
TEXT,
|
||||||
|
@HiveField(5)
|
||||||
|
BUTTON,
|
||||||
|
@HiveField(6)
|
||||||
|
AUTOCOMPLETE,
|
||||||
|
@HiveField(7)
|
||||||
|
MULTISELECT,
|
||||||
|
@HiveField(8)
|
||||||
|
RANGESLIDER
|
||||||
|
}
|
||||||
|
|
||||||
|
final widgetValues = EnumValues({
|
||||||
|
"checkbox": InteractionWidget.CHECKBOX,
|
||||||
|
"dropdown": InteractionWidget.DROPDOWN,
|
||||||
|
"label": InteractionWidget.LABEL,
|
||||||
|
"radio": InteractionWidget.DROPDOWN,
|
||||||
|
"text": InteractionWidget.TEXT,
|
||||||
|
"button": InteractionWidget.BUTTON,
|
||||||
|
"autocomplete": InteractionWidget.AUTOCOMPLETE,
|
||||||
|
"multiselect": InteractionWidget.MULTISELECT,
|
||||||
|
"rangeslider": InteractionWidget.RANGESLIDER
|
||||||
|
});
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
|
||||||
|
late Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
reverseMap = map.map((k, v) => MapEntry(v, k));
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,350 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'interaction_data.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class InteractionResultDataAdapter extends TypeAdapter<InteractionResultData> {
|
||||||
|
@override
|
||||||
|
final int typeId = 11;
|
||||||
|
|
||||||
|
@override
|
||||||
|
InteractionResultData read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return InteractionResultData(
|
||||||
|
result: (fields[0] as List).cast<FormFieldData>(),
|
||||||
|
id: fields[1] as String,
|
||||||
|
name: fields[2] as String,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, InteractionResultData obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(3)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.result)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is InteractionResultDataAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class FormFieldDataAdapter extends TypeAdapter<FormFieldData> {
|
||||||
|
@override
|
||||||
|
final int typeId = 4;
|
||||||
|
|
||||||
|
@override
|
||||||
|
FormFieldData read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return FormFieldData(
|
||||||
|
sectionName: fields[0] as String,
|
||||||
|
multiple: fields[1] as bool,
|
||||||
|
sectionList: (fields[2] as List).cast<SectionList>(),
|
||||||
|
multipleList: (fields[3] as List?)?.cast<SectionList>(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, FormFieldData obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(4)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.sectionName)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.multiple)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.sectionList)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.multipleList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is FormFieldDataAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SectionListAdapter extends TypeAdapter<SectionList> {
|
||||||
|
@override
|
||||||
|
final int typeId = 5;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SectionList read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return SectionList(
|
||||||
|
name: fields[0] as String,
|
||||||
|
param: fields[1] as String?,
|
||||||
|
id: fields[2] as String,
|
||||||
|
selectedValue: (fields[4] as List?)?.cast<dynamic>(),
|
||||||
|
depid: fields[5] as String?,
|
||||||
|
widget: fields[6] as InteractionWidget?,
|
||||||
|
input: fields[7] as String?,
|
||||||
|
gid: fields[3] as int?,
|
||||||
|
inputList: (fields[8] as List?)?.cast<InputClass>(),
|
||||||
|
isRequired: fields[9] as bool?,
|
||||||
|
selectedObject: fields[12] as InputClass?,
|
||||||
|
selectedId: fields[11] as String?,
|
||||||
|
validation: fields[13] as Validation?,
|
||||||
|
chars: fields[14] as String?,
|
||||||
|
extension: (fields[15] as List?)?.cast<dynamic>(),
|
||||||
|
fileName: (fields[16] as List?)?.cast<dynamic>(),
|
||||||
|
tempselectedValue: (fields[17] as List?)?.cast<dynamic>(),
|
||||||
|
max: fields[18] as String?,
|
||||||
|
min: fields[19] as String?,
|
||||||
|
value: fields[10] as String?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, SectionList obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(20)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.name)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.param)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.gid)
|
||||||
|
..writeByte(4)
|
||||||
|
..write(obj.selectedValue)
|
||||||
|
..writeByte(5)
|
||||||
|
..write(obj.depid)
|
||||||
|
..writeByte(6)
|
||||||
|
..write(obj.widget)
|
||||||
|
..writeByte(7)
|
||||||
|
..write(obj.input)
|
||||||
|
..writeByte(8)
|
||||||
|
..write(obj.inputList)
|
||||||
|
..writeByte(9)
|
||||||
|
..write(obj.isRequired)
|
||||||
|
..writeByte(10)
|
||||||
|
..write(obj.value)
|
||||||
|
..writeByte(11)
|
||||||
|
..write(obj.selectedId)
|
||||||
|
..writeByte(12)
|
||||||
|
..write(obj.selectedObject)
|
||||||
|
..writeByte(13)
|
||||||
|
..write(obj.validation)
|
||||||
|
..writeByte(14)
|
||||||
|
..write(obj.chars)
|
||||||
|
..writeByte(15)
|
||||||
|
..write(obj.extension)
|
||||||
|
..writeByte(16)
|
||||||
|
..write(obj.fileName)
|
||||||
|
..writeByte(17)
|
||||||
|
..write(obj.tempselectedValue)
|
||||||
|
..writeByte(18)
|
||||||
|
..write(obj.max)
|
||||||
|
..writeByte(19)
|
||||||
|
..write(obj.min);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SectionListAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class InputClassAdapter extends TypeAdapter<InputClass> {
|
||||||
|
@override
|
||||||
|
final int typeId = 6;
|
||||||
|
|
||||||
|
@override
|
||||||
|
InputClass read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return InputClass(
|
||||||
|
id: fields[0] as dynamic,
|
||||||
|
name: fields[1] as String,
|
||||||
|
ischecked: fields[2] as bool?,
|
||||||
|
pid: fields[6] as String?,
|
||||||
|
selectedId: fields[3] as String?,
|
||||||
|
selectedItems: (fields[5] as List?)?.cast<String>(),
|
||||||
|
selectedName: fields[4] as String?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, InputClass obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(7)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.name)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.ischecked)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.selectedId)
|
||||||
|
..writeByte(4)
|
||||||
|
..write(obj.selectedName)
|
||||||
|
..writeByte(5)
|
||||||
|
..write(obj.selectedItems)
|
||||||
|
..writeByte(6)
|
||||||
|
..write(obj.pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is InputClassAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class ValidationAdapter extends TypeAdapter<Validation> {
|
||||||
|
@override
|
||||||
|
final int typeId = 18;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Validation read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return Validation(
|
||||||
|
isRequired: fields[0] as bool,
|
||||||
|
multipleFiles: fields[1] as bool?,
|
||||||
|
type: fields[2] as String?,
|
||||||
|
chars: fields[3] as String?,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, Validation obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(4)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.isRequired)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.multipleFiles)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.type)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.chars);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is ValidationAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class InteractionWidgetAdapter extends TypeAdapter<InteractionWidget> {
|
||||||
|
@override
|
||||||
|
final int typeId = 12;
|
||||||
|
|
||||||
|
@override
|
||||||
|
InteractionWidget read(BinaryReader reader) {
|
||||||
|
switch (reader.readByte()) {
|
||||||
|
case 0:
|
||||||
|
return InteractionWidget.CHECKBOX;
|
||||||
|
case 1:
|
||||||
|
return InteractionWidget.DROPDOWN;
|
||||||
|
case 2:
|
||||||
|
return InteractionWidget.LABEL;
|
||||||
|
case 3:
|
||||||
|
return InteractionWidget.RADIO;
|
||||||
|
case 4:
|
||||||
|
return InteractionWidget.TEXT;
|
||||||
|
case 5:
|
||||||
|
return InteractionWidget.BUTTON;
|
||||||
|
case 6:
|
||||||
|
return InteractionWidget.AUTOCOMPLETE;
|
||||||
|
case 7:
|
||||||
|
return InteractionWidget.MULTISELECT;
|
||||||
|
case 8:
|
||||||
|
return InteractionWidget.RANGESLIDER;
|
||||||
|
default:
|
||||||
|
return InteractionWidget.CHECKBOX;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, InteractionWidget obj) {
|
||||||
|
switch (obj) {
|
||||||
|
case InteractionWidget.CHECKBOX:
|
||||||
|
writer.writeByte(0);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.DROPDOWN:
|
||||||
|
writer.writeByte(1);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.LABEL:
|
||||||
|
writer.writeByte(2);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.RADIO:
|
||||||
|
writer.writeByte(3);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.TEXT:
|
||||||
|
writer.writeByte(4);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.BUTTON:
|
||||||
|
writer.writeByte(5);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.AUTOCOMPLETE:
|
||||||
|
writer.writeByte(6);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.MULTISELECT:
|
||||||
|
writer.writeByte(7);
|
||||||
|
break;
|
||||||
|
case InteractionWidget.RANGESLIDER:
|
||||||
|
writer.writeByte(8);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is InteractionWidgetAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
|
@ -0,0 +1,135 @@
|
||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final saveInteractionFormJson = saveInteractionFormJsonFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
part 'json_form_data.g.dart';
|
||||||
|
|
||||||
|
SaveInteractionFormJson saveInteractionFormJsonFromJson(String str) =>
|
||||||
|
SaveInteractionFormJson.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String saveInteractionFormJsonToJson(DataJson data) =>
|
||||||
|
json.encode(data.toJson());
|
||||||
|
|
||||||
|
String saveFormJsonToJson(SendSaveJson data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class DataJson {
|
||||||
|
SendSaveJson sendSaveJson;
|
||||||
|
DataJson({required this.sendSaveJson});
|
||||||
|
factory DataJson.fromJson(Map<String, dynamic> json) => DataJson(
|
||||||
|
sendSaveJson: json["data"],
|
||||||
|
);
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"data": sendSaveJson,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 14)
|
||||||
|
class SendSaveJson {
|
||||||
|
@HiveField(0)
|
||||||
|
List<SaveInteractionFormJson> savedList;
|
||||||
|
SendSaveJson({required this.savedList});
|
||||||
|
factory SendSaveJson.fromJson(Map<String, dynamic> json) => SendSaveJson(
|
||||||
|
savedList: List<SaveInteractionFormJson>.from(
|
||||||
|
json["data"].map((x) => SaveInteractionFormJson.fromJson(x))),
|
||||||
|
);
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"data": List<dynamic>.from(savedList.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 15)
|
||||||
|
class SaveInteractionFormJson {
|
||||||
|
@HiveField(0)
|
||||||
|
String interactionForm1;
|
||||||
|
@HiveField(1)
|
||||||
|
String intId;
|
||||||
|
@HiveField(2)
|
||||||
|
String intName;
|
||||||
|
@HiveField(3)
|
||||||
|
List<Save> save;
|
||||||
|
|
||||||
|
SaveInteractionFormJson({
|
||||||
|
required this.interactionForm1,
|
||||||
|
required this.intId,
|
||||||
|
required this.intName,
|
||||||
|
required this.save,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SaveInteractionFormJson.fromJson(Map<String, dynamic> json) =>
|
||||||
|
SaveInteractionFormJson(
|
||||||
|
interactionForm1: json["Interaction-form1"],
|
||||||
|
intId: json["intId"],
|
||||||
|
intName: json["intName"],
|
||||||
|
save: List<Save>.from(json["data"].map((x) => Save.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": intId,
|
||||||
|
"page": intName,
|
||||||
|
"data": List<dynamic>.from(save.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 16)
|
||||||
|
class Save {
|
||||||
|
@HiveField(0)
|
||||||
|
String sectionName;
|
||||||
|
@HiveField(1)
|
||||||
|
List<List<MultipleSectionList>> multipleSectionList;
|
||||||
|
|
||||||
|
Save({
|
||||||
|
required this.sectionName,
|
||||||
|
required this.multipleSectionList,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Save.fromJson(Map<String, dynamic> json) => Save(
|
||||||
|
sectionName: json["sectionName"],
|
||||||
|
multipleSectionList: List<List<MultipleSectionList>>.from(
|
||||||
|
json["multipleSectionList"].map((x) =>
|
||||||
|
List<MultipleSectionList>.from(
|
||||||
|
x.map((x) => MultipleSectionList.fromJson(x))))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"sectionName": sectionName,
|
||||||
|
"multipleSectionList": List<dynamic>.from(multipleSectionList
|
||||||
|
.map((x) => List<dynamic>.from(x.map((x) => x.toJson())))),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 17)
|
||||||
|
class MultipleSectionList {
|
||||||
|
@HiveField(0)
|
||||||
|
String id;
|
||||||
|
@HiveField(1)
|
||||||
|
List<dynamic> selectedValue;
|
||||||
|
@HiveField(2)
|
||||||
|
List<dynamic>? fileName;
|
||||||
|
@HiveField(3)
|
||||||
|
List<dynamic>? extension;
|
||||||
|
|
||||||
|
MultipleSectionList(
|
||||||
|
{required this.id,
|
||||||
|
required this.selectedValue,
|
||||||
|
this.extension,
|
||||||
|
this.fileName});
|
||||||
|
|
||||||
|
factory MultipleSectionList.fromJson(Map<String, dynamic> json) =>
|
||||||
|
MultipleSectionList(
|
||||||
|
id: json["id"],
|
||||||
|
selectedValue: List<dynamic>.from(json["selectedValue"].map((x) => x)),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"selectedValue": List<dynamic>.from(selectedValue.map((x) => x)),
|
||||||
|
"extension": extension != null
|
||||||
|
? List<dynamic>.from(extension!.map((x) => x))
|
||||||
|
: [],
|
||||||
|
"fileName":
|
||||||
|
fileName != null ? List<dynamic>.from(fileName!.map((x) => x)) : [],
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,167 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'json_form_data.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class SendSaveJsonAdapter extends TypeAdapter<SendSaveJson> {
|
||||||
|
@override
|
||||||
|
final int typeId = 14;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SendSaveJson read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return SendSaveJson(
|
||||||
|
savedList: (fields[0] as List).cast<SaveInteractionFormJson>(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, SendSaveJson obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(1)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.savedList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SendSaveJsonAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SaveInteractionFormJsonAdapter
|
||||||
|
extends TypeAdapter<SaveInteractionFormJson> {
|
||||||
|
@override
|
||||||
|
final int typeId = 15;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SaveInteractionFormJson read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return SaveInteractionFormJson(
|
||||||
|
interactionForm1: fields[0] as String,
|
||||||
|
intId: fields[1] as String,
|
||||||
|
intName: fields[2] as String,
|
||||||
|
save: (fields[3] as List).cast<Save>(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, SaveInteractionFormJson obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(4)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.interactionForm1)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.intId)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.intName)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.save);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SaveInteractionFormJsonAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class SaveAdapter extends TypeAdapter<Save> {
|
||||||
|
@override
|
||||||
|
final int typeId = 16;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Save read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return Save(
|
||||||
|
sectionName: fields[0] as String,
|
||||||
|
multipleSectionList: (fields[1] as List)
|
||||||
|
.map((dynamic e) => (e as List).cast<MultipleSectionList>())
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, Save obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(2)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.sectionName)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.multipleSectionList);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SaveAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
||||||
|
|
||||||
|
class MultipleSectionListAdapter extends TypeAdapter<MultipleSectionList> {
|
||||||
|
@override
|
||||||
|
final int typeId = 17;
|
||||||
|
|
||||||
|
@override
|
||||||
|
MultipleSectionList read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return MultipleSectionList(
|
||||||
|
id: fields[0] as String,
|
||||||
|
selectedValue: (fields[1] as List).cast<dynamic>(),
|
||||||
|
extension: (fields[3] as List?)?.cast<dynamic>(),
|
||||||
|
fileName: (fields[2] as List?)?.cast<dynamic>(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, MultipleSectionList obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(4)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.selectedValue)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.fileName)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.extension);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is MultipleSectionListAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
|
@ -0,0 +1,122 @@
|
||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final welcome = welcomeFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
Locations welcomeFromJson(String str) => Locations.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String welcomeToJson(Locations data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class Locations {
|
||||||
|
Location location;
|
||||||
|
|
||||||
|
Locations({
|
||||||
|
required this.location,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Locations.fromJson(Map<String, dynamic> json) => Locations(
|
||||||
|
location: Location.fromJson(json["location"]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"location": location.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Location {
|
||||||
|
List<Country> country;
|
||||||
|
List<States> state;
|
||||||
|
List<City> city;
|
||||||
|
|
||||||
|
Location({
|
||||||
|
required this.country,
|
||||||
|
required this.state,
|
||||||
|
required this.city,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Location.fromJson(Map<String, dynamic> json) => Location(
|
||||||
|
country:
|
||||||
|
List<Country>.from(json["country"].map((x) => Country.fromJson(x))),
|
||||||
|
state: List<States>.from(json["state"].map((x) => States.fromJson(x))),
|
||||||
|
city: List<City>.from(json["city"].map((x) => City.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"country": List<dynamic>.from(country.map((x) => x.toJson())),
|
||||||
|
"state": List<dynamic>.from(state.map((x) => x.toJson())),
|
||||||
|
"city": List<dynamic>.from(city.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class City {
|
||||||
|
String cityName;
|
||||||
|
String distId;
|
||||||
|
String stateId;
|
||||||
|
String countryId;
|
||||||
|
|
||||||
|
City({
|
||||||
|
required this.cityName,
|
||||||
|
required this.distId,
|
||||||
|
required this.stateId,
|
||||||
|
required this.countryId,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory City.fromJson(Map<String, dynamic> json) => City(
|
||||||
|
cityName: json["cityName"],
|
||||||
|
distId: json["distId"],
|
||||||
|
stateId: json["stateId"],
|
||||||
|
countryId: json["countryId"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"cityName": cityName,
|
||||||
|
"distId": distId,
|
||||||
|
"stateId": stateId,
|
||||||
|
"countryId": countryId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Country {
|
||||||
|
String countryName;
|
||||||
|
String countryId;
|
||||||
|
|
||||||
|
Country({
|
||||||
|
required this.countryName,
|
||||||
|
required this.countryId,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory Country.fromJson(Map<String, dynamic> json) => Country(
|
||||||
|
countryName: json["countryName"],
|
||||||
|
countryId: json["countryId"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"countryName": countryName,
|
||||||
|
"countryId": countryId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class States {
|
||||||
|
String stateName;
|
||||||
|
String stateId;
|
||||||
|
String countryId;
|
||||||
|
|
||||||
|
States({
|
||||||
|
required this.stateName,
|
||||||
|
required this.stateId,
|
||||||
|
required this.countryId,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory States.fromJson(Map<String, dynamic> json) => States(
|
||||||
|
stateName: json["stateName"],
|
||||||
|
stateId: json["stateId"],
|
||||||
|
countryId: json["countryId"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"stateName": stateName,
|
||||||
|
"stateId": stateId,
|
||||||
|
"countryId": countryId,
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,144 @@
|
||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final welcome = welcomeFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
// import 'package:pwa_ios/model/interaction_data.dart';
|
||||||
|
part 'save_interaction.g.dart';
|
||||||
|
|
||||||
|
SaveInteraction welcomeFromJson(String str) =>
|
||||||
|
SaveInteraction.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String welcomeToJson(SaveInteraction data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class SendSavedDataJson {
|
||||||
|
List<SaveInteraction> data;
|
||||||
|
SendSavedDataJson({required this.data});
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"data": List<SaveInteraction>.from(data.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@HiveType(typeId: 3)
|
||||||
|
class SaveInteraction {
|
||||||
|
@HiveField(0)
|
||||||
|
String id;
|
||||||
|
|
||||||
|
@HiveField(1)
|
||||||
|
List<FormFieldData> save;
|
||||||
|
@HiveField(2)
|
||||||
|
String? form;
|
||||||
|
@HiveField(3)
|
||||||
|
String? updatedTime;
|
||||||
|
@HiveField(4)
|
||||||
|
String intId;
|
||||||
|
@HiveField(5)
|
||||||
|
String intName;
|
||||||
|
|
||||||
|
SaveInteraction(
|
||||||
|
{required this.save,
|
||||||
|
required this.id,
|
||||||
|
this.form,
|
||||||
|
this.updatedTime,
|
||||||
|
required this.intId,
|
||||||
|
required this.intName});
|
||||||
|
|
||||||
|
factory SaveInteraction.fromJson(Map<String, dynamic> json) =>
|
||||||
|
SaveInteraction(
|
||||||
|
save: List<FormFieldData>.from(
|
||||||
|
json["save"].map((x) => SaveData.fromJson(x))),
|
||||||
|
intId: 'intId',
|
||||||
|
intName: 'intName',
|
||||||
|
id: 'id');
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"save": List<FormFieldData>.from(save.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
|
||||||
|
Map<String, dynamic> savetoJson() => {
|
||||||
|
"form": form,
|
||||||
|
"intId": intId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class JsonFormat {}
|
||||||
|
|
||||||
|
class SaveInteractionJson {
|
||||||
|
@HiveField(0)
|
||||||
|
int? id;
|
||||||
|
@HiveField(1)
|
||||||
|
List<SaveData> save;
|
||||||
|
|
||||||
|
SaveInteractionJson({
|
||||||
|
required this.save,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SaveInteractionJson.fromJson(Map<String, dynamic> json) =>
|
||||||
|
SaveInteractionJson(
|
||||||
|
save:
|
||||||
|
List<SaveData>.from(json["save"].map((x) => SaveData.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"save": List<dynamic>.from(save.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class SaveData {
|
||||||
|
String sectionName;
|
||||||
|
List<dynamic> multiple;
|
||||||
|
List<SaveSectionList> sectionList;
|
||||||
|
List<List<SaveSectionList>>? multiplesectionList;
|
||||||
|
|
||||||
|
SaveData({
|
||||||
|
required this.sectionName,
|
||||||
|
required this.multiple,
|
||||||
|
required this.sectionList,
|
||||||
|
this.multiplesectionList,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SaveData.fromJson(Map<String, dynamic> json) => SaveData(
|
||||||
|
sectionName: json["sectionName"],
|
||||||
|
multiple: List<dynamic>.from(json["multiple"].map((x) => x)),
|
||||||
|
sectionList: List<SaveSectionList>.from(
|
||||||
|
json["sectionList"].map((x) => SaveSectionList.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"sectionName": sectionName,
|
||||||
|
"multiple": List<dynamic>.from(multiple.map((x) => x)),
|
||||||
|
"sectionList": List<dynamic>.from(sectionList.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class SaveSectionList {
|
||||||
|
String param;
|
||||||
|
String id;
|
||||||
|
List<dynamic> selectedValue;
|
||||||
|
String? widget;
|
||||||
|
|
||||||
|
SaveSectionList({
|
||||||
|
required this.param,
|
||||||
|
required this.id,
|
||||||
|
required this.selectedValue,
|
||||||
|
this.widget,
|
||||||
|
});
|
||||||
|
|
||||||
|
factory SaveSectionList.fromJson(Map<String, dynamic> json) =>
|
||||||
|
SaveSectionList(
|
||||||
|
param: json["param"],
|
||||||
|
id: json["id"],
|
||||||
|
selectedValue: List<dynamic>.from(json["selectedValue"].map((x) => x)),
|
||||||
|
widget: json["widget"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"param": param,
|
||||||
|
"id": id,
|
||||||
|
"selectedValue": List<dynamic>.from(selectedValue.map((x) => x)),
|
||||||
|
"widget": widget,
|
||||||
|
};
|
||||||
|
}
|
|
@ -0,0 +1,56 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'save_interaction.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// TypeAdapterGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
class SaveInteractionAdapter extends TypeAdapter<SaveInteraction> {
|
||||||
|
@override
|
||||||
|
final int typeId = 3;
|
||||||
|
|
||||||
|
@override
|
||||||
|
SaveInteraction read(BinaryReader reader) {
|
||||||
|
final numOfFields = reader.readByte();
|
||||||
|
final fields = <int, dynamic>{
|
||||||
|
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||||
|
};
|
||||||
|
return SaveInteraction(
|
||||||
|
save: (fields[1] as List).cast<FormFieldData>(),
|
||||||
|
id: fields[0] as String,
|
||||||
|
form: fields[2] as String?,
|
||||||
|
updatedTime: fields[3] as String?,
|
||||||
|
intId: fields[4] as String,
|
||||||
|
intName: fields[5] as String,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void write(BinaryWriter writer, SaveInteraction obj) {
|
||||||
|
writer
|
||||||
|
..writeByte(6)
|
||||||
|
..writeByte(0)
|
||||||
|
..write(obj.id)
|
||||||
|
..writeByte(1)
|
||||||
|
..write(obj.save)
|
||||||
|
..writeByte(2)
|
||||||
|
..write(obj.form)
|
||||||
|
..writeByte(3)
|
||||||
|
..write(obj.updatedTime)
|
||||||
|
..writeByte(4)
|
||||||
|
..write(obj.intId)
|
||||||
|
..writeByte(5)
|
||||||
|
..write(obj.intName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
int get hashCode => typeId.hashCode;
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool operator ==(Object other) =>
|
||||||
|
identical(this, other) ||
|
||||||
|
other is SaveInteractionAdapter &&
|
||||||
|
runtimeType == other.runtimeType &&
|
||||||
|
typeId == other.typeId;
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_config_data.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'package:hive/hive.dart';
|
||||||
|
// import 'package:pwa_ios/model/interaction_config_data.dart';
|
||||||
|
|
||||||
|
class HiveDataRepository extends ChangeNotifier {
|
||||||
|
Box<InteractionConfigData> _hiveBox; // Use the correct type for your Hive box
|
||||||
|
|
||||||
|
HiveDataRepository(this._hiveBox);
|
||||||
|
|
||||||
|
List<InteractionConfigData> getAllDataFromHive() {
|
||||||
|
print("Stored_ALL_valuesssss : ${_hiveBox.values.toList()}");
|
||||||
|
print(
|
||||||
|
"Stored_ALL_valuesssss_leangthhh : ${_hiveBox.values.toList().length}");
|
||||||
|
|
||||||
|
return _hiveBox.values.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> openHiveBox() async {
|
||||||
|
_hiveBox =
|
||||||
|
await Hive.openBox<InteractionConfigData>('InteractionConfigDataBox');
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> closeHiveBox() async {
|
||||||
|
_hiveBox.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
List<InteractionConfigData> getAllofflineData() {
|
||||||
|
return _hiveBox.values.toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> addOfflineData(InteractionConfigData data, int id) async {
|
||||||
|
// _hiveBox = await Hive.openBox('InteractionDataBox');
|
||||||
|
|
||||||
|
await _hiveBox.put(id, data);
|
||||||
|
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> getNextAutoIncrementValue() async {
|
||||||
|
var counterBox = await Hive.openBox<int>('counterBox');
|
||||||
|
if (!counterBox.containsKey('counter')) {
|
||||||
|
counterBox.put('counter', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int? counter = counterBox.get('counter');
|
||||||
|
counterBox.put('counter', counter! + 1);
|
||||||
|
|
||||||
|
await counterBox.close();
|
||||||
|
|
||||||
|
return counter;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,112 @@
|
||||||
|
import 'dart:io';
|
||||||
|
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/json_form_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
|
import 'package:hive_flutter/hive_flutter.dart';
|
||||||
|
|
||||||
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
|
||||||
|
Future<bool> isNetworkAvailable() async {
|
||||||
|
// check if there is a valid network connection
|
||||||
|
final connectivityResult = await Connectivity().checkConnectivity();
|
||||||
|
if (connectivityResult != ConnectivityResult.mobile &&
|
||||||
|
connectivityResult != ConnectivityResult.wifi) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if the network is really connected to Internet
|
||||||
|
try {
|
||||||
|
final result = await InternetAddress.lookup('example.com');
|
||||||
|
if (result.isEmpty || result[0].rawAddress.isEmpty) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} on SocketException catch (_) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> isPWAInstalled() async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
return prefs.getBool('isInstalled') ?? false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setPWAInstalled({bool installed = true}) async {
|
||||||
|
final prefs = await SharedPreferences.getInstance();
|
||||||
|
await prefs.setBool('isInstalled', installed);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool get isTablet {
|
||||||
|
final firstView = WidgetsBinding.instance.platformDispatcher.views.first;
|
||||||
|
final logicalShortestSide =
|
||||||
|
firstView.physicalSize.shortestSide / firstView.devicePixelRatio;
|
||||||
|
// print("size:${logicalShortestSide > 600} tablet ");
|
||||||
|
return logicalShortestSide > 600;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String> formJsonForSync() async {
|
||||||
|
final provider = ViewInteractionProvider();
|
||||||
|
final prov = InteractionProvider();
|
||||||
|
List<SaveInteractionFormJson> senSavedList = [];
|
||||||
|
List<SaveInteraction> savedList = await provider.getAllRecords();
|
||||||
|
for (var obj in savedList) {
|
||||||
|
senSavedList.add(prov.formJson(obj));
|
||||||
|
}
|
||||||
|
|
||||||
|
SendSaveJson jsonData = SendSaveJson(savedList: senSavedList);
|
||||||
|
String jsonstr = saveFormJsonToJson(jsonData);
|
||||||
|
print(jsonstr);
|
||||||
|
return jsonstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> checkRecordsAvailable() async {
|
||||||
|
final provider = ViewInteractionProvider();
|
||||||
|
List<SaveInteraction> savedList = await provider.getAllRecords();
|
||||||
|
return savedList.isNotEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
|
deleteRecords() async {
|
||||||
|
final provider = ViewInteractionProvider();
|
||||||
|
List<SaveInteraction> savedList = await provider.getAllRecords();
|
||||||
|
for (var obj in savedList) {
|
||||||
|
provider.deleteRecord(obj);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<int> getNextAutoIncrementValue() async {
|
||||||
|
var counterBox = await Hive.openBox<int>('counterBox');
|
||||||
|
if (!counterBox.containsKey('counter')) {
|
||||||
|
counterBox.put('counter', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
int? counter = counterBox.get('counter');
|
||||||
|
counterBox.put('counter', counter! + 1);
|
||||||
|
|
||||||
|
await counterBox.close();
|
||||||
|
|
||||||
|
return counter;
|
||||||
|
}
|
||||||
|
|
||||||
|
class HexColor extends Color {
|
||||||
|
static int _getColorFromHex(String hexColor) {
|
||||||
|
hexColor = hexColor.toUpperCase().replaceAll("#", "");
|
||||||
|
if (hexColor.length == 6) {
|
||||||
|
hexColor = "FF$hexColor";
|
||||||
|
}
|
||||||
|
return int.parse(hexColor, radix: 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
HexColor(final String hexColor) : super(_getColorFromHex(hexColor));
|
||||||
|
}
|
||||||
|
|
||||||
|
extension Iterables<E> on Iterable<E> {
|
||||||
|
Map<K, List<E>> groupBy<K>(K Function(E) keyFunction) => fold(
|
||||||
|
<K, List<E>>{},
|
||||||
|
(Map<K, List<E>> map, E element) =>
|
||||||
|
map..putIfAbsent(keyFunction(element), () => <E>[]).add(element));
|
||||||
|
}
|
|
@ -0,0 +1,200 @@
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/edit_interaction_screen.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/util.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/view_interaction_screen.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/viewinteractionprovider.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class SavedFormListScreen extends StatefulWidget {
|
||||||
|
// List<SaveInteraction> savedList;
|
||||||
|
String formname;
|
||||||
|
SavedFormListScreen({super.key, required this.formname});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<SavedFormListScreen> createState() => _SavedFormListScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SavedFormListScreenState extends State<SavedFormListScreen> {
|
||||||
|
//List<SaveInteraction> savedList = [];
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
init() async {
|
||||||
|
// await Provider.of<InteractionProvider>(context, listen: false)
|
||||||
|
// .initConfigData();
|
||||||
|
await Provider.of<ViewInteractionProvider>(context, listen: false)
|
||||||
|
.getRecords(widget.formname);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Consumer<ViewInteractionProvider>(
|
||||||
|
builder: (BuildContext context, provider, Widget? child) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
'Records of ${widget.formname}',
|
||||||
|
style: TextStyle(fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||||
|
),
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
backgroundColor: const Color(0xFF2b9af3),
|
||||||
|
leading: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: const Icon(
|
||||||
|
Icons.arrow_back_ios,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Container(
|
||||||
|
child: Center(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: provider.savedList.length,
|
||||||
|
cacheExtent:
|
||||||
|
double.parse(provider.savedList.length.toString()),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
ListTile(
|
||||||
|
subtitle: Text(
|
||||||
|
'Updated on ${provider.savedList[index].updatedTime}',
|
||||||
|
//style: TextStyle(fontStyle: FontStyle.italic),
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
provider.savedList[index].id,
|
||||||
|
),
|
||||||
|
trailing: SizedBox(
|
||||||
|
width: 150,
|
||||||
|
child: Row(children: [
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) =>
|
||||||
|
ViewInteractionScreen(
|
||||||
|
saveInteraction:
|
||||||
|
provider.savedList[index],
|
||||||
|
)));
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.info_outline,
|
||||||
|
size: 24,
|
||||||
|
color: Color.fromARGB(255, 8, 39, 92),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () async {
|
||||||
|
await provider.initConfigData().then({
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) =>
|
||||||
|
EditInteractionScreen(
|
||||||
|
saveInteraction:
|
||||||
|
provider.savedList[index],
|
||||||
|
)))
|
||||||
|
});
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.edit,
|
||||||
|
size: 24,
|
||||||
|
color: Color.fromARGB(255, 8, 39, 92),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
|
onPressed: () {
|
||||||
|
showDeleteRecordAlertDialog(
|
||||||
|
context,
|
||||||
|
provider.savedList[index].id,
|
||||||
|
provider.savedList[index]);
|
||||||
|
},
|
||||||
|
icon: const Icon(
|
||||||
|
Icons.delete,
|
||||||
|
size: 24,
|
||||||
|
color: Color.fromARGB(255, 8, 39, 92),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (BuildContext context) =>
|
||||||
|
ViewInteractionScreen(
|
||||||
|
saveInteraction:
|
||||||
|
provider.savedList[index],
|
||||||
|
)));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const Divider(),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
})),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
showDeleteRecordAlertDialog(
|
||||||
|
BuildContext context, String record, SaveInteraction saveInteraction) {
|
||||||
|
// set up the buttons
|
||||||
|
ViewInteractionProvider provider =
|
||||||
|
Provider.of<ViewInteractionProvider>(context, listen: false);
|
||||||
|
Widget cancelButton = TextButton(
|
||||||
|
child: const Text("YES"),
|
||||||
|
onPressed: () async {
|
||||||
|
await provider.deleteRecord(saveInteraction).then((value) {
|
||||||
|
_displaySnackBar("Deleted sucessfully!");
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
Widget continueButton = TextButton(
|
||||||
|
child: const Text("NO"),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// set up the AlertDialog
|
||||||
|
AlertDialog alert = AlertDialog(
|
||||||
|
title: const Text(""),
|
||||||
|
content: Text("Are you sure you want to delete the record $record ?"),
|
||||||
|
actions: [
|
||||||
|
cancelButton,
|
||||||
|
continueButton,
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
// show the dialog
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return alert;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_displaySnackBar(String msg) {
|
||||||
|
final snackBar = SnackBar(
|
||||||
|
content: Text(
|
||||||
|
msg,
|
||||||
|
style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
|
||||||
|
));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,452 @@
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/interactionprovider.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/interaction_data.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/model/save_interaction.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/util.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/widget/custombutton.dart';
|
||||||
|
import 'package:discover_module/ui_screen/interactionform/widget/responsive_ext.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
// ignore: must_be_immutable
|
||||||
|
class ViewInteractionScreen extends StatefulWidget {
|
||||||
|
SaveInteraction saveInteraction;
|
||||||
|
ViewInteractionScreen({super.key, required this.saveInteraction});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<ViewInteractionScreen> createState() => _ViewInteractionScreenState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _ViewInteractionScreenState extends State<ViewInteractionScreen> {
|
||||||
|
List<dynamic> interactionReponseList = [];
|
||||||
|
List<SectionList> sectionList = [];
|
||||||
|
List<TextEditingController> textEditingControllerList = [];
|
||||||
|
int textfieldIndex = 0;
|
||||||
|
String dropdownvalue = 'Select value';
|
||||||
|
String? fileName;
|
||||||
|
final TextEditingController textEditingController = TextEditingController();
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||||
|
init();
|
||||||
|
});
|
||||||
|
|
||||||
|
super.initState();
|
||||||
|
}
|
||||||
|
|
||||||
|
init() async {
|
||||||
|
await Provider.of<InteractionProvider>(context, listen: false)
|
||||||
|
.initSavedForm(widget.saveInteraction);
|
||||||
|
setState(() {});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Consumer<InteractionProvider>(
|
||||||
|
builder: (BuildContext context, provider, Widget? child) {
|
||||||
|
print("build context");
|
||||||
|
print("${provider.interactionReponseList}");
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
FocusScope.of(context).requestFocus(FocusNode());
|
||||||
|
},
|
||||||
|
child: OrientationBuilder(builder: (context, orientation) {
|
||||||
|
return Scaffold(
|
||||||
|
//resizeToAvoidBottomInset: false,
|
||||||
|
appBar: AppBar(
|
||||||
|
title: Text(
|
||||||
|
widget.saveInteraction.id,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: isTablet ? 22 : 14, color: Colors.white),
|
||||||
|
),
|
||||||
|
backgroundColor: const Color(0xFF2b9af3),
|
||||||
|
automaticallyImplyLeading: false,
|
||||||
|
leading: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
child: const Icon(
|
||||||
|
Icons.arrow_back_ios,
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: provider.interactionReponseList.length,
|
||||||
|
cacheExtent: double.parse(
|
||||||
|
provider.interactionReponseList.length.toString()),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
var item = provider.interactionReponseList[index];
|
||||||
|
sectionList = item.sectionList;
|
||||||
|
return ExpansionTile(
|
||||||
|
initiallyExpanded: true,
|
||||||
|
title: Stack(
|
||||||
|
alignment: AlignmentDirectional.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
// height: double.infinity,
|
||||||
|
width: double.infinity,
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
decoration: const BoxDecoration(
|
||||||
|
color: Color(0xFF2b9af3),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
item.sectionName,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
fontSize: 18.0),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: isTablet
|
||||||
|
? const EdgeInsets.only(left: 18.0)
|
||||||
|
: const EdgeInsets.only(
|
||||||
|
left: 12.0, right: 12.0),
|
||||||
|
child: GridView.count(
|
||||||
|
physics:
|
||||||
|
const NeverScrollableScrollPhysics(),
|
||||||
|
crossAxisCount: context.responsive<int>(
|
||||||
|
1,
|
||||||
|
sm: 1, // small
|
||||||
|
md: 1, // medium
|
||||||
|
lg: sectionList.length == 1
|
||||||
|
? 1
|
||||||
|
: 4, // large
|
||||||
|
xl: 3, // extra large screen
|
||||||
|
),
|
||||||
|
mainAxisSpacing:
|
||||||
|
sectionList.length == 1 || !isTablet
|
||||||
|
? 1
|
||||||
|
: 3.5,
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
childAspectRatio:
|
||||||
|
sectionList.length == 1 || !isTablet
|
||||||
|
? orientation ==
|
||||||
|
Orientation.landscape
|
||||||
|
? 10
|
||||||
|
: 3.8
|
||||||
|
: 2.8,
|
||||||
|
children: List.generate(
|
||||||
|
sectionList.length,
|
||||||
|
(i) {
|
||||||
|
print(sectionList);
|
||||||
|
SectionList sectionItem =
|
||||||
|
sectionList[i];
|
||||||
|
dropdownvalue = sectionItem
|
||||||
|
.widget ==
|
||||||
|
InteractionWidget.DROPDOWN
|
||||||
|
? sectionItem.value ?? "Select"
|
||||||
|
: ' ';
|
||||||
|
List<InputClass> list = sectionItem
|
||||||
|
.widget ==
|
||||||
|
InteractionWidget
|
||||||
|
.DROPDOWN ||
|
||||||
|
sectionItem.widget ==
|
||||||
|
InteractionWidget
|
||||||
|
.AUTOCOMPLETE ||
|
||||||
|
sectionItem.widget ==
|
||||||
|
InteractionWidget
|
||||||
|
.MULTISELECT
|
||||||
|
? provider.getData2(sectionItem)
|
||||||
|
: [];
|
||||||
|
provider.checkboxlist = sectionItem
|
||||||
|
.widget ==
|
||||||
|
InteractionWidget.CHECKBOX
|
||||||
|
? provider.getData2(sectionItem)
|
||||||
|
: [];
|
||||||
|
|
||||||
|
return Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
sectionItem.widget ==
|
||||||
|
InteractionWidget
|
||||||
|
.BUTTON &&
|
||||||
|
sectionItem.param ==
|
||||||
|
'add'
|
||||||
|
? const SizedBox.shrink()
|
||||||
|
: Text(
|
||||||
|
'${sectionItem.name}:*',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors
|
||||||
|
.orange.shade800,
|
||||||
|
fontSize: isTablet
|
||||||
|
? 18
|
||||||
|
: 12,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: isTablet ? 15 : 5,
|
||||||
|
),
|
||||||
|
returnWidget(
|
||||||
|
sectionItem: sectionItem,
|
||||||
|
item: item,
|
||||||
|
provider: provider,
|
||||||
|
list: list,
|
||||||
|
gridIndex: i,
|
||||||
|
listIndex: index,
|
||||||
|
widgetData:
|
||||||
|
sectionItem.widget!),
|
||||||
|
SizedBox(
|
||||||
|
height: isTablet ? 15 : 5,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: isTablet ? 15 : 5,
|
||||||
|
),
|
||||||
|
item.multiple
|
||||||
|
? gridViewWidget(
|
||||||
|
provider,
|
||||||
|
item.sectionName,
|
||||||
|
item.multipleList ?? [],
|
||||||
|
orientation,
|
||||||
|
item,
|
||||||
|
index)
|
||||||
|
: const SizedBox.shrink(),
|
||||||
|
provider.interactionReponseList.length ==
|
||||||
|
index - 1
|
||||||
|
? saveActions(provider)
|
||||||
|
: const SizedBox.shrink()
|
||||||
|
//const Spacer(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
// const Spacer(),
|
||||||
|
// saveActions(provider),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget returnWidget({
|
||||||
|
required SectionList sectionItem,
|
||||||
|
required FormFieldData item,
|
||||||
|
required InteractionProvider provider,
|
||||||
|
required List<InputClass> list,
|
||||||
|
required int gridIndex,
|
||||||
|
required int listIndex,
|
||||||
|
required InteractionWidget widgetData,
|
||||||
|
}) {
|
||||||
|
switch (widgetData) {
|
||||||
|
case InteractionWidget.CHECKBOX:
|
||||||
|
return (sectionItem.inputList!.length >= 5)
|
||||||
|
? Text(sectionItem.selectedValue.toString())
|
||||||
|
: Text(provider.getDataValue(
|
||||||
|
sectionItem.id, sectionItem.selectedValue!.last));
|
||||||
|
|
||||||
|
case InteractionWidget.AUTOCOMPLETE:
|
||||||
|
return Text(provider.getDataValue(
|
||||||
|
sectionItem.id, sectionItem.selectedValue!.last));
|
||||||
|
|
||||||
|
case InteractionWidget.MULTISELECT:
|
||||||
|
return Text(sectionItem.selectedValue.toString());
|
||||||
|
|
||||||
|
case InteractionWidget.RADIO:
|
||||||
|
return (sectionItem.inputList!.length >= 5)
|
||||||
|
? Text(sectionItem.selectedValue!.isNotEmpty
|
||||||
|
? provider.getDataValue(
|
||||||
|
sectionItem.id, sectionItem.selectedValue!.last)
|
||||||
|
: " ")
|
||||||
|
: Text(provider.getDataValue(
|
||||||
|
sectionItem.id, sectionItem.selectedValue!.last));
|
||||||
|
|
||||||
|
case InteractionWidget.LABEL:
|
||||||
|
return Text(sectionItem.input!);
|
||||||
|
|
||||||
|
case InteractionWidget.RANGESLIDER:
|
||||||
|
return Text(sectionItem.selectedValue!.isNotEmpty
|
||||||
|
? sectionItem.selectedValue!.last.toString()
|
||||||
|
: " ");
|
||||||
|
|
||||||
|
case InteractionWidget.TEXT:
|
||||||
|
return Text(sectionItem.selectedValue!.isNotEmpty
|
||||||
|
? sectionItem.selectedValue!.last.toString()
|
||||||
|
: " ");
|
||||||
|
|
||||||
|
case InteractionWidget.BUTTON:
|
||||||
|
return sectionItem.input == "chooseFile"
|
||||||
|
? sectionItem.selectedValue!.isNotEmpty
|
||||||
|
? const Text("File Uploaded")
|
||||||
|
: const Text(" ")
|
||||||
|
: const Text(" ");
|
||||||
|
default:
|
||||||
|
return Text(sectionItem.selectedValue!.isNotEmpty
|
||||||
|
? provider.getDataValue(
|
||||||
|
sectionItem.id, sectionItem.selectedValue!.last)
|
||||||
|
: " ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget saveActions(InteractionProvider provider) {
|
||||||
|
return Align(
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
CustomButton(
|
||||||
|
backgroundColor: Colors.red.shade800,
|
||||||
|
onPressed: () {
|
||||||
|
//showDeleteProfileAlertDialog(context);
|
||||||
|
for (var textcontrollers in provider.textEditingControllerList) {
|
||||||
|
textcontrollers.text = '';
|
||||||
|
}
|
||||||
|
},
|
||||||
|
textColor: Colors.white,
|
||||||
|
title: "Reset",
|
||||||
|
height: 40,
|
||||||
|
width: isTablet ? 100 : 60,
|
||||||
|
fontsize: isTablet ? 15 : 10.2,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: isTablet ? 20 : 4,
|
||||||
|
),
|
||||||
|
CustomButton(
|
||||||
|
backgroundColor: Colors.green.shade900,
|
||||||
|
onPressed: () async {
|
||||||
|
if (textFieldsValidation(provider).isEmpty) {
|
||||||
|
// await provider.saveJsonObject(context, widget.form);
|
||||||
|
_displaySnackBar('Form Saved Sucessfully!');
|
||||||
|
} else {
|
||||||
|
_displaySnackBar(textFieldsValidation(provider));
|
||||||
|
}
|
||||||
|
},
|
||||||
|
textColor: Colors.white,
|
||||||
|
title: "Save",
|
||||||
|
height: 40,
|
||||||
|
width: isTablet ? 100 : 60,
|
||||||
|
fontsize: isTablet ? 16 : 12,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: isTablet ? 20 : 2,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget gridViewWidget(
|
||||||
|
InteractionProvider provider,
|
||||||
|
String sectionName,
|
||||||
|
List<SectionList> sectionList,
|
||||||
|
Orientation orientation,
|
||||||
|
FormFieldData item,
|
||||||
|
int listIndex) {
|
||||||
|
return Padding(
|
||||||
|
padding: isTablet
|
||||||
|
? const EdgeInsets.only(left: 22.0)
|
||||||
|
: const EdgeInsets.only(left: 12.0, right: 12.0),
|
||||||
|
child: GridView.count(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
crossAxisCount: context.responsive<int>(
|
||||||
|
1, // default
|
||||||
|
sm: 1, // small
|
||||||
|
md: 1, // medium
|
||||||
|
lg: sectionList.length == 1 ? 1 : 4, // large
|
||||||
|
xl: 5, // extra large screen
|
||||||
|
),
|
||||||
|
mainAxisSpacing: sectionList.length == 1 || !isTablet ? 1 : 2,
|
||||||
|
shrinkWrap: true,
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
childAspectRatio: sectionList.length == 1 || !isTablet
|
||||||
|
? orientation == Orientation.landscape
|
||||||
|
? 10
|
||||||
|
: 4.2
|
||||||
|
: 1.8,
|
||||||
|
children: List.generate(
|
||||||
|
sectionList.length,
|
||||||
|
(i) {
|
||||||
|
print(sectionList);
|
||||||
|
SectionList sectionItem = sectionList[i];
|
||||||
|
dropdownvalue = sectionItem.widget == InteractionWidget.DROPDOWN
|
||||||
|
? sectionItem.value ?? "Select"
|
||||||
|
: ' ';
|
||||||
|
List<InputClass> list =
|
||||||
|
sectionItem.widget == InteractionWidget.DROPDOWN ||
|
||||||
|
sectionItem.widget == InteractionWidget.AUTOCOMPLETE ||
|
||||||
|
sectionItem.widget == InteractionWidget.MULTISELECT
|
||||||
|
? provider.getData2(sectionItem)
|
||||||
|
: [];
|
||||||
|
provider.checkboxlist =
|
||||||
|
sectionItem.widget == InteractionWidget.CHECKBOX
|
||||||
|
? provider.getData2(sectionItem)
|
||||||
|
: [];
|
||||||
|
|
||||||
|
return Wrap(children: [
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
sectionItem.widget == InteractionWidget.BUTTON &&
|
||||||
|
sectionItem.param == 'add' ||
|
||||||
|
sectionItem.param == 'deletebtn'
|
||||||
|
? const SizedBox.shrink()
|
||||||
|
: Text(
|
||||||
|
'${sectionItem.name}:*',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.orange.shade800,
|
||||||
|
fontSize: isTablet ? 18 : 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
returnWidget(
|
||||||
|
sectionItem: sectionItem,
|
||||||
|
item: item,
|
||||||
|
provider: provider,
|
||||||
|
list: list,
|
||||||
|
gridIndex: i,
|
||||||
|
listIndex: listIndex,
|
||||||
|
widgetData: sectionItem.widget!),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
]);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
String textFieldsValidation(InteractionProvider provider) {
|
||||||
|
if (provider.sectionList
|
||||||
|
.any((element) => element.controller!.text.isEmpty)) {
|
||||||
|
return 'Fields cannot be empty';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
_displaySnackBar(String msg) {
|
||||||
|
final snackBar = SnackBar(
|
||||||
|
content: Text(
|
||||||
|
msg,
|
||||||
|
style: const TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold),
|
||||||
|
));
|
||||||
|
ScaffoldMessenger.of(context).showSnackBar(snackBar);
|
||||||
|
//scaffoldKeyLogin.currentState!.showSnackBar(snackBar);
|
||||||
|
}
|
||||||
|
}
|