├── .gitattributes
├── .gitignore
├── .metadata
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── app
│ ├── build.gradle
│ └── src
│ │ ├── debug
│ │ └── AndroidManifest.xml
│ │ ├── main
│ │ ├── AndroidManifest.xml
│ │ ├── kotlin
│ │ │ └── com
│ │ │ │ └── example
│ │ │ │ └── json2dart_gen
│ │ │ │ └── MainActivity.kt
│ │ └── res
│ │ │ ├── drawable-v21
│ │ │ └── launch_background.xml
│ │ │ ├── drawable
│ │ │ └── launch_background.xml
│ │ │ ├── mipmap-hdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxxhdpi
│ │ │ └── ic_launcher.png
│ │ │ ├── values-night
│ │ │ └── styles.xml
│ │ │ └── values
│ │ │ └── styles.xml
│ │ └── profile
│ │ └── AndroidManifest.xml
├── build.gradle
├── gradle.properties
├── gradle
│ └── wrapper
│ │ └── gradle-wrapper.properties
└── settings.gradle
├── assets
├── ic_github.svg
└── ic_twitter.svg
├── ios
├── .gitignore
├── Flutter
│ ├── AppFrameworkInfo.plist
│ ├── Debug.xcconfig
│ └── Release.xcconfig
├── Podfile
├── Runner.xcodeproj
│ ├── project.pbxproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── IDEWorkspaceChecks.plist
│ │ │ └── WorkspaceSettings.xcsettings
│ └── xcshareddata
│ │ └── xcschemes
│ │ └── Runner.xcscheme
├── Runner.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ ├── IDEWorkspaceChecks.plist
│ │ └── WorkspaceSettings.xcsettings
└── Runner
│ ├── AppDelegate.swift
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon-App-1024x1024@1x.png
│ │ ├── Icon-App-20x20@1x.png
│ │ ├── Icon-App-20x20@2x.png
│ │ ├── Icon-App-20x20@3x.png
│ │ ├── Icon-App-29x29@1x.png
│ │ ├── Icon-App-29x29@2x.png
│ │ ├── Icon-App-29x29@3x.png
│ │ ├── Icon-App-40x40@1x.png
│ │ ├── Icon-App-40x40@2x.png
│ │ ├── Icon-App-40x40@3x.png
│ │ ├── Icon-App-60x60@2x.png
│ │ ├── Icon-App-60x60@3x.png
│ │ ├── Icon-App-76x76@1x.png
│ │ ├── Icon-App-76x76@2x.png
│ │ └── Icon-App-83.5x83.5@2x.png
│ └── LaunchImage.imageset
│ │ ├── Contents.json
│ │ ├── LaunchImage.png
│ │ ├── LaunchImage@2x.png
│ │ ├── LaunchImage@3x.png
│ │ └── README.md
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ └── Runner-Bridging-Header.h
├── lib
├── converter
│ ├── json2dart_gen.dart
│ └── src
│ │ ├── converter.dart
│ │ ├── field.dart
│ │ ├── parser.dart
│ │ ├── string_extension.dart
│ │ └── type_selector
│ │ ├── ISelector.dart
│ │ ├── bool_selector.dart
│ │ ├── date_selector.dart
│ │ ├── index.dart
│ │ ├── int_selector.dart
│ │ ├── list_selector.dart
│ │ ├── num_selector.dart
│ │ ├── object_selector.dart
│ │ ├── string_selector.dart
│ │ └── type_selector.dart
├── firebase_options.dart
├── main.dart
└── ui
│ ├── code_section.dart
│ └── home.dart
├── public
├── .last_build_id
├── 4f2a58af27abc49ecf55570043bbf938.cache.dill.track.dill
├── assets
│ ├── AssetManifest.json
│ ├── FontManifest.json
│ ├── NOTICES
│ ├── assets
│ │ ├── ic_github.svg
│ │ └── ic_twitter.svg
│ └── fonts
│ │ └── MaterialIcons-Regular.otf
├── favicon.png
├── flutter_service_worker.js
├── icons
│ ├── Icon-192.png
│ ├── Icon-512.png
│ ├── Icon-maskable-192.png
│ └── Icon-maskable-512.png
├── index.html
├── main.dart.js
├── manifest.json
└── version.json
├── pubspec.lock
├── pubspec.yaml
├── test
└── widget_test.dart
└── web
├── favicon.png
├── icons
├── Icon-192.png
├── Icon-512.png
├── Icon-maskable-192.png
└── Icon-maskable-512.png
├── index.html
└── manifest.json
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | .firebase_options.dart
35 |
36 | # Web related
37 | lib/generated_plugin_registrant.dart
38 |
39 | # Symbolication related
40 | app.*.symbols
41 |
42 | # Obfuscation related
43 | app.*.map.json
44 |
45 | # Android Studio will place build artifacts here
46 | /android/app/debug
47 | /android/app/profile
48 | /android/app/release
49 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: 34dbee66de8b2ef176ec39d80c3eca5feb70572e
8 | channel: master
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2022 Burcu GENECI
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # json2dart_gen
2 |
3 | Open source JSON to Dart Converter.
4 |
5 | ### Features
6 | - Null safety
7 | - Supported Types: int, string, num, DateTime, List, Custom object
8 | - Show generated code in embedded DartPad.
9 |
10 | Code generation by 💪 [dart_writer](https://github.com/ahm3tcelik/dart_writer)
11 |
12 | ## Demo
13 | URL: https://ahm3tcelik.github.io/json2dart_gen
14 |
15 | 
16 |
17 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # This file configures the analyzer, which statically analyzes Dart code to
2 | # check for errors, warnings, and lints.
3 | #
4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled
5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
6 | # invoked from the command line by running `flutter analyze`.
7 |
8 | # The following line activates a set of recommended lints for Flutter apps,
9 | # packages, and plugins designed to encourage good coding practices.
10 | include: package:flutter_lints/flutter.yaml
11 |
12 | linter:
13 | # The lint rules applied to this project can be customized in the
14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml`
15 | # included above or to enable additional rules. A list of all available lints
16 | # and their documentation is published at
17 | # https://dart-lang.github.io/linter/lints/index.html.
18 | #
19 | # Instead of disabling a lint rule for the entire project in the
20 | # section below, it can also be suppressed for a single line of code
21 | # or a specific dart file by using the `// ignore: name_of_lint` and
22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file
23 | # producing the lint.
24 | rules:
25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule
26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
27 |
28 | # Additional information about this file can be found at
29 | # https://dart.dev/guides/language/analysis-options
30 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 | **/*.keystore
13 | **/*.jks
14 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion flutter.compileSdkVersion
30 |
31 | compileOptions {
32 | sourceCompatibility JavaVersion.VERSION_1_8
33 | targetCompatibility JavaVersion.VERSION_1_8
34 | }
35 |
36 | kotlinOptions {
37 | jvmTarget = '1.8'
38 | }
39 |
40 | sourceSets {
41 | main.java.srcDirs += 'src/main/kotlin'
42 | }
43 |
44 | defaultConfig {
45 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
46 | applicationId "com.example.json2dart_gen"
47 | minSdkVersion flutter.minSdkVersion
48 | targetSdkVersion flutter.targetSdkVersion
49 | versionCode flutterVersionCode.toInteger()
50 | versionName flutterVersionName
51 | }
52 |
53 | buildTypes {
54 | release {
55 | // TODO: Add your own signing config for the release build.
56 | // Signing with the debug keys for now, so `flutter run --release` works.
57 | signingConfig signingConfigs.debug
58 | }
59 | }
60 | }
61 |
62 | flutter {
63 | source '../..'
64 | }
65 |
66 | dependencies {
67 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68 | }
69 |
--------------------------------------------------------------------------------
/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
7 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/android/app/src/main/kotlin/com/example/json2dart_gen/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.json2dart_gen
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | mavenCentral()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:4.1.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | mavenCentral()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
7 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/assets/ic_github.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/assets/ic_twitter.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | **/dgph
2 | *.mode1v3
3 | *.mode2v3
4 | *.moved-aside
5 | *.pbxuser
6 | *.perspectivev3
7 | **/*sync/
8 | .sconsign.dblite
9 | .tags*
10 | **/.vagrant/
11 | **/DerivedData/
12 | Icon?
13 | **/Pods/
14 | **/.symlinks/
15 | profile
16 | xcuserdata
17 | **/.generated/
18 | Flutter/App.framework
19 | Flutter/Flutter.framework
20 | Flutter/Flutter.podspec
21 | Flutter/Generated.xcconfig
22 | Flutter/ephemeral/
23 | Flutter/app.flx
24 | Flutter/app.zip
25 | Flutter/flutter_assets/
26 | Flutter/flutter_export_environment.sh
27 | ServiceDefinitions.json
28 | Runner/GeneratedPluginRegistrant.*
29 |
30 | # Exceptions to above rules.
31 | !default.mode1v3
32 | !default.mode2v3
33 | !default.pbxuser
34 | !default.perspectivev3
35 |
--------------------------------------------------------------------------------
/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '9.0'
3 |
4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
6 |
7 | project 'Runner', {
8 | 'Debug' => :debug,
9 | 'Profile' => :release,
10 | 'Release' => :release,
11 | }
12 |
13 | def flutter_root
14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
15 | unless File.exist?(generated_xcode_build_settings_path)
16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
17 | end
18 |
19 | File.foreach(generated_xcode_build_settings_path) do |line|
20 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
21 | return matches[1].strip if matches
22 | end
23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
24 | end
25 |
26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
27 |
28 | flutter_ios_podfile_setup
29 |
30 | target 'Runner' do
31 | use_frameworks!
32 | use_modular_headers!
33 |
34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
35 | end
36 |
37 | post_install do |installer|
38 | installer.pods_project.targets.each do |target|
39 | flutter_additional_ios_build_settings(target)
40 | end
41 | end
42 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
97 | );
98 | path = Runner;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 97C146ED1CF9000F007C117D /* Runner */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107 | buildPhases = (
108 | 9740EEB61CF901F6004384FC /* Run Script */,
109 | 97C146EA1CF9000F007C117D /* Sources */,
110 | 97C146EB1CF9000F007C117D /* Frameworks */,
111 | 97C146EC1CF9000F007C117D /* Resources */,
112 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = Runner;
120 | productName = Runner;
121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
122 | productType = "com.apple.product-type.application";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | 97C146E61CF9000F007C117D /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 1300;
131 | ORGANIZATIONNAME = "";
132 | TargetAttributes = {
133 | 97C146ED1CF9000F007C117D = {
134 | CreatedOnToolsVersion = 7.3.1;
135 | LastSwiftMigration = 1100;
136 | };
137 | };
138 | };
139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
140 | compatibilityVersion = "Xcode 9.3";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = 97C146E51CF9000F007C117D;
148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | 97C146ED1CF9000F007C117D /* Runner */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXResourcesBuildPhase section */
158 | 97C146EC1CF9000F007C117D /* Resources */ = {
159 | isa = PBXResourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
166 | );
167 | runOnlyForDeploymentPostprocessing = 0;
168 | };
169 | /* End PBXResourcesBuildPhase section */
170 |
171 | /* Begin PBXShellScriptBuildPhase section */
172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173 | isa = PBXShellScriptBuildPhase;
174 | buildActionMask = 2147483647;
175 | files = (
176 | );
177 | inputPaths = (
178 | );
179 | name = "Thin Binary";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185 | };
186 | 9740EEB61CF901F6004384FC /* Run Script */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | );
193 | name = "Run Script";
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 97C146EA1CF9000F007C117D /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXVariantGroup section */
215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
216 | isa = PBXVariantGroup;
217 | children = (
218 | 97C146FB1CF9000F007C117D /* Base */,
219 | );
220 | name = Main.storyboard;
221 | sourceTree = "";
222 | };
223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C147001CF9000F007C117D /* Base */,
227 | );
228 | name = LaunchScreen.storyboard;
229 | sourceTree = "";
230 | };
231 | /* End PBXVariantGroup section */
232 |
233 | /* Begin XCBuildConfiguration section */
234 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | ALWAYS_SEARCH_USER_PATHS = NO;
238 | CLANG_ANALYZER_NONNULL = YES;
239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240 | CLANG_CXX_LIBRARY = "libc++";
241 | CLANG_ENABLE_MODULES = YES;
242 | CLANG_ENABLE_OBJC_ARC = YES;
243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_COMMA = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
258 | CLANG_WARN_STRICT_PROTOTYPES = YES;
259 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
260 | CLANG_WARN_UNREACHABLE_CODE = YES;
261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
263 | COPY_PHASE_STRIP = NO;
264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
265 | ENABLE_NS_ASSERTIONS = NO;
266 | ENABLE_STRICT_OBJC_MSGSEND = YES;
267 | GCC_C_LANGUAGE_STANDARD = gnu99;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
271 | GCC_WARN_UNDECLARED_SELECTOR = YES;
272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273 | GCC_WARN_UNUSED_FUNCTION = YES;
274 | GCC_WARN_UNUSED_VARIABLE = YES;
275 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
276 | MTL_ENABLE_DEBUG_INFO = NO;
277 | SDKROOT = iphoneos;
278 | SUPPORTED_PLATFORMS = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | VALIDATE_PRODUCT = YES;
281 | };
282 | name = Profile;
283 | };
284 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
285 | isa = XCBuildConfiguration;
286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CLANG_ENABLE_MODULES = YES;
290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
291 | ENABLE_BITCODE = NO;
292 | INFOPLIST_FILE = Runner/Info.plist;
293 | LD_RUNPATH_SEARCH_PATHS = (
294 | "$(inherited)",
295 | "@executable_path/Frameworks",
296 | );
297 | PRODUCT_BUNDLE_IDENTIFIER = com.example.json2dartGen;
298 | PRODUCT_NAME = "$(TARGET_NAME)";
299 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
300 | SWIFT_VERSION = 5.0;
301 | VERSIONING_SYSTEM = "apple-generic";
302 | };
303 | name = Profile;
304 | };
305 | 97C147031CF9000F007C117D /* Debug */ = {
306 | isa = XCBuildConfiguration;
307 | buildSettings = {
308 | ALWAYS_SEARCH_USER_PATHS = NO;
309 | CLANG_ANALYZER_NONNULL = YES;
310 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
311 | CLANG_CXX_LIBRARY = "libc++";
312 | CLANG_ENABLE_MODULES = YES;
313 | CLANG_ENABLE_OBJC_ARC = YES;
314 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
315 | CLANG_WARN_BOOL_CONVERSION = YES;
316 | CLANG_WARN_COMMA = YES;
317 | CLANG_WARN_CONSTANT_CONVERSION = YES;
318 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
319 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
320 | CLANG_WARN_EMPTY_BODY = YES;
321 | CLANG_WARN_ENUM_CONVERSION = YES;
322 | CLANG_WARN_INFINITE_RECURSION = YES;
323 | CLANG_WARN_INT_CONVERSION = YES;
324 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
325 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
326 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
328 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
329 | CLANG_WARN_STRICT_PROTOTYPES = YES;
330 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
331 | CLANG_WARN_UNREACHABLE_CODE = YES;
332 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
333 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
334 | COPY_PHASE_STRIP = NO;
335 | DEBUG_INFORMATION_FORMAT = dwarf;
336 | ENABLE_STRICT_OBJC_MSGSEND = YES;
337 | ENABLE_TESTABILITY = YES;
338 | GCC_C_LANGUAGE_STANDARD = gnu99;
339 | GCC_DYNAMIC_NO_PIC = NO;
340 | GCC_NO_COMMON_BLOCKS = YES;
341 | GCC_OPTIMIZATION_LEVEL = 0;
342 | GCC_PREPROCESSOR_DEFINITIONS = (
343 | "DEBUG=1",
344 | "$(inherited)",
345 | );
346 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
347 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
348 | GCC_WARN_UNDECLARED_SELECTOR = YES;
349 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
350 | GCC_WARN_UNUSED_FUNCTION = YES;
351 | GCC_WARN_UNUSED_VARIABLE = YES;
352 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
353 | MTL_ENABLE_DEBUG_INFO = YES;
354 | ONLY_ACTIVE_ARCH = YES;
355 | SDKROOT = iphoneos;
356 | TARGETED_DEVICE_FAMILY = "1,2";
357 | };
358 | name = Debug;
359 | };
360 | 97C147041CF9000F007C117D /* Release */ = {
361 | isa = XCBuildConfiguration;
362 | buildSettings = {
363 | ALWAYS_SEARCH_USER_PATHS = NO;
364 | CLANG_ANALYZER_NONNULL = YES;
365 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
366 | CLANG_CXX_LIBRARY = "libc++";
367 | CLANG_ENABLE_MODULES = YES;
368 | CLANG_ENABLE_OBJC_ARC = YES;
369 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
370 | CLANG_WARN_BOOL_CONVERSION = YES;
371 | CLANG_WARN_COMMA = YES;
372 | CLANG_WARN_CONSTANT_CONVERSION = YES;
373 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
374 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
375 | CLANG_WARN_EMPTY_BODY = YES;
376 | CLANG_WARN_ENUM_CONVERSION = YES;
377 | CLANG_WARN_INFINITE_RECURSION = YES;
378 | CLANG_WARN_INT_CONVERSION = YES;
379 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
380 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
381 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
382 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
383 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
384 | CLANG_WARN_STRICT_PROTOTYPES = YES;
385 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
386 | CLANG_WARN_UNREACHABLE_CODE = YES;
387 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
388 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
389 | COPY_PHASE_STRIP = NO;
390 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
391 | ENABLE_NS_ASSERTIONS = NO;
392 | ENABLE_STRICT_OBJC_MSGSEND = YES;
393 | GCC_C_LANGUAGE_STANDARD = gnu99;
394 | GCC_NO_COMMON_BLOCKS = YES;
395 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
396 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
397 | GCC_WARN_UNDECLARED_SELECTOR = YES;
398 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
399 | GCC_WARN_UNUSED_FUNCTION = YES;
400 | GCC_WARN_UNUSED_VARIABLE = YES;
401 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
402 | MTL_ENABLE_DEBUG_INFO = NO;
403 | SDKROOT = iphoneos;
404 | SUPPORTED_PLATFORMS = iphoneos;
405 | SWIFT_COMPILATION_MODE = wholemodule;
406 | SWIFT_OPTIMIZATION_LEVEL = "-O";
407 | TARGETED_DEVICE_FAMILY = "1,2";
408 | VALIDATE_PRODUCT = YES;
409 | };
410 | name = Release;
411 | };
412 | 97C147061CF9000F007C117D /* Debug */ = {
413 | isa = XCBuildConfiguration;
414 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
415 | buildSettings = {
416 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
417 | CLANG_ENABLE_MODULES = YES;
418 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
419 | ENABLE_BITCODE = NO;
420 | INFOPLIST_FILE = Runner/Info.plist;
421 | LD_RUNPATH_SEARCH_PATHS = (
422 | "$(inherited)",
423 | "@executable_path/Frameworks",
424 | );
425 | PRODUCT_BUNDLE_IDENTIFIER = com.example.json2dartGen;
426 | PRODUCT_NAME = "$(TARGET_NAME)";
427 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
428 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
429 | SWIFT_VERSION = 5.0;
430 | VERSIONING_SYSTEM = "apple-generic";
431 | };
432 | name = Debug;
433 | };
434 | 97C147071CF9000F007C117D /* Release */ = {
435 | isa = XCBuildConfiguration;
436 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
437 | buildSettings = {
438 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
439 | CLANG_ENABLE_MODULES = YES;
440 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
441 | ENABLE_BITCODE = NO;
442 | INFOPLIST_FILE = Runner/Info.plist;
443 | LD_RUNPATH_SEARCH_PATHS = (
444 | "$(inherited)",
445 | "@executable_path/Frameworks",
446 | );
447 | PRODUCT_BUNDLE_IDENTIFIER = com.example.json2dartGen;
448 | PRODUCT_NAME = "$(TARGET_NAME)";
449 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
450 | SWIFT_VERSION = 5.0;
451 | VERSIONING_SYSTEM = "apple-generic";
452 | };
453 | name = Release;
454 | };
455 | /* End XCBuildConfiguration section */
456 |
457 | /* Begin XCConfigurationList section */
458 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
459 | isa = XCConfigurationList;
460 | buildConfigurations = (
461 | 97C147031CF9000F007C117D /* Debug */,
462 | 97C147041CF9000F007C117D /* Release */,
463 | 249021D3217E4FDB00AE95B9 /* Profile */,
464 | );
465 | defaultConfigurationIsVisible = 0;
466 | defaultConfigurationName = Release;
467 | };
468 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
469 | isa = XCConfigurationList;
470 | buildConfigurations = (
471 | 97C147061CF9000F007C117D /* Debug */,
472 | 97C147071CF9000F007C117D /* Release */,
473 | 249021D4217E4FDB00AE95B9 /* Profile */,
474 | );
475 | defaultConfigurationIsVisible = 0;
476 | defaultConfigurationName = Release;
477 | };
478 | /* End XCConfigurationList section */
479 | };
480 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
481 | }
482 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
37 |
38 |
39 |
40 |
41 |
42 |
52 |
54 |
60 |
61 |
62 |
63 |
69 |
71 |
77 |
78 |
79 |
80 |
82 |
83 |
86 |
87 |
88 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | 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.
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | Json2dart Gen
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | json2dart_gen
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleSignature
22 | ????
23 | CFBundleVersion
24 | $(FLUTTER_BUILD_NUMBER)
25 | LSRequiresIPhoneOS
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 | UIViewControllerBasedStatusBarAppearance
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/lib/converter/json2dart_gen.dart:
--------------------------------------------------------------------------------
1 | export 'src/converter.dart';
2 | export 'src/field.dart';
3 |
--------------------------------------------------------------------------------
/lib/converter/src/converter.dart:
--------------------------------------------------------------------------------
1 | import 'package:dart_writer/dart_writer.dart';
2 | import 'package:json2dart_gen/converter/src/string_extension.dart';
3 |
4 | import 'field.dart';
5 | import 'parser.dart';
6 |
7 | class Converter {
8 | static String convert(String className, String rawJson) {
9 | try {
10 | final fields = _import(rawJson);
11 | String result = _export(className, fields);
12 | result = '$result${recursiveExportSubClass(fields, [])}';
13 | return result;
14 | } catch (e) {
15 | return e.toString();
16 | }
17 | }
18 |
19 | static List _import(String rawJson) {
20 | return JsonParser.parse(rawJson);
21 | }
22 |
23 | static String recursiveExportSubClass(
24 | List customClassFields, List createdCustomClasses) {
25 | String result = '';
26 | for (final field in customClassFields) {
27 | if (field.type == FieldType.object || field.type == FieldType.list) {
28 | final customClassFields = JsonParser.recursiveGetFields(field.rawValue);
29 |
30 | if (createdCustomClasses.contains(field.name.capitalize)) {
31 | continue;
32 | } else {
33 | createdCustomClasses.add(field.name.capitalize);
34 | final thisClassResult =
35 | _export(field.name.capitalize, customClassFields);
36 | result = '$result\n$thisClassResult';
37 | }
38 |
39 | final subClassResult =
40 | recursiveExportSubClass(customClassFields, createdCustomClasses);
41 | result = '$result\n$subClassResult';
42 | }
43 | }
44 | return result;
45 | }
46 |
47 | static String _export(String className, List fields) {
48 | var code = [
49 | Class(className, attributes: [
50 | for (Field field in fields)
51 | Attribute(
52 | name: field.name,
53 | type: field.typeName(),
54 | modifiers: 'final',
55 | ),
56 | ], constructors: [
57 | Constructor(
58 | className: className,
59 | modifier: 'const',
60 | param: Parameter([
61 | for (Field field in fields)
62 | ParameterItem(
63 | 'this.${field.name}',
64 | isNamed: true,
65 | isRequired: true,
66 | ),
67 | ]),
68 | ),
69 | Constructor(
70 | className: className,
71 | constructorName: 'fromJson',
72 | modifier: 'factory',
73 | param: Parameter([
74 | ParameterItem('Map json', isRequired: true),
75 | ]),
76 | statements: [
77 | Return(
78 | Call(
79 | className,
80 | argument: Argument([
81 | for (Field field in fields)
82 | ArgumentItem(
83 | field.fromJsonArgumentItemName,
84 | name: field.name,
85 | ),
86 | ]),
87 | ),
88 | ),
89 | ],
90 | ),
91 | ], methods: [
92 | Method(
93 | name: 'toJson',
94 | returnType: 'Map',
95 | statements: [
96 | Assign('final json', '{}'),
97 | for (Field field in fields)
98 | Assign("json['${field.name}']", field.toJsonItemSource),
99 | Return('json'),
100 | ],
101 | )
102 | ]),
103 | ];
104 |
105 | var context = EditorContext(enableDartFormatter: true);
106 | return context.build(code);
107 | }
108 | }
109 |
--------------------------------------------------------------------------------
/lib/converter/src/field.dart:
--------------------------------------------------------------------------------
1 | import 'string_extension.dart';
2 |
3 | enum FieldType {
4 | num,
5 | int,
6 | bool,
7 | string,
8 | list,
9 | object,
10 | date,
11 | }
12 |
13 | class Field {
14 | final String name;
15 | final FieldType type;
16 | final dynamic rawValue;
17 |
18 | const Field({required this.name, required this.type, required this.rawValue});
19 |
20 | String typeName({bool enableNullSafety = true}) {
21 | String value = '';
22 | switch (type) {
23 | case FieldType.list:
24 | value = 'List<${genericName.capitalize}>';
25 | break;
26 | case FieldType.bool:
27 | value = 'bool';
28 | break;
29 | case FieldType.int:
30 | value = 'int';
31 | break;
32 | case FieldType.num:
33 | value = 'num';
34 | break;
35 | case FieldType.date:
36 | value = 'DateTime';
37 | break;
38 | case FieldType.string:
39 | value = 'String';
40 | break;
41 | case FieldType.object:
42 | value = name.capitalize;
43 | break;
44 | }
45 | return enableNullSafety ? '$value?' : value;
46 | }
47 |
48 | /// Example
49 | /// [userList] -> [user]
50 | String get genericName {
51 | return name.split('List')[0];
52 | }
53 |
54 | String get fromJsonArgumentItemName {
55 | switch (type) {
56 | case FieldType.list:
57 | return "List.from(json['$name'] ?? []).map((e) => ${genericName.capitalize}.fromJson(e)).toList()";
58 | case FieldType.date:
59 | return "DateTime.parse(json['$name'])";
60 | case FieldType.object:
61 | return "${name.capitalize}.fromJson(json['$name'])";
62 | default:
63 | return "json['$name']";
64 | }
65 | }
66 |
67 | String get toJsonItemSource {
68 | switch (type) {
69 | case FieldType.list:
70 | return '$name?.map((e) => e.toJson()).toList()';
71 | case FieldType.date:
72 | return '$name?.toString()';
73 | case FieldType.object:
74 | return "$name?.toJson()";
75 | default:
76 | return name;
77 | }
78 | }
79 |
80 | @override
81 | String toString() {
82 | return {'name': name, 'type': type, 'rawValue': rawValue}.toString();
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/lib/converter/src/parser.dart:
--------------------------------------------------------------------------------
1 | import 'dart:convert';
2 |
3 | import 'field.dart';
4 | import 'type_selector/type_selector.dart';
5 |
6 | class JsonParser {
7 | static List parse(String jsonString) {
8 | try {
9 | final result = json.decode(jsonString);
10 | return recursiveGetFields(result);
11 | } catch (_) {
12 | rethrow;
13 | }
14 | }
15 |
16 | static List recursiveGetFields(dynamic result) {
17 | final fieldList = [];
18 | if (result is Map) {
19 | for (var dynamicField in result.entries) {
20 | final field = TypeSelector.select(dynamicField.key, dynamicField.value);
21 | if (field != null) {
22 | fieldList.add(field);
23 | }
24 | }
25 | } else if (result is List) {
26 | if (result.isNotEmpty) {
27 | fieldList.addAll(recursiveGetFields(result[0]));
28 | }
29 | }
30 | return fieldList;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/lib/converter/src/string_extension.dart:
--------------------------------------------------------------------------------
1 | extension StringExtension on String {
2 | String get capitalize {
3 | return '${this[0].toUpperCase()}${substring(1).toLowerCase()}';
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/ISelector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 |
3 | abstract class ISelector {
4 | Field? select(String key, dynamic value);
5 | }
6 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/bool_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class BoolSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is bool) {
8 | return Field(name: key, type: FieldType.bool, rawValue: value);
9 | }
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/date_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class DateSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is String) {
8 | try {
9 | DateTime.parse(value);
10 | return Field(name: key, type: FieldType.date, rawValue: value);
11 | } catch (_) {
12 | return null;
13 | }
14 | }
15 | return null;
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/index.dart:
--------------------------------------------------------------------------------
1 | export 'bool_selector.dart';
2 | export 'date_selector.dart';
3 | export 'date_selector.dart';
4 | export 'int_selector.dart';
5 | export 'list_selector.dart';
6 | export 'num_selector.dart';
7 | export 'object_selector.dart';
8 | export 'string_selector.dart';
9 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/int_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class IntSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is int) {
8 | return Field(name: key, type: FieldType.int, rawValue: value);
9 | }
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/list_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class ListSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is List) {
8 | return Field(name: key, type: FieldType.list, rawValue: value);
9 | }
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/num_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class NumSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is num) {
8 | return Field(name: key, type: FieldType.num, rawValue: value);
9 | }
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/object_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class ObjectSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is Map) {
8 | return Field(name: key, type: FieldType.object, rawValue: value);
9 | }
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/string_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'ISelector.dart';
3 |
4 | class StringSelector implements ISelector {
5 | @override
6 | Field? select(String key, dynamic value) {
7 | if (value is String) {
8 | return Field(name: key, type: FieldType.string, rawValue: value);
9 | }
10 | return null;
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/lib/converter/src/type_selector/type_selector.dart:
--------------------------------------------------------------------------------
1 | import '../field.dart';
2 | import 'index.dart';
3 |
4 | class TypeSelector {
5 | static select(String key, dynamic value) {
6 | final selectors = [
7 | () => BoolSelector().select(key, value),
8 | () => IntSelector().select(key, value),
9 | () => NumSelector().select(key, value),
10 | () => DateSelector().select(key, value),
11 | () => StringSelector().select(key, value),
12 | () => ListSelector().select(key, value),
13 | () => ObjectSelector().select(key, value),
14 | ];
15 |
16 | return _getFieldFromSelectors(selectors);
17 | }
18 |
19 | static Field? _getFieldFromSelectors(List arr) {
20 | for (final selectCallback in arr) {
21 | final field = selectCallback.call();
22 | if (field != null) {
23 | return field;
24 | }
25 | }
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/lib/firebase_options.dart:
--------------------------------------------------------------------------------
1 | // File generated by FlutterFire CLI.
2 | // ignore_for_file: lines_longer_than_80_chars
3 | import 'package:firebase_core/firebase_core.dart' show FirebaseOptions;
4 | import 'package:flutter/foundation.dart'
5 | show defaultTargetPlatform, kIsWeb, TargetPlatform;
6 |
7 | /// Default [FirebaseOptions] for use with your Firebase apps.
8 | ///
9 | /// Example:
10 | /// ```dart
11 | /// import 'firebase_options.dart';
12 | /// // ...
13 | /// await Firebase.initializeApp(
14 | /// options: DefaultFirebaseOptions.currentPlatform,
15 | /// );
16 | /// ```
17 | class DefaultFirebaseOptions {
18 | static FirebaseOptions get currentPlatform {
19 | if (kIsWeb) {
20 | return web;
21 | }
22 | // ignore: missing_enum_constant_in_switch
23 | switch (defaultTargetPlatform) {
24 | case TargetPlatform.android:
25 | throw UnsupportedError(
26 | 'DefaultFirebaseOptions have not been configured for android - '
27 | 'you can reconfigure this by running the FlutterFire CLI again.',
28 | );
29 | case TargetPlatform.iOS:
30 | throw UnsupportedError(
31 | 'DefaultFirebaseOptions have not been configured for ios - '
32 | 'you can reconfigure this by running the FlutterFire CLI again.',
33 | );
34 | case TargetPlatform.macOS:
35 | throw UnsupportedError(
36 | 'DefaultFirebaseOptions have not been configured for macos - '
37 | 'you can reconfigure this by running the FlutterFire CLI again.',
38 | );
39 | }
40 |
41 | throw UnsupportedError(
42 | 'DefaultFirebaseOptions are not supported for this platform.',
43 | );
44 | }
45 |
46 | static const FirebaseOptions web = FirebaseOptions(
47 | apiKey: '',
48 | appId: '',
49 | messagingSenderId: '',
50 | projectId: '',
51 | authDomain: '',
52 | storageBucket: '',
53 | measurementId: '',
54 | );
55 | }
56 |
--------------------------------------------------------------------------------
/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:firebase_core/firebase_core.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:json2dart_gen/ui/home.dart';
4 |
5 | import 'firebase_options.dart';
6 |
7 | void main() async {
8 | WidgetsFlutterBinding.ensureInitialized();
9 | await Firebase.initializeApp(
10 | options: DefaultFirebaseOptions.currentPlatform,
11 | );
12 | runApp(const MyApp());
13 | }
14 |
15 | class MyApp extends StatelessWidget {
16 | const MyApp({Key? key}) : super(key: key);
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return MaterialApp(
21 | title: 'Flutter | Dart 💪 json2dart_gen',
22 | debugShowCheckedModeBanner: false,
23 | theme: ThemeData(
24 | primarySwatch: const MaterialColor(
25 | 0xFF6667AB,
26 | {
27 | 50: Color(0xFF6667AB),
28 | 100: Color(0xFF6667AB),
29 | 200: Color(0xFF6667AB),
30 | 300: Color(0xFF6667AB),
31 | 400: Color(0xFF6667AB),
32 | 500: Color(0xFF6667AB),
33 | 600: Color(0xFF6667AB),
34 | 700: Color(0xFF6667AB),
35 | 800: Color(0xFF6667AB),
36 | 900: Color(0xFF6667AB),
37 | },
38 | ),
39 | ),
40 | home: const HomeView(),
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/lib/ui/code_section.dart:
--------------------------------------------------------------------------------
1 | import 'package:dart_pad_widget/dart_pad_widget.dart';
2 | import 'package:firebase_analytics/firebase_analytics.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:json2dart_gen/converter/json2dart_gen.dart';
5 |
6 | class CodeSection extends StatefulWidget {
7 | const CodeSection({Key? key}) : super(key: key);
8 |
9 | @override
10 | State createState() => _CodeSectionState();
11 | }
12 |
13 | class _CodeSectionState extends State {
14 | FirebaseAnalytics analytics = FirebaseAnalytics.instance;
15 |
16 | final jsonHintText =
17 | '{\n "id": 1,\n "name": "Ahmet Çelik",\n "exp": 0.7,\n "isOnline": true,\n "account": [\n {\n "key": "twitter",\n "username": "ahm3tcelik72",\n "createAt": "2018-04-23T18:25:43.511Z"\n }\n ],\n "address": {\n "country": "Turkey",\n "city": "Batman"\n }\n}';
18 |
19 | final classNameController = TextEditingController();
20 | final jsonController = TextEditingController();
21 |
22 | String codeResult = '';
23 |
24 | @override
25 | void initState() {
26 | classNameController.text = 'User';
27 | jsonController.text = jsonHintText;
28 | codeResult = Converter.convert('User', jsonHintText);
29 | super.initState();
30 | }
31 |
32 | void onClickConvert() {
33 | if (jsonController.text.trim().isNotEmpty &&
34 | classNameController.text.trim().isNotEmpty) {
35 | final code =
36 | Converter.convert(classNameController.text, jsonController.text);
37 |
38 | analytics.logEvent(name: 'CONVERT_JSON', parameters: {
39 | 'className': classNameController.text,
40 | 'input': jsonController.text,
41 | 'output': code
42 | });
43 |
44 | setState(() {
45 | codeResult = code;
46 | });
47 | }
48 | }
49 |
50 | @override
51 | Widget build(BuildContext context) {
52 | return Row(
53 | mainAxisAlignment: MainAxisAlignment.start,
54 | crossAxisAlignment: CrossAxisAlignment.start,
55 | children: [
56 | Expanded(
57 | flex: 1,
58 | child: Padding(
59 | padding: const EdgeInsets.all(12),
60 | child: Column(
61 | crossAxisAlignment: CrossAxisAlignment.stretch,
62 | children: [
63 | _buildJsonField(),
64 | const SizedBox(height: 12),
65 | _buildClassNameField(),
66 | const SizedBox(height: 12),
67 | ElevatedButton(
68 | onPressed: onClickConvert,
69 | child: const Text('Convert'),
70 | )
71 | ],
72 | ),
73 | ),
74 | ),
75 | const VerticalDivider(),
76 | Expanded(
77 | flex: 3,
78 | child: Container(
79 | padding: const EdgeInsets.all(12),
80 | child: _buildEditor(context),
81 | ),
82 | ),
83 | ],
84 | );
85 | }
86 |
87 | Widget _buildEditor(BuildContext context) {
88 | return DartPad(
89 | key: Key(DateTime.now().toString()),
90 | embeddingChoice: EmbeddingChoice.inline,
91 | darkMode: false,
92 | nullSafety: true,
93 | runImmediately: false,
94 | width: MediaQuery.of(context).size.width * .7,
95 | height: 800,
96 | code: codeResult,
97 | );
98 | }
99 |
100 | TextField _buildClassNameField() {
101 | return TextField(
102 | controller: classNameController,
103 | enableSuggestions: false,
104 | decoration: const InputDecoration(
105 | hintText: 'Class Name',
106 | border: OutlineInputBorder(),
107 | contentPadding: EdgeInsets.symmetric(horizontal: 12, vertical: 12),
108 | ),
109 | );
110 | }
111 |
112 | TextField _buildJsonField() {
113 | return TextField(
114 | controller: jsonController,
115 | enableSuggestions: false,
116 | decoration: InputDecoration(
117 | hintText: jsonHintText,
118 | border: const OutlineInputBorder(),
119 | contentPadding:
120 | const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
121 | ),
122 | minLines: 4,
123 | maxLines: 300,
124 | );
125 | }
126 | }
127 |
--------------------------------------------------------------------------------
/lib/ui/home.dart:
--------------------------------------------------------------------------------
1 | import 'dart:js' as js;
2 |
3 | import 'package:firebase_analytics/firebase_analytics.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_svg/svg.dart';
6 |
7 | import 'code_section.dart';
8 |
9 | class HomeView extends StatefulWidget {
10 | const HomeView({Key? key}) : super(key: key);
11 |
12 | @override
13 | _HomeViewState createState() => _HomeViewState();
14 | }
15 |
16 | class _HomeViewState extends State {
17 | FirebaseAnalytics analytics = FirebaseAnalytics.instance;
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Scaffold(
22 | appBar: AppBar(
23 | title: const Text('json2dart_gen'),
24 | actions: [_buildTwitterButton(), _buildGithubButton()],
25 | ),
26 | body: const SingleChildScrollView(child: CodeSection()),
27 | );
28 | }
29 |
30 | IconButton _buildGithubButton() {
31 | return IconButton(
32 | onPressed: () {
33 | analytics.logEvent(name: 'VIEW_GITHUB');
34 | js.context.callMethod(
35 | 'open', ['https://github.com/ahm3tcelik/json2dart_gen']);
36 | },
37 | icon: SvgPicture.asset(
38 | 'assets/ic_github.svg',
39 | color: Colors.white,
40 | height: 30,
41 | width: 30,
42 | ),
43 | iconSize: 30,
44 | splashRadius: 30,
45 | );
46 | }
47 |
48 | IconButton _buildTwitterButton() {
49 | return IconButton(
50 | onPressed: () {
51 | analytics.logEvent(name: 'VIEW_TWITTER');
52 | js.context.callMethod('open', ['https://twitter.com/ahm3tcelik72']);
53 | },
54 | icon: SvgPicture.asset(
55 | 'assets/ic_twitter.svg',
56 | color: Colors.white,
57 | height: 30,
58 | width: 30,
59 | ),
60 | iconSize: 30,
61 | splashRadius: 30,
62 | );
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/public/.last_build_id:
--------------------------------------------------------------------------------
1 | a168623bec978def21c6dd5a9a300c44
--------------------------------------------------------------------------------
/public/4f2a58af27abc49ecf55570043bbf938.cache.dill.track.dill:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/4f2a58af27abc49ecf55570043bbf938.cache.dill.track.dill
--------------------------------------------------------------------------------
/public/assets/AssetManifest.json:
--------------------------------------------------------------------------------
1 | {"assets/ic_github.svg":["assets/ic_github.svg"],"assets/ic_twitter.svg":["assets/ic_twitter.svg"]}
--------------------------------------------------------------------------------
/public/assets/FontManifest.json:
--------------------------------------------------------------------------------
1 | [{"family":"MaterialIcons","fonts":[{"asset":"fonts/MaterialIcons-Regular.otf"}]}]
--------------------------------------------------------------------------------
/public/assets/assets/ic_github.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/assets/ic_twitter.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/assets/fonts/MaterialIcons-Regular.otf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/assets/fonts/MaterialIcons-Regular.otf
--------------------------------------------------------------------------------
/public/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/favicon.png
--------------------------------------------------------------------------------
/public/flutter_service_worker.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 | const MANIFEST = 'flutter-app-manifest';
3 | const TEMP = 'flutter-temp-cache';
4 | const CACHE_NAME = 'flutter-app-cache';
5 | const RESOURCES = {
6 | "version.json": "cdfffba45c7057d45b84465a407e4071",
7 | "index.html": "8db23dedecde401dd41e44b0e95f5596",
8 | "/": "8db23dedecde401dd41e44b0e95f5596",
9 | "main.dart.js": "7109f50e53cb7063a22c6e693ba83453",
10 | "favicon.png": "5dcef449791fa27946b3d35ad8803796",
11 | "icons/Icon-192.png": "ac9a721a12bbc803b44f645561ecb1e1",
12 | "icons/Icon-maskable-192.png": "c457ef57daa1d16f64b27b786ec2ea3c",
13 | "icons/Icon-maskable-512.png": "301a7604d45b3e739efc881eb04896ea",
14 | "icons/Icon-512.png": "96e752610906ba2a93c65f8abe1645f1",
15 | "manifest.json": "ae737faf7b63578fc3bb105cd898a2a2",
16 | "assets/AssetManifest.json": "15b2dc219876f86ed7c132ae25134e74",
17 | "assets/NOTICES": "163cf8ff72baa7fb43101836f7da8ce7",
18 | "assets/FontManifest.json": "7b2a36307916a9721811788013e65289",
19 | "assets/fonts/MaterialIcons-Regular.otf": "4e6447691c9509f7acdbf8a931a85ca1",
20 | "assets/assets/ic_twitter.svg": "cd3f49aee1187e30d4bd7b6a6cb3291a",
21 | "assets/assets/ic_github.svg": "94d42f49ed3407a9c3a3b2cf1d14eb1b"
22 | };
23 |
24 | // The application shell files that are downloaded before a service worker can
25 | // start.
26 | const CORE = [
27 | "/",
28 | "main.dart.js",
29 | "index.html",
30 | "assets/NOTICES",
31 | "assets/AssetManifest.json",
32 | "assets/FontManifest.json"];
33 | // During install, the TEMP cache is populated with the application shell files.
34 | self.addEventListener("install", (event) => {
35 | self.skipWaiting();
36 | return event.waitUntil(
37 | caches.open(TEMP).then((cache) => {
38 | return cache.addAll(
39 | CORE.map((value) => new Request(value, {'cache': 'reload'})));
40 | })
41 | );
42 | });
43 |
44 | // During activate, the cache is populated with the temp files downloaded in
45 | // install. If this service worker is upgrading from one with a saved
46 | // MANIFEST, then use this to retain unchanged resource files.
47 | self.addEventListener("activate", function(event) {
48 | return event.waitUntil(async function() {
49 | try {
50 | var contentCache = await caches.open(CACHE_NAME);
51 | var tempCache = await caches.open(TEMP);
52 | var manifestCache = await caches.open(MANIFEST);
53 | var manifest = await manifestCache.match('manifest');
54 | // When there is no prior manifest, clear the entire cache.
55 | if (!manifest) {
56 | await caches.delete(CACHE_NAME);
57 | contentCache = await caches.open(CACHE_NAME);
58 | for (var request of await tempCache.keys()) {
59 | var response = await tempCache.match(request);
60 | await contentCache.put(request, response);
61 | }
62 | await caches.delete(TEMP);
63 | // Save the manifest to make future upgrades efficient.
64 | await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
65 | return;
66 | }
67 | var oldManifest = await manifest.json();
68 | var origin = self.location.origin;
69 | for (var request of await contentCache.keys()) {
70 | var key = request.url.substring(origin.length + 1);
71 | if (key == "") {
72 | key = "/";
73 | }
74 | // If a resource from the old manifest is not in the new cache, or if
75 | // the MD5 sum has changed, delete it. Otherwise the resource is left
76 | // in the cache and can be reused by the new service worker.
77 | if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
78 | await contentCache.delete(request);
79 | }
80 | }
81 | // Populate the cache with the app shell TEMP files, potentially overwriting
82 | // cache files preserved above.
83 | for (var request of await tempCache.keys()) {
84 | var response = await tempCache.match(request);
85 | await contentCache.put(request, response);
86 | }
87 | await caches.delete(TEMP);
88 | // Save the manifest to make future upgrades efficient.
89 | await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
90 | return;
91 | } catch (err) {
92 | // On an unhandled exception the state of the cache cannot be guaranteed.
93 | console.error('Failed to upgrade service worker: ' + err);
94 | await caches.delete(CACHE_NAME);
95 | await caches.delete(TEMP);
96 | await caches.delete(MANIFEST);
97 | }
98 | }());
99 | });
100 |
101 | // The fetch handler redirects requests for RESOURCE files to the service
102 | // worker cache.
103 | self.addEventListener("fetch", (event) => {
104 | if (event.request.method !== 'GET') {
105 | return;
106 | }
107 | var origin = self.location.origin;
108 | var key = event.request.url.substring(origin.length + 1);
109 | // Redirect URLs to the index.html
110 | if (key.indexOf('?v=') != -1) {
111 | key = key.split('?v=')[0];
112 | }
113 | if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
114 | key = '/';
115 | }
116 | // If the URL is not the RESOURCE list then return to signal that the
117 | // browser should take over.
118 | if (!RESOURCES[key]) {
119 | return;
120 | }
121 | // If the URL is the index.html, perform an online-first request.
122 | if (key == '/') {
123 | return onlineFirst(event);
124 | }
125 | event.respondWith(caches.open(CACHE_NAME)
126 | .then((cache) => {
127 | return cache.match(event.request).then((response) => {
128 | // Either respond with the cached resource, or perform a fetch and
129 | // lazily populate the cache.
130 | return response || fetch(event.request).then((response) => {
131 | cache.put(event.request, response.clone());
132 | return response;
133 | });
134 | })
135 | })
136 | );
137 | });
138 |
139 | self.addEventListener('message', (event) => {
140 | // SkipWaiting can be used to immediately activate a waiting service worker.
141 | // This will also require a page refresh triggered by the main worker.
142 | if (event.data === 'skipWaiting') {
143 | self.skipWaiting();
144 | return;
145 | }
146 | if (event.data === 'downloadOffline') {
147 | downloadOffline();
148 | return;
149 | }
150 | });
151 |
152 | // Download offline will check the RESOURCES for all files not in the cache
153 | // and populate them.
154 | async function downloadOffline() {
155 | var resources = [];
156 | var contentCache = await caches.open(CACHE_NAME);
157 | var currentContent = {};
158 | for (var request of await contentCache.keys()) {
159 | var key = request.url.substring(origin.length + 1);
160 | if (key == "") {
161 | key = "/";
162 | }
163 | currentContent[key] = true;
164 | }
165 | for (var resourceKey of Object.keys(RESOURCES)) {
166 | if (!currentContent[resourceKey]) {
167 | resources.push(resourceKey);
168 | }
169 | }
170 | return contentCache.addAll(resources);
171 | }
172 |
173 | // Attempt to download the resource online before falling back to
174 | // the offline cache.
175 | function onlineFirst(event) {
176 | return event.respondWith(
177 | fetch(event.request).then((response) => {
178 | return caches.open(CACHE_NAME).then((cache) => {
179 | cache.put(event.request, response.clone());
180 | return response;
181 | });
182 | }).catch((error) => {
183 | return caches.open(CACHE_NAME).then((cache) => {
184 | return cache.match(event.request).then((response) => {
185 | if (response != null) {
186 | return response;
187 | }
188 | throw error;
189 | });
190 | });
191 | })
192 | );
193 | }
194 |
--------------------------------------------------------------------------------
/public/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/icons/Icon-192.png
--------------------------------------------------------------------------------
/public/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/icons/Icon-512.png
--------------------------------------------------------------------------------
/public/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/public/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/public/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/public/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | json2dart_gen
33 |
34 |
35 |
36 |
39 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/public/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "json2dart_gen",
3 | "short_name": "json2dart_gen",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/public/version.json:
--------------------------------------------------------------------------------
1 | {"app_name":"json2dart_gen","version":"1.0.0","build_number":"1","package_name":"json2dart_gen"}
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | _fe_analyzer_shared:
5 | dependency: transitive
6 | description:
7 | name: _fe_analyzer_shared
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "32.0.0"
11 | analyzer:
12 | dependency: transitive
13 | description:
14 | name: analyzer
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "3.0.0"
18 | args:
19 | dependency: transitive
20 | description:
21 | name: args
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "2.3.0"
25 | async:
26 | dependency: transitive
27 | description:
28 | name: async
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.8.2"
32 | boolean_selector:
33 | dependency: transitive
34 | description:
35 | name: boolean_selector
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "2.1.0"
39 | characters:
40 | dependency: transitive
41 | description:
42 | name: characters
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.2.0"
46 | charcode:
47 | dependency: transitive
48 | description:
49 | name: charcode
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.3.1"
53 | cli_util:
54 | dependency: transitive
55 | description:
56 | name: cli_util
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "0.3.5"
60 | clock:
61 | dependency: transitive
62 | description:
63 | name: clock
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "1.1.0"
67 | collection:
68 | dependency: transitive
69 | description:
70 | name: collection
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "1.15.0"
74 | convert:
75 | dependency: transitive
76 | description:
77 | name: convert
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "3.0.1"
81 | crypto:
82 | dependency: transitive
83 | description:
84 | name: crypto
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "3.0.1"
88 | dart_pad_widget:
89 | dependency: "direct main"
90 | description:
91 | name: dart_pad_widget
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "2.1.0"
95 | dart_style:
96 | dependency: transitive
97 | description:
98 | name: dart_style
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "2.2.1"
102 | dart_writer:
103 | dependency: "direct main"
104 | description:
105 | name: dart_writer
106 | url: "https://pub.dartlang.org"
107 | source: hosted
108 | version: "0.0.1"
109 | fake_async:
110 | dependency: transitive
111 | description:
112 | name: fake_async
113 | url: "https://pub.dartlang.org"
114 | source: hosted
115 | version: "1.2.0"
116 | file:
117 | dependency: transitive
118 | description:
119 | name: file
120 | url: "https://pub.dartlang.org"
121 | source: hosted
122 | version: "6.1.2"
123 | firebase_analytics:
124 | dependency: "direct main"
125 | description:
126 | name: firebase_analytics
127 | url: "https://pub.dartlang.org"
128 | source: hosted
129 | version: "9.1.0"
130 | firebase_analytics_platform_interface:
131 | dependency: transitive
132 | description:
133 | name: firebase_analytics_platform_interface
134 | url: "https://pub.dartlang.org"
135 | source: hosted
136 | version: "3.0.5"
137 | firebase_analytics_web:
138 | dependency: transitive
139 | description:
140 | name: firebase_analytics_web
141 | url: "https://pub.dartlang.org"
142 | source: hosted
143 | version: "0.4.0+6"
144 | firebase_core:
145 | dependency: "direct main"
146 | description:
147 | name: firebase_core
148 | url: "https://pub.dartlang.org"
149 | source: hosted
150 | version: "1.12.0"
151 | firebase_core_platform_interface:
152 | dependency: transitive
153 | description:
154 | name: firebase_core_platform_interface
155 | url: "https://pub.dartlang.org"
156 | source: hosted
157 | version: "4.2.4"
158 | firebase_core_web:
159 | dependency: transitive
160 | description:
161 | name: firebase_core_web
162 | url: "https://pub.dartlang.org"
163 | source: hosted
164 | version: "1.5.4"
165 | flutter:
166 | dependency: "direct main"
167 | description: flutter
168 | source: sdk
169 | version: "0.0.0"
170 | flutter_lints:
171 | dependency: "direct dev"
172 | description:
173 | name: flutter_lints
174 | url: "https://pub.dartlang.org"
175 | source: hosted
176 | version: "1.0.4"
177 | flutter_svg:
178 | dependency: "direct main"
179 | description:
180 | name: flutter_svg
181 | url: "https://pub.dartlang.org"
182 | source: hosted
183 | version: "1.0.3"
184 | flutter_test:
185 | dependency: "direct dev"
186 | description: flutter
187 | source: sdk
188 | version: "0.0.0"
189 | flutter_web_plugins:
190 | dependency: transitive
191 | description: flutter
192 | source: sdk
193 | version: "0.0.0"
194 | glob:
195 | dependency: transitive
196 | description:
197 | name: glob
198 | url: "https://pub.dartlang.org"
199 | source: hosted
200 | version: "2.0.2"
201 | html_unescape:
202 | dependency: transitive
203 | description:
204 | name: html_unescape
205 | url: "https://pub.dartlang.org"
206 | source: hosted
207 | version: "2.0.0"
208 | js:
209 | dependency: transitive
210 | description:
211 | name: js
212 | url: "https://pub.dartlang.org"
213 | source: hosted
214 | version: "0.6.3"
215 | lints:
216 | dependency: transitive
217 | description:
218 | name: lints
219 | url: "https://pub.dartlang.org"
220 | source: hosted
221 | version: "1.0.1"
222 | matcher:
223 | dependency: transitive
224 | description:
225 | name: matcher
226 | url: "https://pub.dartlang.org"
227 | source: hosted
228 | version: "0.12.11"
229 | meta:
230 | dependency: transitive
231 | description:
232 | name: meta
233 | url: "https://pub.dartlang.org"
234 | source: hosted
235 | version: "1.7.0"
236 | package_config:
237 | dependency: transitive
238 | description:
239 | name: package_config
240 | url: "https://pub.dartlang.org"
241 | source: hosted
242 | version: "2.0.2"
243 | path:
244 | dependency: transitive
245 | description:
246 | name: path
247 | url: "https://pub.dartlang.org"
248 | source: hosted
249 | version: "1.8.0"
250 | path_drawing:
251 | dependency: transitive
252 | description:
253 | name: path_drawing
254 | url: "https://pub.dartlang.org"
255 | source: hosted
256 | version: "1.0.0"
257 | path_parsing:
258 | dependency: transitive
259 | description:
260 | name: path_parsing
261 | url: "https://pub.dartlang.org"
262 | source: hosted
263 | version: "1.0.0"
264 | petitparser:
265 | dependency: transitive
266 | description:
267 | name: petitparser
268 | url: "https://pub.dartlang.org"
269 | source: hosted
270 | version: "4.4.0"
271 | plugin_platform_interface:
272 | dependency: transitive
273 | description:
274 | name: plugin_platform_interface
275 | url: "https://pub.dartlang.org"
276 | source: hosted
277 | version: "2.1.2"
278 | pub_semver:
279 | dependency: transitive
280 | description:
281 | name: pub_semver
282 | url: "https://pub.dartlang.org"
283 | source: hosted
284 | version: "2.1.0"
285 | sky_engine:
286 | dependency: transitive
287 | description: flutter
288 | source: sdk
289 | version: "0.0.99"
290 | source_span:
291 | dependency: transitive
292 | description:
293 | name: source_span
294 | url: "https://pub.dartlang.org"
295 | source: hosted
296 | version: "1.8.1"
297 | stack_trace:
298 | dependency: transitive
299 | description:
300 | name: stack_trace
301 | url: "https://pub.dartlang.org"
302 | source: hosted
303 | version: "1.10.0"
304 | stream_channel:
305 | dependency: transitive
306 | description:
307 | name: stream_channel
308 | url: "https://pub.dartlang.org"
309 | source: hosted
310 | version: "2.1.0"
311 | string_scanner:
312 | dependency: transitive
313 | description:
314 | name: string_scanner
315 | url: "https://pub.dartlang.org"
316 | source: hosted
317 | version: "1.1.0"
318 | term_glyph:
319 | dependency: transitive
320 | description:
321 | name: term_glyph
322 | url: "https://pub.dartlang.org"
323 | source: hosted
324 | version: "1.2.0"
325 | test_api:
326 | dependency: transitive
327 | description:
328 | name: test_api
329 | url: "https://pub.dartlang.org"
330 | source: hosted
331 | version: "0.4.3"
332 | typed_data:
333 | dependency: transitive
334 | description:
335 | name: typed_data
336 | url: "https://pub.dartlang.org"
337 | source: hosted
338 | version: "1.3.0"
339 | vector_math:
340 | dependency: transitive
341 | description:
342 | name: vector_math
343 | url: "https://pub.dartlang.org"
344 | source: hosted
345 | version: "2.1.1"
346 | watcher:
347 | dependency: transitive
348 | description:
349 | name: watcher
350 | url: "https://pub.dartlang.org"
351 | source: hosted
352 | version: "1.0.1"
353 | xml:
354 | dependency: transitive
355 | description:
356 | name: xml
357 | url: "https://pub.dartlang.org"
358 | source: hosted
359 | version: "5.3.1"
360 | yaml:
361 | dependency: transitive
362 | description:
363 | name: yaml
364 | url: "https://pub.dartlang.org"
365 | source: hosted
366 | version: "3.1.0"
367 | sdks:
368 | dart: ">=2.14.0 <3.0.0"
369 | flutter: ">=2.4.0-0.0.pre"
370 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: json2dart_gen
2 | description: Json to Dart Converter
3 |
4 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
5 |
6 | version: 1.0.0+1
7 |
8 | environment:
9 | sdk: ">=2.12.0 <3.0.0"
10 |
11 | dependencies:
12 | flutter:
13 | sdk: flutter
14 |
15 | dart_writer: ^0.0.1
16 | dart_pad_widget: ^2.1.0
17 | flutter_svg: ^1.0.3
18 | firebase_core: ^1.12.0
19 | firebase_analytics: ^9.1.0
20 |
21 | dev_dependencies:
22 | flutter_test:
23 | sdk: flutter
24 |
25 | flutter_lints: ^1.0.0
26 |
27 | flutter:
28 | uses-material-design: true
29 | assets:
30 | - assets/
--------------------------------------------------------------------------------
/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | import 'package:flutter/material.dart';
9 | import 'package:flutter_test/flutter_test.dart';
10 |
11 | import 'package:json2dart_gen/main.dart';
12 |
13 | void main() {
14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // Build our app and trigger a frame.
16 | await tester.pumpWidget(const MyApp());
17 |
18 | // Verify that our counter starts at 0.
19 | expect(find.text('0'), findsOneWidget);
20 | expect(find.text('1'), findsNothing);
21 |
22 | // Tap the '+' icon and trigger a frame.
23 | await tester.tap(find.byIcon(Icons.add));
24 | await tester.pump();
25 |
26 | // Verify that our counter has incremented.
27 | expect(find.text('0'), findsNothing);
28 | expect(find.text('1'), findsOneWidget);
29 | });
30 | }
31 |
--------------------------------------------------------------------------------
/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/web/favicon.png
--------------------------------------------------------------------------------
/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ahm3tcelik/json2dart_gen/04ab0b6ffca36726e0e05e15d6c5ccf3186aa09e/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/web/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 | json2dart_gen
33 |
34 |
35 |
36 |
39 |
103 |
104 |
105 |
--------------------------------------------------------------------------------
/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "json2dart_gen",
3 | "short_name": "json2dart_gen",
4 | "start_url": ".",
5 | "display": "standalone",
6 | "background_color": "#0175C2",
7 | "theme_color": "#0175C2",
8 | "description": "A new Flutter project.",
9 | "orientation": "portrait-primary",
10 | "prefer_related_applications": false,
11 | "icons": [
12 | {
13 | "src": "icons/Icon-192.png",
14 | "sizes": "192x192",
15 | "type": "image/png"
16 | },
17 | {
18 | "src": "icons/Icon-512.png",
19 | "sizes": "512x512",
20 | "type": "image/png"
21 | },
22 | {
23 | "src": "icons/Icon-maskable-192.png",
24 | "sizes": "192x192",
25 | "type": "image/png",
26 | "purpose": "maskable"
27 | },
28 | {
29 | "src": "icons/Icon-maskable-512.png",
30 | "sizes": "512x512",
31 | "type": "image/png",
32 | "purpose": "maskable"
33 | }
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------