├── .firebaserc
├── .github
└── FUNDING.yml
├── .gitignore
├── .metadata
├── CHANGELOG.md
├── LICENSE
├── README.md
├── analysis_options.yaml
├── android
├── .gitignore
├── build.gradle
├── settings.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── kotlin
│ └── com
│ └── mono0926
│ └── mono_kit
│ └── MonoKitPlugin.kt
├── devtools_options.yaml
├── example
├── .gitignore
├── .metadata
├── README.md
├── analysis_options.yaml
├── android
│ ├── .gitignore
│ ├── app
│ │ ├── build.gradle.kts
│ │ └── src
│ │ │ ├── debug
│ │ │ └── AndroidManifest.xml
│ │ │ ├── main
│ │ │ ├── AndroidManifest.xml
│ │ │ ├── kotlin
│ │ │ │ └── com
│ │ │ │ │ └── mono0926
│ │ │ │ │ └── example
│ │ │ │ │ └── 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.kts
│ ├── gradle.properties
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ └── settings.gradle.kts
├── assets
│ └── images
│ │ └── love.png
├── ios
│ ├── .gitignore
│ ├── Flutter
│ │ ├── AppFrameworkInfo.plist
│ │ ├── Debug.xcconfig
│ │ └── Release.xcconfig
│ ├── Podfile
│ ├── Podfile.lock
│ ├── 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
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── lib
│ ├── app.dart
│ ├── main.dart
│ ├── pages
│ │ ├── app_bottom_area_page.dart
│ │ ├── banner_visibility_page.dart
│ │ ├── barrier_page.dart
│ │ ├── better_placeholder_page.dart
│ │ ├── color_ex_page.dart
│ │ ├── debug_padding_page.dart
│ │ ├── delayed_pop_scope_page.dart
│ │ ├── home_page.dart
│ │ ├── lifecycle_observer_page.dart
│ │ ├── list_tile_selected_background_colored_box_page.dart
│ │ ├── loading_switcher_page.dart
│ │ ├── max_width_padding_builder_page.dart
│ │ ├── not_found.page.dart
│ │ ├── overflow_detectable_text_page
│ │ │ ├── cell.dart
│ │ │ ├── data.dart
│ │ │ └── overflow_detectable_text_page.dart
│ │ ├── pages.dart
│ │ ├── paging_scroll_page.dart
│ │ ├── snack_bar_page.dart
│ │ ├── unfocus_on_tap_page.dart
│ │ └── vertical_center_scroll_view_page.dart
│ ├── router
│ │ ├── router.dart
│ │ └── router.g.dart
│ └── util
│ │ ├── logger.dart
│ │ └── util.dart
├── macos
│ ├── .gitignore
│ ├── Flutter
│ │ ├── Flutter-Debug.xcconfig
│ │ ├── Flutter-Release.xcconfig
│ │ └── GeneratedPluginRegistrant.swift
│ ├── Podfile
│ ├── Podfile.lock
│ ├── Runner.xcodeproj
│ │ ├── project.pbxproj
│ │ ├── project.xcworkspace
│ │ │ └── xcshareddata
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ └── xcshareddata
│ │ │ └── xcschemes
│ │ │ └── Runner.xcscheme
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner
│ │ ├── AppDelegate.swift
│ │ ├── Assets.xcassets
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Contents.json
│ │ │ │ ├── app_icon_1024.png
│ │ │ │ ├── app_icon_128.png
│ │ │ │ ├── app_icon_16.png
│ │ │ │ ├── app_icon_256.png
│ │ │ │ ├── app_icon_32.png
│ │ │ │ ├── app_icon_512.png
│ │ │ │ └── app_icon_64.png
│ │ ├── Base.lproj
│ │ │ └── MainMenu.xib
│ │ ├── Configs
│ │ │ ├── AppInfo.xcconfig
│ │ │ ├── Debug.xcconfig
│ │ │ ├── Release.xcconfig
│ │ │ └── Warnings.xcconfig
│ │ ├── DebugProfile.entitlements
│ │ ├── Info.plist
│ │ ├── MainFlutterWindow.swift
│ │ └── Release.entitlements
│ └── RunnerTests
│ │ └── RunnerTests.swift
├── 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
└── windows
│ ├── .gitignore
│ ├── CMakeLists.txt
│ ├── flutter
│ ├── CMakeLists.txt
│ ├── generated_plugin_registrant.cc
│ ├── generated_plugin_registrant.h
│ └── generated_plugins.cmake
│ └── runner
│ ├── CMakeLists.txt
│ ├── Runner.rc
│ ├── flutter_window.cpp
│ ├── flutter_window.h
│ ├── main.cpp
│ ├── resource.h
│ ├── resources
│ └── app_icon.ico
│ ├── runner.exe.manifest
│ ├── utils.cpp
│ ├── utils.h
│ ├── win32_window.cpp
│ └── win32_window.h
├── firebase.json
├── ios
├── .gitignore
├── Assets
│ └── .gitkeep
├── Classes
│ ├── MonoKitPlugin.h
│ ├── MonoKitPlugin.m
│ └── SwiftMonoKitPlugin.swift
└── mono_kit.podspec
├── lib
├── errors
│ ├── errors.dart
│ └── unexpected_error.dart
├── extensions
│ ├── color.dart
│ ├── enum.dart
│ ├── extensions.dart
│ ├── iterable.dart
│ ├── navigator_state.dart
│ ├── scaffold_messenger_state.dart
│ ├── state_notifier.dart
│ ├── string.dart
│ └── theme_data.dart
├── functions
│ ├── functions.dart
│ ├── show_error_dialog.dart
│ └── show_photo_selection_sheet.dart
├── mono_kit.dart
├── plugins
│ ├── app_installation_checker.dart
│ ├── ios_info_plist_reader.dart
│ └── plugins.dart
├── routes
│ ├── bottom_popup_route.dart
│ ├── fade_page_route.dart
│ ├── modal_page_route.dart
│ └── routes.dart
├── utils
│ ├── build_mode.dart
│ ├── hud.dart
│ ├── lifecycle_observer.dart
│ ├── logger.dart
│ ├── paging_scroll_controller.dart
│ └── utils.dart
└── widgets
│ ├── animated_expansion_visibility.dart
│ ├── app_asset_image.dart
│ ├── app_bottom_area.dart
│ ├── barrier.dart
│ ├── better_animated_opacity.dart
│ ├── better_fade_transition.dart
│ ├── better_placeholder.dart
│ ├── better_stream_builder.dart
│ ├── centered_max_width.dart
│ ├── debug_padding.dart
│ ├── delayed_pop_scope.dart
│ ├── device_frame.dart
│ ├── go_router_location_button.dart
│ ├── itemized_text.dart
│ ├── link_text_span.dart
│ ├── list_section.dart
│ ├── list_section_header.dart
│ ├── list_tile_selected_background_colored_box.dart
│ ├── listener
│ ├── listener.dart
│ ├── listener_text.dart
│ └── listener_visibility.dart
│ ├── loading_switcher.dart
│ ├── max_width_padding_builder.dart
│ ├── overflow_detectable_text.dart
│ ├── ripple_effect_button.dart
│ ├── scroll_keyboard_shortcut.dart
│ ├── size_listener.dart
│ ├── text_scale_factor.dart
│ ├── tile_padding.dart
│ ├── timeout_switcher.dart
│ ├── unfocus_on_tap.dart
│ ├── value_observable_builder.dart
│ ├── vertical_center_scroll_view.dart
│ ├── widgets.dart
│ └── wip.dart
├── macos
├── Classes
│ └── MonoKitPlugin.swift
└── mono_kit.podspec
├── packages
└── subscription_holder
│ ├── .gitignore
│ ├── .metadata
│ ├── CHANGELOG.md
│ ├── LICENSE
│ ├── README.md
│ ├── lib
│ ├── src
│ │ ├── subscription_holder.dart
│ │ └── subscription_holder_mixin.dart
│ └── subscription_holder.dart
│ ├── pubspec.lock
│ ├── pubspec.yaml
│ └── test
│ └── subscription_holder_test.dart
├── pubspec.lock
├── pubspec.yaml
├── test
├── extensions
│ └── iterable_test.dart
├── mono_kit_test.dart
└── utils
│ └── functions_test.dart
└── tool
└── deploy_web.sh
/.firebaserc:
--------------------------------------------------------------------------------
1 | {
2 | "projects": {
3 | "default": "mono-firebase"
4 | },
5 | "targets": {
6 | "mono-firebase": {
7 | "hosting": {
8 | "mono-kit": [
9 | "mono-kit"
10 | ]
11 | }
12 | }
13 | }
14 | }
15 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | github:
2 | - mono0926
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 | # Visual Studio Code related
19 | .vscode/
20 |
21 | # Flutter/Dart/Pub related
22 | **/doc/api/
23 | .dart_tool/
24 | .flutter-plugins
25 | .packages
26 | .pub-cache/
27 | .pub/
28 | build/
29 |
30 | # Android related
31 | **/android/**/gradle-wrapper.jar
32 | **/android/.gradle
33 | **/android/captures/
34 | **/android/gradlew
35 | **/android/gradlew.bat
36 | **/android/local.properties
37 | **/android/**/GeneratedPluginRegistrant.java
38 |
39 | # iOS/XCode related
40 | **/ios/**/*.mode1v3
41 | **/ios/**/*.mode2v3
42 | **/ios/**/*.moved-aside
43 | **/ios/**/*.pbxuser
44 | **/ios/**/*.perspectivev3
45 | **/ios/**/*sync/
46 | **/ios/**/.sconsign.dblite
47 | **/ios/**/.tags*
48 | **/ios/**/.vagrant/
49 | **/ios/**/DerivedData/
50 | **/ios/**/Icon?
51 | **/ios/**/Pods/
52 | **/ios/**/.symlinks/
53 | **/ios/**/profile
54 | **/ios/**/xcuserdata
55 | **/ios/.generated/
56 | **/ios/Flutter/App.framework
57 | **/ios/Flutter/Flutter.framework
58 | **/ios/Flutter/Generated.xcconfig
59 | **/ios/Flutter/app.flx
60 | **/ios/Flutter/app.zip
61 | **/ios/Flutter/flutter_assets/
62 | **/ios/Flutter/flutter_export_environment.sh
63 | **/ios/ServiceDefinitions.json
64 | **/ios/Runner/GeneratedPluginRegistrant.*
65 |
66 | # Exceptions to above rules.
67 | !**/ios/**/default.mode1v3
68 | !**/ios/**/default.mode2v3
69 | !**/ios/**/default.pbxuser
70 | !**/ios/**/default.perspectivev3
71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
72 | **/ios/Flutter/Flutter.podspec
73 |
74 | generated_plugin_registrant.dart
75 | .flutter-plugins-dependencies
76 | .firebase/
77 |
--------------------------------------------------------------------------------
/.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: "603104015dd692ea3403755b55d07813d5cf8965"
8 | channel: "stable"
9 |
10 | project_type: plugin
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: 603104015dd692ea3403755b55d07813d5cf8965
17 | base_revision: 603104015dd692ea3403755b55d07813d5cf8965
18 | - platform: android
19 | create_revision: 603104015dd692ea3403755b55d07813d5cf8965
20 | base_revision: 603104015dd692ea3403755b55d07813d5cf8965
21 | - platform: ios
22 | create_revision: 603104015dd692ea3403755b55d07813d5cf8965
23 | base_revision: 603104015dd692ea3403755b55d07813d5cf8965
24 |
25 | # User provided section
26 |
27 | # List of Local paths (relative to this file) that should be
28 | # ignored by the migrate tool.
29 | #
30 | # Files that are not part of the templates will be ignored by default.
31 | unmanaged_files:
32 | - 'lib/main.dart'
33 | - 'ios/Runner.xcodeproj/project.pbxproj'
34 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2019 Masayuki Ono
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 | # mono_kit
2 |
3 | A collection of convenient widgets and utils made by mono.
4 |
5 | - Demo: https://mono-kit.web.app
6 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # https://pub.dev/packages/pedantic_mono
2 | include: package:pedantic_mono/analysis_options.yaml
3 | analyzer:
4 | exclude:
5 | - lib/generated_*.dart
6 | - lib/**/*.g.dart
7 | - lib/**/*.freezed.dart
8 | linter:
9 | rules:
10 | use_build_context_synchronously: false
11 | specify_nonobvious_property_types: false
12 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/workspace.xml
5 | /.idea/libraries
6 | .DS_Store
7 | /build
8 | /captures
9 | .cxx
10 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | group = "com.mono0926.mono_kit"
2 | version = "1.0-SNAPSHOT"
3 |
4 | buildscript {
5 | ext.kotlin_version = "1.8.22"
6 | repositories {
7 | google()
8 | mavenCentral()
9 | }
10 |
11 | dependencies {
12 | classpath("com.android.tools.build:gradle:8.1.0")
13 | classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version")
14 | }
15 | }
16 |
17 | allprojects {
18 | repositories {
19 | google()
20 | mavenCentral()
21 | }
22 | }
23 |
24 | apply plugin: "com.android.library"
25 | apply plugin: "kotlin-android"
26 |
27 | android {
28 | if (project.android.hasProperty("namespace")) {
29 | namespace = "com.mono0926.mono_kit"
30 | }
31 |
32 | compileSdk = 34
33 |
34 | compileOptions {
35 | sourceCompatibility = JavaVersion.VERSION_1_8
36 | targetCompatibility = JavaVersion.VERSION_1_8
37 | }
38 |
39 | kotlinOptions {
40 | jvmTarget = JavaVersion.VERSION_1_8
41 | }
42 |
43 | sourceSets {
44 | main.java.srcDirs += "src/main/kotlin"
45 | test.java.srcDirs += "src/test/kotlin"
46 | }
47 |
48 | defaultConfig {
49 | minSdk = 21
50 | }
51 |
52 | dependencies {
53 | testImplementation("org.jetbrains.kotlin:kotlin-test")
54 | testImplementation("org.mockito:mockito-core:5.0.0")
55 | }
56 |
57 | testOptions {
58 | unitTests.all {
59 | useJUnitPlatform()
60 |
61 | testLogging {
62 | events "passed", "skipped", "failed", "standardOut", "standardError"
63 | outputs.upToDateWhen {false}
64 | showStandardStreams = true
65 | }
66 | }
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'mono_kit'
2 |
--------------------------------------------------------------------------------
/android/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/android/src/main/kotlin/com/mono0926/mono_kit/MonoKitPlugin.kt:
--------------------------------------------------------------------------------
1 | package com.mono0926.mono_kit
2 |
3 | import io.flutter.plugin.common.MethodCall
4 | import io.flutter.plugin.common.MethodChannel
5 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler
6 | import io.flutter.plugin.common.MethodChannel.Result
7 | import android.content.pm.PackageManager
8 | import android.app.Activity
9 | import androidx.annotation.NonNull
10 | import io.flutter.embedding.engine.plugins.FlutterPlugin
11 | import io.flutter.embedding.engine.plugins.activity.ActivityAware
12 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding
13 |
14 | class MonoKitPlugin: FlutterPlugin, MethodCallHandler, ActivityAware {
15 |
16 | private lateinit var channel : MethodChannel
17 | private lateinit var activity: Activity
18 |
19 | override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
20 | channel = MethodChannel(flutterPluginBinding.binaryMessenger, "mono_kit")
21 | channel.setMethodCallHandler(this)
22 | }
23 |
24 | override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {
25 | val method = call.method
26 | val info = method.split('/')
27 | val group = info[0]
28 | val path = info[1]
29 | @Suppress("UNCHECKED_CAST")
30 | val arguments = call.arguments as Map
31 | when (group) {
32 | "installation_checker" -> when (path) {
33 | "is_installed" -> {
34 | val packageName = arguments.getValue("package_name")
35 | val isInstalled = isInstalled(packageName, activity.packageManager)
36 | result.success(isInstalled)
37 | }
38 | else -> result.notImplemented()
39 | }
40 | else -> result.notImplemented()
41 | }
42 | }
43 |
44 | override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {}
45 |
46 | override fun onDetachedFromActivity() {}
47 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) {}
48 | override fun onAttachedToActivity(binding: ActivityPluginBinding) {
49 | activity = binding.activity
50 | }
51 | override fun onDetachedFromActivityForConfigChanges() {}
52 | }
53 |
54 | private fun isInstalled(packageName: String, packageManager: PackageManager): Boolean {
55 | return try {
56 | packageManager.getPackageInfo(packageName, 0)
57 | true
58 | } catch (e: PackageManager.NameNotFoundException) {
59 | false
60 | }
61 | }
--------------------------------------------------------------------------------
/devtools_options.yaml:
--------------------------------------------------------------------------------
1 | description: This file stores settings for Dart & Flutter DevTools.
2 | documentation: https://docs.flutter.dev/tools/devtools/extensions#configure-extension-enablement-states
3 | extensions:
4 |
--------------------------------------------------------------------------------
/example/.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 | .dart_tool/
26 | .flutter-plugins
27 | .packages
28 | .pub-cache/
29 | .pub/
30 | /build/
31 |
32 | # Android related
33 | **/android/**/gradle-wrapper.jar
34 | **/android/.gradle
35 | **/android/captures/
36 | **/android/gradlew
37 | **/android/gradlew.bat
38 | **/android/local.properties
39 | **/android/**/GeneratedPluginRegistrant.java
40 |
41 | # iOS/XCode related
42 | **/ios/**/*.mode1v3
43 | **/ios/**/*.mode2v3
44 | **/ios/**/*.moved-aside
45 | **/ios/**/*.pbxuser
46 | **/ios/**/*.perspectivev3
47 | **/ios/**/*sync/
48 | **/ios/**/.sconsign.dblite
49 | **/ios/**/.tags*
50 | **/ios/**/.vagrant/
51 | **/ios/**/DerivedData/
52 | **/ios/**/Icon?
53 | **/ios/**/Pods/
54 | **/ios/**/.symlinks/
55 | **/ios/**/profile
56 | **/ios/**/xcuserdata
57 | **/ios/.generated/
58 | **/ios/Flutter/App.framework
59 | **/ios/Flutter/Flutter.framework
60 | **/ios/Flutter/Generated.xcconfig
61 | **/ios/Flutter/app.flx
62 | **/ios/Flutter/app.zip
63 | **/ios/Flutter/flutter_assets/
64 | **/ios/ServiceDefinitions.json
65 | **/ios/Runner/GeneratedPluginRegistrant.*
66 |
67 | # Exceptions to above rules.
68 | !**/ios/**/default.mode1v3
69 | !**/ios/**/default.mode2v3
70 | !**/ios/**/default.pbxuser
71 | !**/ios/**/default.perspectivev3
72 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
73 |
--------------------------------------------------------------------------------
/example/.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: "c23637390482d4cf9598c3ce3f2be31aa7332daf"
8 | channel: "stable"
9 |
10 | project_type: app
11 |
12 | # Tracks metadata for the flutter migrate command
13 | migration:
14 | platforms:
15 | - platform: root
16 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
17 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
18 | - platform: android
19 | create_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
20 | base_revision: c23637390482d4cf9598c3ce3f2be31aa7332daf
21 |
22 | # User provided section
23 |
24 | # List of Local paths (relative to this file) that should be
25 | # ignored by the migrate tool.
26 | #
27 | # Files that are not part of the templates will be ignored by default.
28 | unmanaged_files:
29 | - 'lib/main.dart'
30 | - 'ios/Runner.xcodeproj/project.pbxproj'
31 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # mono_kit_example
2 |
3 | Demonstrates how to use the mono_kit plugin.
4 |
5 | ## Getting Started
6 |
7 | This project is a starting point for a Flutter application.
8 |
9 | A few resources to get you started if this is your first Flutter project:
10 |
11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
13 |
14 | For help getting started with Flutter, view our
15 | [online documentation](https://flutter.dev/docs), which offers tutorials,
16 | samples, guidance on mobile development, and a full API reference.
17 |
--------------------------------------------------------------------------------
/example/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # https://pub.dev/packages/pedantic_mono
2 | include: package:pedantic_mono/analysis_options.yaml
3 | analyzer:
4 | exclude:
5 | - lib/generated_*.dart
6 | - lib/**/*.g.dart
7 | - lib/**/*.freezed.dart
8 | linter:
9 | rules:
10 | use_build_context_synchronously: false
11 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 | .cxx/
9 |
10 | # Remember to never publicly share your keystore.
11 | # See https://flutter.dev/to/reference-keystore
12 | key.properties
13 | **/*.keystore
14 | **/*.jks
15 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle.kts:
--------------------------------------------------------------------------------
1 | plugins {
2 | id("com.android.application")
3 | id("kotlin-android")
4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5 | id("dev.flutter.flutter-gradle-plugin")
6 | }
7 |
8 | android {
9 | namespace = "com.mono0926.example"
10 | compileSdk = flutter.compileSdkVersion
11 | ndkVersion = flutter.ndkVersion
12 |
13 | compileOptions {
14 | sourceCompatibility = JavaVersion.VERSION_11
15 | targetCompatibility = JavaVersion.VERSION_11
16 | }
17 |
18 | kotlinOptions {
19 | jvmTarget = JavaVersion.VERSION_11.toString()
20 | }
21 |
22 | defaultConfig {
23 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
24 | applicationId = "com.mono0926.example"
25 | // You can update the following values to match your application needs.
26 | // For more information, see: https://flutter.dev/to/review-gradle-config.
27 | minSdk = flutter.minSdkVersion
28 | targetSdk = flutter.targetSdkVersion
29 | versionCode = flutter.versionCode
30 | versionName = flutter.versionName
31 | }
32 |
33 | buildTypes {
34 | release {
35 | // TODO: Add your own signing config for the release build.
36 | // Signing with the debug keys for now, so `flutter run --release` works.
37 | signingConfig = signingConfigs.getByName("debug")
38 | }
39 | }
40 | }
41 |
42 | flutter {
43 | source = "../.."
44 | }
45 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
15 |
19 |
23 |
24 |
25 |
26 |
27 |
28 |
30 |
33 |
34 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/mono0926/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.mono0926.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity : FlutterActivity()
6 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable-v21/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values-night/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/build.gradle.kts:
--------------------------------------------------------------------------------
1 | allprojects {
2 | repositories {
3 | google()
4 | mavenCentral()
5 | }
6 | }
7 |
8 | val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9 | rootProject.layout.buildDirectory.value(newBuildDir)
10 |
11 | subprojects {
12 | val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13 | project.layout.buildDirectory.value(newSubprojectBuildDir)
14 | }
15 | subprojects {
16 | project.evaluationDependsOn(":app")
17 | }
18 |
19 | tasks.register("clean") {
20 | delete(rootProject.layout.buildDirectory)
21 | }
22 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
2 | android.useAndroidX=true
3 | android.enableJetifier=true
4 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
6 |
--------------------------------------------------------------------------------
/example/android/settings.gradle.kts:
--------------------------------------------------------------------------------
1 | pluginManagement {
2 | val flutterSdkPath = run {
3 | val properties = java.util.Properties()
4 | file("local.properties").inputStream().use { properties.load(it) }
5 | val flutterSdkPath = properties.getProperty("flutter.sdk")
6 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7 | flutterSdkPath
8 | }
9 |
10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11 |
12 | repositories {
13 | google()
14 | mavenCentral()
15 | gradlePluginPortal()
16 | }
17 | }
18 |
19 | plugins {
20 | id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21 | id("com.android.application") version "8.7.0" apply false
22 | id("org.jetbrains.kotlin.android") version "1.8.22" apply false
23 | }
24 |
25 | include(":app")
26 |
--------------------------------------------------------------------------------
/example/assets/images/love.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/assets/images/love.png
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 | 12.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Generated.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/ios/Podfile:
--------------------------------------------------------------------------------
1 | # Uncomment this line to define a global platform for your project
2 | # platform :ios, '12.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 |
--------------------------------------------------------------------------------
/example/ios/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - Flutter (1.0.0)
3 | - image_picker_ios (0.0.1):
4 | - Flutter
5 | - mono_kit (0.0.1):
6 | - Flutter
7 | - url_launcher_ios (0.0.1):
8 | - Flutter
9 |
10 | DEPENDENCIES:
11 | - Flutter (from `Flutter`)
12 | - image_picker_ios (from `.symlinks/plugins/image_picker_ios/ios`)
13 | - mono_kit (from `.symlinks/plugins/mono_kit/ios`)
14 | - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
15 |
16 | EXTERNAL SOURCES:
17 | Flutter:
18 | :path: Flutter
19 | image_picker_ios:
20 | :path: ".symlinks/plugins/image_picker_ios/ios"
21 | mono_kit:
22 | :path: ".symlinks/plugins/mono_kit/ios"
23 | url_launcher_ios:
24 | :path: ".symlinks/plugins/url_launcher_ios/ios"
25 |
26 | SPEC CHECKSUMS:
27 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
28 | image_picker_ios: c560581cceedb403a6ff17f2f816d7fea1421fc1
29 | mono_kit: 67c15c1486e232d7f44ac47286933e80aa02f7a3
30 | url_launcher_ios: 5334b05cef931de560670eeae103fd3e431ac3fe
31 |
32 | PODFILE CHECKSUM: c4c93c5f6502fe2754f48404d3594bf779584011
33 |
34 | COCOAPODS: 1.16.2
35 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @main
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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/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.
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/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 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | example
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 | CADisableMinimumFrameDurationOnPhone
45 |
46 | UIApplicationSupportsIndirectInputEvents
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/ios/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example/lib/app.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart' hide Router;
2 | import 'package:flutter_riverpod/flutter_riverpod.dart';
3 | import 'package:mono_kit/mono_kit.dart';
4 | import 'package:nested/nested.dart';
5 |
6 | import 'router/router.dart';
7 |
8 | class App extends ConsumerWidget {
9 | const App({super.key});
10 |
11 | static const title = 'mono_kit Demo';
12 |
13 | @override
14 | Widget build(BuildContext context, WidgetRef ref) {
15 | final router = ref.watch(routerProvider);
16 | return MaterialApp.router(
17 | title: title,
18 | builder: (context, child) => Nested(
19 | children: const [
20 | // ignore: deprecated_member_use
21 | TextScaleFactor(),
22 | ],
23 | child: Barrier(
24 | child: child!,
25 | ),
26 | ),
27 | theme: lightTheme(),
28 | darkTheme: darkTheme(),
29 | routeInformationParser: router.routeInformationParser,
30 | routerDelegate: router.routerDelegate,
31 | routeInformationProvider: router.routeInformationProvider,
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart' hide Router;
2 | import 'package:flutter_riverpod/flutter_riverpod.dart';
3 | import 'package:flutter_web_plugins/url_strategy.dart';
4 |
5 | import 'app.dart';
6 |
7 | void main() {
8 | WidgetsFlutterBinding.ensureInitialized();
9 | usePathUrlStrategy();
10 | runApp(
11 | const ProviderScope(
12 | child: App(),
13 | ),
14 | );
15 | }
16 |
--------------------------------------------------------------------------------
/example/lib/pages/app_bottom_area_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class AppBottomAreaRoute extends GoRouteData {
7 | const AppBottomAreaRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const AppBottomAreaPage();
11 | }
12 |
13 | class AppBottomAreaPage extends StatelessWidget {
14 | const AppBottomAreaPage({super.key});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | final theme = Theme.of(context);
19 | final colorScheme = theme.colorScheme;
20 | return AppBottomArea(
21 | bottom: Container(
22 | width: double.infinity,
23 | color: Colors.blueGrey,
24 | child: SafeArea(
25 | top: false,
26 | child: Padding(
27 | padding: const EdgeInsets.symmetric(vertical: 8),
28 | child: Text(
29 | 'AppBottomArea',
30 | textAlign: TextAlign.center,
31 | style: theme.textTheme.bodyMedium!.copyWith(
32 | color: Colors.white,
33 | ),
34 | ),
35 | ),
36 | ),
37 | ),
38 | child: DebugPadding(
39 | // showPadding: false,
40 | // showViewPadding: false,
41 | // showViewInsets: false,
42 | child: Scaffold(
43 | appBar: AppBar(
44 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
45 | ),
46 | body: UnfocusOnTap(
47 | child: ListView(
48 | padding: const EdgeInsets.only(bottom: 48),
49 | children: List.filled(
50 | 10,
51 | const Padding(
52 | padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
53 | child: TextField(
54 | decoration: InputDecoration(
55 | border: OutlineInputBorder(),
56 | ),
57 | ),
58 | ),
59 | ),
60 | ),
61 | ),
62 | floatingActionButton: FloatingActionButton(
63 | onPressed: () {},
64 | ),
65 | bottomNavigationBar: BottomAppBar(
66 | color: colorScheme.secondaryContainer,
67 | child: Text(
68 | 'bottomNavigationBar',
69 | textAlign: TextAlign.center,
70 | style: theme.primaryTextTheme.bodyMedium,
71 | ),
72 | ),
73 | bottomSheet: Container(
74 | width: double.infinity,
75 | color: colorScheme.secondary,
76 | padding: const EdgeInsets.symmetric(vertical: 8),
77 | child: const Text(
78 | 'bottomSheet',
79 | textAlign: TextAlign.center,
80 | ),
81 | ),
82 | ),
83 | ),
84 | );
85 | }
86 | }
87 |
--------------------------------------------------------------------------------
/example/lib/pages/banner_visibility_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class BannerVisibilityRoute extends GoRouteData {
7 | const BannerVisibilityRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const BannerVisibilityPage();
11 | }
12 |
13 | class BannerVisibilityPage extends StatefulWidget {
14 | const BannerVisibilityPage({super.key});
15 |
16 | @override
17 | State createState() => _BannerVisibilityPageState();
18 | }
19 |
20 | class _BannerVisibilityPageState extends State {
21 | final _isVisible = ValueNotifier(true);
22 |
23 | @override
24 | Widget build(BuildContext context) {
25 | return Scaffold(
26 | appBar: AppBar(
27 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
28 | ),
29 | body: Column(
30 | children: [
31 | ValueListenableBuilder(
32 | valueListenable: _isVisible,
33 | builder: (context, isVisible, child) {
34 | return AnimatedExpansionVisibility(
35 | isVisible: isVisible,
36 | curve: Curves.ease,
37 | child: child,
38 | );
39 | },
40 | child: MaterialBanner(
41 | content: const Text('This is a banner. Dismiss me'),
42 | actions: [
43 | TextButton(
44 | onPressed: () => _isVisible.value = false,
45 | child: const Text('DISMISS'),
46 | ),
47 | ],
48 | ),
49 | ),
50 | Container(
51 | height: 200,
52 | alignment: Alignment.center,
53 | color: Colors.blue,
54 | child: const Text('A Container'),
55 | ),
56 | ],
57 | ),
58 | floatingActionButton: FloatingActionButton(
59 | onPressed: () => _isVisible.value = !_isVisible.value,
60 | child: const Icon(Icons.refresh),
61 | ),
62 | );
63 | }
64 | }
65 |
--------------------------------------------------------------------------------
/example/lib/pages/barrier_page.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:example/router/router.dart';
4 | import 'package:flutter/material.dart';
5 | import 'package:flutter_riverpod/flutter_riverpod.dart';
6 | import 'package:go_router/go_router.dart';
7 | import 'package:mono_kit/mono_kit.dart';
8 | import 'package:mono_kit/widgets/widgets.dart';
9 |
10 | class BarrierRoute extends GoRouteData {
11 | const BarrierRoute();
12 | @override
13 | Widget build(BuildContext context, GoRouterState state) =>
14 | const BarrierPage();
15 | }
16 |
17 | class BarrierPage extends ConsumerStatefulWidget {
18 | const BarrierPage({super.key});
19 |
20 | @override
21 | ConsumerState createState() => _BarrierPageState();
22 | }
23 |
24 | class _BarrierPageState extends ConsumerState {
25 | var _count = 0;
26 |
27 | @override
28 | Widget build(BuildContext context) {
29 | return Scaffold(
30 | appBar: AppBar(
31 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
32 | ),
33 | floatingActionButton: FloatingActionButton(
34 | onPressed: () {
35 | // このブロックで囲まれている処理が終わるまでプログレス表示
36 | ref.read(barrierProvider.notifier).executeWithProgress(() async {
37 | // ダミー処理時間として1秒待つ
38 | await Future.delayed(const Duration(seconds: 1));
39 | setState(() => _count++);
40 | });
41 | },
42 | child: const Icon(Icons.add),
43 | ),
44 | body: Center(
45 | child: Text(
46 | '$_count',
47 | style: Theme.of(context).textTheme.headlineMedium,
48 | ),
49 | ),
50 | );
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/example/lib/pages/better_placeholder_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class BetterPlaceholderRoute extends GoRouteData {
7 | const BetterPlaceholderRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const BetterPlaceholderPage();
11 | }
12 |
13 | class BetterPlaceholderPage extends StatelessWidget {
14 | const BetterPlaceholderPage({super.key});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
21 | ),
22 | body: ListView(
23 | children: const [
24 | BetterPlaceholder(),
25 | BetterPlaceholder(
26 | fallbackWidth: 100,
27 | fallbackHeight: 200,
28 | ),
29 | BetterPlaceholder(
30 | fallbackHeight: 30,
31 | ),
32 | ],
33 | ),
34 | );
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/example/lib/pages/color_ex_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | final _swatch = const Color(0xFFF44336).materialColor;
7 |
8 | class ColorExRoute extends GoRouteData {
9 | const ColorExRoute();
10 | @override
11 | Widget build(BuildContext context, GoRouterState state) =>
12 | const ColorExPage();
13 | }
14 |
15 | class ColorExPage extends StatelessWidget {
16 | const ColorExPage({super.key});
17 |
18 | @override
19 | Widget build(BuildContext context) {
20 | return Theme(
21 | data: ThemeData(
22 | // primarySwatch: _swatch,
23 | brightness: Theme.of(context).brightness,
24 | ),
25 | child: Scaffold(
26 | appBar: AppBar(
27 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
28 | ),
29 | floatingActionButton: FloatingActionButton(
30 | onPressed: () {},
31 | child: const Icon(Icons.add),
32 | ),
33 | floatingActionButtonLocation: FloatingActionButtonLocation.endDocked,
34 | bottomNavigationBar: BottomNavigationBar(
35 | items: List.generate(
36 | 2,
37 | (_) => const BottomNavigationBarItem(
38 | icon: Icon(Icons.home),
39 | label: '',
40 | ),
41 | ),
42 | ),
43 | body: Padding(
44 | padding: const EdgeInsets.all(44),
45 | child: Column(
46 | children: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900]
47 | .map(
48 | (k) => Expanded(
49 | child: Container(
50 | color: _swatch[k],
51 | ),
52 | ),
53 | )
54 | .toList(),
55 | ),
56 | ),
57 | ),
58 | );
59 | }
60 | }
61 |
--------------------------------------------------------------------------------
/example/lib/pages/debug_padding_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class DebugPaddingRoute extends GoRouteData {
7 | const DebugPaddingRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const DebugPaddingPage();
11 | }
12 |
13 | class DebugPaddingPage extends StatelessWidget {
14 | const DebugPaddingPage({super.key});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | final theme = Theme.of(context);
19 | final colorScheme = theme.colorScheme;
20 | return DebugPadding(
21 | // showPadding: false,
22 | // showViewPadding: false,
23 | // showViewInsets: false,
24 | // showSize: false,
25 | child: Scaffold(
26 | appBar: AppBar(
27 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
28 | ),
29 | body: UnfocusOnTap(
30 | child: ListView(
31 | padding: const EdgeInsets.only(bottom: 48),
32 | children: List.filled(
33 | 10,
34 | const Padding(
35 | padding: EdgeInsets.symmetric(horizontal: 16, vertical: 8),
36 | child: TextField(
37 | decoration: InputDecoration(
38 | border: OutlineInputBorder(),
39 | ),
40 | ),
41 | ),
42 | ),
43 | ),
44 | ),
45 | floatingActionButton: FloatingActionButton(
46 | onPressed: () {},
47 | ),
48 | bottomNavigationBar: BottomAppBar(
49 | color: colorScheme.secondaryContainer,
50 | child: Text(
51 | 'bottomNavigationBar',
52 | textAlign: TextAlign.center,
53 | style: theme.primaryTextTheme.bodyMedium,
54 | ),
55 | ),
56 | bottomSheet: Container(
57 | width: double.infinity,
58 | color: colorScheme.secondary,
59 | padding: const EdgeInsets.symmetric(vertical: 8),
60 | child: const Text(
61 | 'bottomSheet',
62 | textAlign: TextAlign.center,
63 | ),
64 | ),
65 | ),
66 | );
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/example/lib/pages/delayed_pop_scope_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:adaptive_dialog/adaptive_dialog.dart';
2 | import 'package:example/router/router.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:go_router/go_router.dart';
5 | import 'package:mono_kit/mono_kit.dart';
6 |
7 | class DelayedPopScopeRoute extends GoRouteData {
8 | const DelayedPopScopeRoute();
9 | @override
10 | Widget build(BuildContext context, GoRouterState state) =>
11 | const DelayedPopScopePage();
12 | }
13 |
14 | class DelayedPopScopePage extends StatelessWidget {
15 | const DelayedPopScopePage({super.key});
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return DelayedPopScope(
20 | onShouldPop: (result) async {
21 | final confirmationResult = await showOkCancelAlertDialog(
22 | context: context,
23 | message: '前のページに戻りますか?',
24 | okLabel: '戻る',
25 | cancelLabel: '戻らないでとどまる',
26 | );
27 | return confirmationResult == OkCancelResult.ok;
28 | },
29 | child: Scaffold(
30 | appBar: AppBar(
31 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
32 | ),
33 | body: CenteredMaxWidth(
34 | width: 320,
35 | child: ListView(
36 | children: [
37 | const Text(
38 | // ignore: lines_longer_than_80_chars
39 | 'AppBarの戻るボタン、あるいは下のボタンで`maybePop`実行すると、DelayedPopScopeが呼ばれて確認ダイアログが表示されます。',
40 | ),
41 | const SizedBox(height: 16),
42 | FilledButton(
43 | onPressed: () {
44 | Navigator.of(context).maybePop();
45 | },
46 | child: const Text('maybePop()'),
47 | ),
48 | ],
49 | ),
50 | ),
51 | ),
52 | );
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/example/lib/pages/home_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:adaptive_dialog/adaptive_dialog.dart';
2 | import 'package:example/app.dart';
3 | import 'package:example/router/router.dart';
4 | import 'package:example/util/util.dart';
5 | import 'package:flutter/material.dart';
6 | import 'package:go_router/go_router.dart';
7 | import 'package:mono_kit/mono_kit.dart';
8 | import 'package:mono_kit/plugins/plugins.dart';
9 |
10 | class HomePage extends StatelessWidget {
11 | const HomePage({super.key});
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 | return Scaffold(
16 | appBar: AppBar(title: const Text(App.title)),
17 | body: ListView(
18 | children: [
19 | const WIP(
20 | visible: true,
21 | child: ListTile(title: Text('Experimental Feature')),
22 | ),
23 | ...allRouteLocations.map((location) {
24 | return ListTile(
25 | title: Text(pascalCaseFromRouteName(location)),
26 | trailing: const Icon(Icons.chevron_right),
27 | onTap: () => context.go(location),
28 | );
29 | }),
30 | ListTile(
31 | title: const Text('iGhost(Dev) installed?'),
32 | subtitle: FutureBuilder(
33 | future: AppInstallationChecker().isInstalled(
34 | 'com.aquatica.ghost.dev',
35 | ),
36 | builder: (context, snap) {
37 | if (!snap.hasData) {
38 | return const SizedBox();
39 | }
40 | return Text(snap.data.toString());
41 | },
42 | ),
43 | ),
44 | ListTile(
45 | title: const Text('showPhotoSelectionSheet()'),
46 | trailing: const Icon(Icons.photo_library),
47 | onTap: () {
48 | showPhotoSelectionSheet(
49 | context: context,
50 | onSettingAppOpenRequested: () {
51 | logger.info('onSettingAppOpenRequested');
52 | },
53 | additionalActions: (
54 | [
55 | const SheetAction(
56 | label: 'Custom Action',
57 | icon: Icons.warning,
58 | key: 'custom_key',
59 | ),
60 | ],
61 | (key) {
62 | logger.info('Additional action selected: $key');
63 | },
64 | ),
65 | );
66 | },
67 | ),
68 | ],
69 | ),
70 | );
71 | }
72 | }
73 |
74 | enum Hoge { a }
75 |
--------------------------------------------------------------------------------
/example/lib/pages/lifecycle_observer_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:example/util/util.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:flutter_riverpod/flutter_riverpod.dart';
5 | import 'package:go_router/go_router.dart';
6 | import 'package:mono_kit/mono_kit.dart';
7 |
8 | class LifecycleObserverRoute extends GoRouteData {
9 | const LifecycleObserverRoute();
10 | @override
11 | Widget build(BuildContext context, GoRouterState state) =>
12 | const LifecycleObserverPage();
13 | }
14 |
15 | class LifecycleObserverPage extends ConsumerWidget {
16 | const LifecycleObserverPage({super.key});
17 |
18 | @override
19 | Widget build(BuildContext context, WidgetRef ref) {
20 | ref.listen>(lifecycleObserver, (_, state) {
21 | logger.info(state.value);
22 | });
23 | return Scaffold(
24 | appBar: AppBar(
25 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
26 | ),
27 | body: const Center(
28 | child: Text(
29 | 'Close and Open',
30 | style: TextStyle(fontSize: 28),
31 | ),
32 | ),
33 | );
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/example/lib/pages/list_tile_selected_background_colored_box_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class ListTileSelectedBackgroundColoredBoxRoute extends GoRouteData {
7 | const ListTileSelectedBackgroundColoredBoxRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const ListTileSelectedBackgroundColoredBoxPage();
11 | }
12 |
13 | class ListTileSelectedBackgroundColoredBoxPage extends StatefulWidget {
14 | const ListTileSelectedBackgroundColoredBoxPage({super.key});
15 |
16 | @override
17 | State createState() =>
18 | _ListTileSelectedBackgroundColoredBoxPageState();
19 | }
20 |
21 | class _ListTileSelectedBackgroundColoredBoxPageState
22 | extends State {
23 | static const _listTileTexts = [
24 | 'Hello',
25 | 'Animals',
26 | 'Dog',
27 | 'Cat',
28 | ];
29 |
30 | var _selectedText = _listTileTexts.first;
31 |
32 | @override
33 | Widget build(BuildContext context) {
34 | final theme = Theme.of(context);
35 | final colorScheme = theme.colorScheme;
36 | return Scaffold(
37 | appBar: AppBar(
38 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
39 | ),
40 | body: Center(
41 | child: FilledButton.tonal(
42 | onPressed: () => Navigator.of(context).pop(),
43 | child: const Text('BACK'),
44 | ),
45 | ),
46 | drawer: Drawer(
47 | child: ListView(
48 | children: [
49 | DrawerHeader(
50 | decoration: BoxDecoration(
51 | color: colorScheme.primary,
52 | ),
53 | child: Text(
54 | 'Header',
55 | style: theme.primaryTextTheme.headlineMedium,
56 | ),
57 | ),
58 | ..._listTileTexts.map(
59 | (text) => ListTileSelectedBackgroundColoredBox(
60 | listTile: ListTile(
61 | title: Text(text),
62 | selected: _selectedText == text,
63 | onTap: () {
64 | setState(() {
65 | _selectedText = text;
66 | });
67 | },
68 | ),
69 | ),
70 | ),
71 | ],
72 | ),
73 | ),
74 | );
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/example/lib/pages/max_width_padding_builder_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class MaxWidthPaddingBuilderRoute extends GoRouteData {
7 | const MaxWidthPaddingBuilderRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const MaxWidthPaddingBuilderPage();
11 | }
12 |
13 | class MaxWidthPaddingBuilderPage extends StatelessWidget {
14 | const MaxWidthPaddingBuilderPage({super.key});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
21 | ),
22 | body: MaxWidthPaddingBuilder(
23 | width: 300,
24 | builder: (context, padding) => ListView(
25 | padding: padding,
26 | children: List.filled(
27 | 3,
28 | const Placeholder(),
29 | ),
30 | ),
31 | ),
32 | );
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/example/lib/pages/not_found.page.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | class NotFoundPage extends StatelessWidget {
4 | const NotFoundPage({super.key});
5 |
6 | @override
7 | Widget build(BuildContext context) {
8 | return Scaffold(
9 | appBar: AppBar(
10 | title: const Text('404 Not Found'),
11 | ),
12 | body: Center(
13 | child: Image.network(
14 | 'https://i0.wp.com/hokanko.mond.jp/wordpress341/wp-content/uploads/images/istock_hannah.jpg',
15 | ),
16 | ),
17 | );
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/example/lib/pages/overflow_detectable_text_page/data.dart:
--------------------------------------------------------------------------------
1 | class Data {
2 | Data._({
3 | required this.desc,
4 | });
5 |
6 | Data.small()
7 | : this._(
8 | desc: 'Flutter最高!',
9 | );
10 | Data.medium()
11 | : this._(
12 | desc: 'むかしむかし、あるところにFlutterという素晴らしいフレームワークがありました。',
13 | );
14 |
15 | // Copied from https://ja.wikipedia.org/wiki/Flutter
16 | Data.large()
17 | : this._(
18 | desc: 'Flutter(フラッター)は、Googleによって開発されたフリーかつ'
19 | 'オープンソースのモバイルアプリケーションフレームワークである。' *
20 | 2,);
21 |
22 | factory Data.index(int index) {
23 | switch (index % 3) {
24 | case 0:
25 | return Data.small();
26 | case 1:
27 | return Data.medium();
28 | case 2:
29 | return Data.large();
30 | }
31 | assert(false);
32 | return Data._(desc: '');
33 | }
34 |
35 | final String desc;
36 | }
37 |
--------------------------------------------------------------------------------
/example/lib/pages/overflow_detectable_text_page/overflow_detectable_text_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/cupertino.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:go_router/go_router.dart';
5 |
6 | import 'cell.dart';
7 | import 'data.dart';
8 |
9 | class OverflowDetectableTextRoute extends GoRouteData {
10 | const OverflowDetectableTextRoute();
11 | @override
12 | Widget build(BuildContext context, GoRouterState state) =>
13 | const OverflowDetectableTextPage();
14 | }
15 |
16 | class OverflowDetectableTextPage extends StatelessWidget {
17 | const OverflowDetectableTextPage({super.key});
18 |
19 | @override
20 | Widget build(BuildContext context) {
21 | return Theme(
22 | data: _buildTheme(),
23 | child: Scaffold(
24 | appBar: AppBar(
25 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
26 | ),
27 | body: ListView.separated(
28 | padding: EdgeInsets.only(
29 | left: 20,
30 | right: 20,
31 | bottom: MediaQuery.of(context).padding.bottom,
32 | ),
33 | itemCount: 10,
34 | separatorBuilder: (context, index) => const Divider(height: 0),
35 | itemBuilder: (context, index) => Cell(Data.index(index)),
36 | ),
37 | ),
38 | );
39 | }
40 |
41 | ThemeData _buildTheme() {
42 | final base = ThemeData.light();
43 | const accentColor = Color(0xFF007AFF);
44 | const buttonColor = Color(0xFFF0F0F7);
45 | final highlightColor = accentColor.withValues(alpha: 0.04);
46 | return base.copyWith(
47 | cupertinoOverrideTheme: const CupertinoThemeData(
48 | primaryColor: accentColor,
49 | ),
50 | primaryColor: Colors.white,
51 | scaffoldBackgroundColor: Colors.white,
52 | highlightColor: highlightColor,
53 | // splashColor: splashColor,
54 | primaryTextTheme: base.primaryTextTheme.apply(
55 | bodyColor: Colors.black87,
56 | ),
57 | appBarTheme: base.appBarTheme.copyWith(
58 | elevation: 1,
59 | ),
60 | dividerColor: Colors.black26,
61 | textTheme: base.textTheme.copyWith(
62 | bodyMedium: base.textTheme.bodyMedium!.copyWith(fontSize: 13),
63 | labelLarge: base.textTheme.labelLarge!.copyWith(
64 | fontWeight: FontWeight.w600,
65 | ),
66 | ),
67 | elevatedButtonTheme: ElevatedButtonThemeData(
68 | style: ElevatedButton.styleFrom(
69 | foregroundColor: accentColor, shape: const StadiumBorder(),
70 | backgroundColor: buttonColor,
71 | // shadowColor: highlightColor,
72 | minimumSize: Size.zero,
73 | padding: const EdgeInsets.symmetric(
74 | horizontal: 18,
75 | vertical: 7,
76 | ),
77 | ).copyWith(
78 | elevation: WidgetStateProperty.all(0),
79 | overlayColor: WidgetStateProperty.all(
80 | Color.lerp(
81 | buttonColor,
82 | Colors.black,
83 | 0.3,
84 | ),
85 | ),
86 | ),
87 | ),
88 | primaryIconTheme: base.primaryIconTheme.copyWith(
89 | color: accentColor,
90 | ),
91 | );
92 | }
93 | }
94 |
--------------------------------------------------------------------------------
/example/lib/pages/pages.dart:
--------------------------------------------------------------------------------
1 | export 'home_page.dart';
2 | export 'not_found.page.dart';
3 | //export 'overflow_detectable_text_page/overflow_detectable_text_page.dart';
4 |
--------------------------------------------------------------------------------
/example/lib/pages/snack_bar_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:example/util/util.dart';
3 | import 'package:flutter/material.dart';
4 | import 'package:go_router/go_router.dart';
5 | import 'package:mono_kit/mono_kit.dart';
6 |
7 | class SnackBarRoute extends GoRouteData {
8 | const SnackBarRoute();
9 | @override
10 | Widget build(BuildContext context, GoRouterState state) =>
11 | const SnackBarPage();
12 | }
13 |
14 | class SnackBarPage extends StatelessWidget {
15 | const SnackBarPage({super.key});
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | final messenger = ScaffoldMessenger.of(context);
20 | final theme = Theme.of(context);
21 | final colorScheme = theme.colorScheme;
22 | return Scaffold(
23 | appBar: AppBar(
24 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
25 | ),
26 | body: ListView(
27 | children: [
28 | ListTile(
29 | title: const Text('Plain Text'),
30 | onTap: () => messenger.showMessage('( ´・‿・`)'),
31 | ),
32 | ListTile(
33 | title: Text(
34 | 'Error',
35 | style: TextStyle(
36 | color: colorScheme.error,
37 | ),
38 | ),
39 | onTap: () => messenger.showError(
40 | '(´・︵・`)',
41 | theme: theme,
42 | ),
43 | ),
44 | ListTile(
45 | title: const Text('UNDO'),
46 | onTap: () => messenger.showUndo(
47 | 'Dog 🐶',
48 | onUndo: () => logger.info('UNDO'),
49 | theme: theme,
50 | ),
51 | ),
52 | ],
53 | ),
54 | );
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/example/lib/pages/unfocus_on_tap_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 | import 'package:quiver/iterables.dart';
6 |
7 | class UnfocusOnTapRoute extends GoRouteData {
8 | const UnfocusOnTapRoute();
9 | @override
10 | Widget build(BuildContext context, GoRouterState state) =>
11 | const UnfocusOnTapPage();
12 | }
13 |
14 | class UnfocusOnTapPage extends StatelessWidget {
15 | const UnfocusOnTapPage({super.key});
16 |
17 | @override
18 | Widget build(BuildContext context) {
19 | return Scaffold(
20 | appBar: AppBar(
21 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
22 | ),
23 | body: CenteredMaxWidth(
24 | width: 560,
25 | child: UnfocusOnTap(
26 | child: Column(
27 | children: range(0, 3)
28 | .map(
29 | (_) => const Padding(
30 | padding: EdgeInsets.symmetric(
31 | vertical: 8,
32 | horizontal: 16,
33 | ),
34 | child: TextField(
35 | decoration: InputDecoration(
36 | border: OutlineInputBorder(),
37 | ),
38 | ),
39 | ),
40 | )
41 | .toList(),
42 | ),
43 | ),
44 | ),
45 | );
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/example/lib/pages/vertical_center_scroll_view_page.dart:
--------------------------------------------------------------------------------
1 | import 'package:example/router/router.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:go_router/go_router.dart';
4 | import 'package:mono_kit/mono_kit.dart';
5 |
6 | class VerticalCenterScrollViewRoute extends GoRouteData {
7 | const VerticalCenterScrollViewRoute();
8 | @override
9 | Widget build(BuildContext context, GoRouterState state) =>
10 | const VerticalCenterScrollViewPage();
11 | }
12 |
13 | class VerticalCenterScrollViewPage extends StatelessWidget {
14 | const VerticalCenterScrollViewPage({super.key});
15 |
16 | @override
17 | Widget build(BuildContext context) {
18 | return Scaffold(
19 | appBar: AppBar(
20 | title: Text(pascalCaseFromRouteUri(GoRouterState.of(context).uri)),
21 | ),
22 | body: const VerticalCenterScrollView(
23 | padding: EdgeInsets.symmetric(vertical: 16),
24 | child: UnfocusOnTap(
25 | child: Text('Vertical Center Scroll View'),
26 | ),
27 | ),
28 | );
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/example/lib/util/logger.dart:
--------------------------------------------------------------------------------
1 | import 'package:simple_logger/simple_logger.dart';
2 |
3 | final logger = SimpleLogger()
4 | ..mode = LoggerMode.print
5 | ..setLevel(
6 | Level.FINEST,
7 | includeCallerInfo: true,
8 | );
9 |
--------------------------------------------------------------------------------
/example/lib/util/util.dart:
--------------------------------------------------------------------------------
1 | export 'logger.dart';
2 |
--------------------------------------------------------------------------------
/example/macos/.gitignore:
--------------------------------------------------------------------------------
1 | # Flutter-related
2 | **/Flutter/ephemeral/
3 | **/Pods/
4 |
5 | # Xcode-related
6 | **/xcuserdata/
7 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
2 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"
3 | #include "ephemeral/Flutter-Generated.xcconfig"
4 |
--------------------------------------------------------------------------------
/example/macos/Flutter/Flutter-Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
2 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"
3 | #include "ephemeral/Flutter-Generated.xcconfig"
4 |
--------------------------------------------------------------------------------
/example/macos/Flutter/GeneratedPluginRegistrant.swift:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | import FlutterMacOS
6 | import Foundation
7 |
8 | import appkit_ui_element_colors
9 | import dynamic_color
10 | import file_selector_macos
11 | import macos_ui
12 | import macos_window_utils
13 | import url_launcher_macos
14 |
15 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
16 | AppkitUiElementColorsPlugin.register(with: registry.registrar(forPlugin: "AppkitUiElementColorsPlugin"))
17 | DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin"))
18 | FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin"))
19 | MacOSUiPlugin.register(with: registry.registrar(forPlugin: "MacOSUiPlugin"))
20 | MacOSWindowUtilsPlugin.register(with: registry.registrar(forPlugin: "MacOSWindowUtilsPlugin"))
21 | UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
22 | }
23 |
--------------------------------------------------------------------------------
/example/macos/Podfile:
--------------------------------------------------------------------------------
1 | platform :osx, '10.15'
2 |
3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true'
5 |
6 | project 'Runner', {
7 | 'Debug' => :debug,
8 | 'Profile' => :release,
9 | 'Release' => :release,
10 | }
11 |
12 | def flutter_root
13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__)
14 | unless File.exist?(generated_xcode_build_settings_path)
15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first"
16 | end
17 |
18 | File.foreach(generated_xcode_build_settings_path) do |line|
19 | matches = line.match(/FLUTTER_ROOT\=(.*)/)
20 | return matches[1].strip if matches
21 | end
22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\""
23 | end
24 |
25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
26 |
27 | flutter_macos_podfile_setup
28 |
29 | target 'Runner' do
30 | use_frameworks!
31 | use_modular_headers!
32 |
33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
34 | end
35 |
36 | post_install do |installer|
37 | installer.pods_project.targets.each do |target|
38 | flutter_additional_macos_build_settings(target)
39 | end
40 | end
41 |
--------------------------------------------------------------------------------
/example/macos/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - appkit_ui_element_colors (1.0.0):
3 | - FlutterMacOS
4 | - dynamic_color (0.0.2):
5 | - FlutterMacOS
6 | - file_selector_macos (0.0.1):
7 | - FlutterMacOS
8 | - FlutterMacOS (1.0.0)
9 | - macos_ui (0.1.0):
10 | - FlutterMacOS
11 | - macos_window_utils (1.0.0):
12 | - FlutterMacOS
13 | - url_launcher_macos (0.0.1):
14 | - FlutterMacOS
15 |
16 | DEPENDENCIES:
17 | - appkit_ui_element_colors (from `Flutter/ephemeral/.symlinks/plugins/appkit_ui_element_colors/macos`)
18 | - dynamic_color (from `Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos`)
19 | - file_selector_macos (from `Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos`)
20 | - FlutterMacOS (from `Flutter/ephemeral`)
21 | - macos_ui (from `Flutter/ephemeral/.symlinks/plugins/macos_ui/macos`)
22 | - macos_window_utils (from `Flutter/ephemeral/.symlinks/plugins/macos_window_utils/macos`)
23 | - url_launcher_macos (from `Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos`)
24 |
25 | EXTERNAL SOURCES:
26 | appkit_ui_element_colors:
27 | :path: Flutter/ephemeral/.symlinks/plugins/appkit_ui_element_colors/macos
28 | dynamic_color:
29 | :path: Flutter/ephemeral/.symlinks/plugins/dynamic_color/macos
30 | file_selector_macos:
31 | :path: Flutter/ephemeral/.symlinks/plugins/file_selector_macos/macos
32 | FlutterMacOS:
33 | :path: Flutter/ephemeral
34 | macos_ui:
35 | :path: Flutter/ephemeral/.symlinks/plugins/macos_ui/macos
36 | macos_window_utils:
37 | :path: Flutter/ephemeral/.symlinks/plugins/macos_window_utils/macos
38 | url_launcher_macos:
39 | :path: Flutter/ephemeral/.symlinks/plugins/url_launcher_macos/macos
40 |
41 | SPEC CHECKSUMS:
42 | appkit_ui_element_colors: 39bb2d80be3f19b152ccf4c70d5bbe6cba43d74a
43 | dynamic_color: 2eaa27267de1ca20d879fbd6e01259773fb1670f
44 | file_selector_macos: 54fdab7caa3ac3fc43c9fac4d7d8d231277f8cf2
45 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24
46 | macos_ui: 6229a8922cd97bafb7d9636c8eb8dfb0744183ca
47 | macos_window_utils: 933f91f64805e2eb91a5bd057cf97cd097276663
48 | url_launcher_macos: 5f437abeda8c85500ceb03f5c1938a8c5a705399
49 |
50 | PODFILE CHECKSUM: 0d3963a09fc94f580682bd88480486da345dc3f0
51 |
52 | COCOAPODS: 1.15.2
53 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | @main
5 | class AppDelegate: FlutterAppDelegate {
6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
7 | return true
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "16x16",
5 | "idiom" : "mac",
6 | "filename" : "app_icon_16.png",
7 | "scale" : "1x"
8 | },
9 | {
10 | "size" : "16x16",
11 | "idiom" : "mac",
12 | "filename" : "app_icon_32.png",
13 | "scale" : "2x"
14 | },
15 | {
16 | "size" : "32x32",
17 | "idiom" : "mac",
18 | "filename" : "app_icon_32.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "32x32",
23 | "idiom" : "mac",
24 | "filename" : "app_icon_64.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "128x128",
29 | "idiom" : "mac",
30 | "filename" : "app_icon_128.png",
31 | "scale" : "1x"
32 | },
33 | {
34 | "size" : "128x128",
35 | "idiom" : "mac",
36 | "filename" : "app_icon_256.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "256x256",
41 | "idiom" : "mac",
42 | "filename" : "app_icon_256.png",
43 | "scale" : "1x"
44 | },
45 | {
46 | "size" : "256x256",
47 | "idiom" : "mac",
48 | "filename" : "app_icon_512.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "512x512",
53 | "idiom" : "mac",
54 | "filename" : "app_icon_512.png",
55 | "scale" : "1x"
56 | },
57 | {
58 | "size" : "512x512",
59 | "idiom" : "mac",
60 | "filename" : "app_icon_1024.png",
61 | "scale" : "2x"
62 | }
63 | ],
64 | "info" : {
65 | "version" : 1,
66 | "author" : "xcode"
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png
--------------------------------------------------------------------------------
/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/AppInfo.xcconfig:
--------------------------------------------------------------------------------
1 | // Application-level settings for the Runner target.
2 | //
3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the
4 | // future. If not, the values below would default to using the project name when this becomes a
5 | // 'flutter create' template.
6 |
7 | // The application's name. By default this is also the title of the Flutter window.
8 | PRODUCT_NAME = example
9 |
10 | // The application's bundle identifier
11 | PRODUCT_BUNDLE_IDENTIFIER = com.mono0926.example
12 |
13 | // The copyright displayed in application information
14 | PRODUCT_COPYRIGHT = Copyright © 2020 com.mono0926. All rights reserved.
15 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Debug.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "../../Flutter/Flutter-Release.xcconfig"
2 | #include "Warnings.xcconfig"
3 |
--------------------------------------------------------------------------------
/example/macos/Runner/Configs/Warnings.xcconfig:
--------------------------------------------------------------------------------
1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings
2 | GCC_WARN_UNDECLARED_SELECTOR = YES
3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES
4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE
5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES
6 | CLANG_WARN_PRAGMA_PACK = YES
7 | CLANG_WARN_STRICT_PROTOTYPES = YES
8 | CLANG_WARN_COMMA = YES
9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES
10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES
11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES
12 | GCC_WARN_SHADOW = YES
13 | CLANG_WARN_UNREACHABLE_CODE = YES
14 |
--------------------------------------------------------------------------------
/example/macos/Runner/DebugProfile.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 | com.apple.security.cs.allow-jit
8 |
9 | com.apple.security.network.server
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/example/macos/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIconFile
10 |
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | $(FLUTTER_BUILD_NAME)
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSMinimumSystemVersion
24 | $(MACOSX_DEPLOYMENT_TARGET)
25 | NSHumanReadableCopyright
26 | $(PRODUCT_COPYRIGHT)
27 | NSMainNibFile
28 | MainMenu
29 | NSPrincipalClass
30 | NSApplication
31 |
32 |
33 |
--------------------------------------------------------------------------------
/example/macos/Runner/MainFlutterWindow.swift:
--------------------------------------------------------------------------------
1 | import Cocoa
2 | import FlutterMacOS
3 |
4 | class MainFlutterWindow: NSWindow {
5 | override func awakeFromNib() {
6 | let flutterViewController = FlutterViewController.init()
7 | let windowFrame = self.frame
8 | self.contentViewController = flutterViewController
9 | self.setFrame(windowFrame, display: true)
10 |
11 | RegisterGeneratedPlugins(registry: flutterViewController)
12 |
13 | super.awakeFromNib()
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/example/macos/Runner/Release.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | com.apple.security.app-sandbox
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/macos/RunnerTests/RunnerTests.swift:
--------------------------------------------------------------------------------
1 | import FlutterMacOS
2 | import Cocoa
3 | import XCTest
4 |
5 | class RunnerTests: XCTestCase {
6 |
7 | func testExample() {
8 | // If you add code to the Runner application, consider adding tests here.
9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest.
10 | }
11 |
12 | }
13 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A example of mono_kit.
3 | version: 1.0.0+1
4 | publish_to: none
5 | environment:
6 | sdk: ^3.7.0
7 | dependencies:
8 | adaptive_dialog:
9 | cupertino_icons:
10 | flutter:
11 | sdk: flutter
12 | flutter_riverpod:
13 | flutter_web_plugins:
14 | sdk: flutter
15 | go_router:
16 | mono_kit:
17 | path: ..
18 | nested:
19 | quiver:
20 | recase:
21 | simple_logger:
22 | dev_dependencies:
23 | build_runner:
24 | flutter_test:
25 | sdk: flutter
26 | go_router_builder:
27 | pedantic_mono:
28 | flutter:
29 | uses-material-design: true
30 | assets:
31 | - assets/images/
32 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter_test/flutter_test.dart';
2 |
3 | void main() {
4 | testWidgets('', (tester) async {});
5 | }
6 |
--------------------------------------------------------------------------------
/example/web/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/web/favicon.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/web/icons/Icon-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/web/icons/Icon-512.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/web/icons/Icon-maskable-192.png
--------------------------------------------------------------------------------
/example/web/icons/Icon-maskable-512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/web/icons/Icon-maskable-512.png
--------------------------------------------------------------------------------
/example/web/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "example",
3 | "short_name": "example",
4 | "start_url": ".",
5 | "display": "minimal-ui",
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 | }
24 |
--------------------------------------------------------------------------------
/example/windows/.gitignore:
--------------------------------------------------------------------------------
1 | flutter/ephemeral/
2 |
3 | # Visual Studio user-specific files.
4 | *.suo
5 | *.user
6 | *.userosscache
7 | *.sln.docstates
8 |
9 | # Visual Studio build-related files.
10 | x64/
11 | x86/
12 |
13 | # Visual Studio cache files
14 | # files ending in .cache can be ignored
15 | *.[Cc]ache
16 | # but keep track of directories ending in .cache
17 | !*.[Cc]ache/
18 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.cc:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #include "generated_plugin_registrant.h"
8 |
9 | #include
10 | #include
11 | #include
12 |
13 | void RegisterPlugins(flutter::PluginRegistry* registry) {
14 | DynamicColorPluginCApiRegisterWithRegistrar(
15 | registry->GetRegistrarForPlugin("DynamicColorPluginCApi"));
16 | FileSelectorWindowsRegisterWithRegistrar(
17 | registry->GetRegistrarForPlugin("FileSelectorWindows"));
18 | UrlLauncherWindowsRegisterWithRegistrar(
19 | registry->GetRegistrarForPlugin("UrlLauncherWindows"));
20 | }
21 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugin_registrant.h:
--------------------------------------------------------------------------------
1 | //
2 | // Generated file. Do not edit.
3 | //
4 |
5 | // clang-format off
6 |
7 | #ifndef GENERATED_PLUGIN_REGISTRANT_
8 | #define GENERATED_PLUGIN_REGISTRANT_
9 |
10 | #include
11 |
12 | // Registers Flutter plugins.
13 | void RegisterPlugins(flutter::PluginRegistry* registry);
14 |
15 | #endif // GENERATED_PLUGIN_REGISTRANT_
16 |
--------------------------------------------------------------------------------
/example/windows/flutter/generated_plugins.cmake:
--------------------------------------------------------------------------------
1 | #
2 | # Generated file, do not edit.
3 | #
4 |
5 | list(APPEND FLUTTER_PLUGIN_LIST
6 | dynamic_color
7 | file_selector_windows
8 | url_launcher_windows
9 | )
10 |
11 | list(APPEND FLUTTER_FFI_PLUGIN_LIST
12 | )
13 |
14 | set(PLUGIN_BUNDLED_LIBRARIES)
15 |
16 | foreach(plugin ${FLUTTER_PLUGIN_LIST})
17 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin})
18 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
19 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $)
20 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
21 | endforeach(plugin)
22 |
23 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
24 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin})
25 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
26 | endforeach(ffi_plugin)
27 |
--------------------------------------------------------------------------------
/example/windows/runner/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.14)
2 | project(runner LANGUAGES CXX)
3 |
4 | add_executable(${BINARY_NAME} WIN32
5 | "flutter_window.cpp"
6 | "main.cpp"
7 | "utils.cpp"
8 | "win32_window.cpp"
9 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc"
10 | "Runner.rc"
11 | "runner.exe.manifest"
12 | )
13 | apply_standard_settings(${BINARY_NAME})
14 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX")
15 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app)
16 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}")
17 | add_dependencies(${BINARY_NAME} flutter_assemble)
18 |
--------------------------------------------------------------------------------
/example/windows/runner/Runner.rc:
--------------------------------------------------------------------------------
1 | // Microsoft Visual C++ generated resource script.
2 | //
3 | #pragma code_page(65001)
4 | #include "resource.h"
5 |
6 | #define APSTUDIO_READONLY_SYMBOLS
7 | /////////////////////////////////////////////////////////////////////////////
8 | //
9 | // Generated from the TEXTINCLUDE 2 resource.
10 | //
11 | #include "winres.h"
12 |
13 | /////////////////////////////////////////////////////////////////////////////
14 | #undef APSTUDIO_READONLY_SYMBOLS
15 |
16 | /////////////////////////////////////////////////////////////////////////////
17 | // English (United States) resources
18 |
19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
21 |
22 | #ifdef APSTUDIO_INVOKED
23 | /////////////////////////////////////////////////////////////////////////////
24 | //
25 | // TEXTINCLUDE
26 | //
27 |
28 | 1 TEXTINCLUDE
29 | BEGIN
30 | "resource.h\0"
31 | END
32 |
33 | 2 TEXTINCLUDE
34 | BEGIN
35 | "#include ""winres.h""\r\n"
36 | "\0"
37 | END
38 |
39 | 3 TEXTINCLUDE
40 | BEGIN
41 | "\r\n"
42 | "\0"
43 | END
44 |
45 | #endif // APSTUDIO_INVOKED
46 |
47 |
48 | /////////////////////////////////////////////////////////////////////////////
49 | //
50 | // Icon
51 | //
52 |
53 | // Icon with lowest ID value placed first to ensure application icon
54 | // remains consistent on all systems.
55 | IDI_APP_ICON ICON "resources\\app_icon.ico"
56 |
57 |
58 | /////////////////////////////////////////////////////////////////////////////
59 | //
60 | // Version
61 | //
62 |
63 | #ifdef FLUTTER_BUILD_NUMBER
64 | #define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER
65 | #else
66 | #define VERSION_AS_NUMBER 1,0,0
67 | #endif
68 |
69 | #ifdef FLUTTER_BUILD_NAME
70 | #define VERSION_AS_STRING #FLUTTER_BUILD_NAME
71 | #else
72 | #define VERSION_AS_STRING "1.0.0"
73 | #endif
74 |
75 | VS_VERSION_INFO VERSIONINFO
76 | FILEVERSION VERSION_AS_NUMBER
77 | PRODUCTVERSION VERSION_AS_NUMBER
78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
79 | #ifdef _DEBUG
80 | FILEFLAGS VS_FF_DEBUG
81 | #else
82 | FILEFLAGS 0x0L
83 | #endif
84 | FILEOS VOS__WINDOWS32
85 | FILETYPE VFT_APP
86 | FILESUBTYPE 0x0L
87 | BEGIN
88 | BLOCK "StringFileInfo"
89 | BEGIN
90 | BLOCK "040904e4"
91 | BEGIN
92 | VALUE "CompanyName", "com.mono0926" "\0"
93 | VALUE "FileDescription", "example" "\0"
94 | VALUE "FileVersion", VERSION_AS_STRING "\0"
95 | VALUE "InternalName", "example" "\0"
96 | VALUE "LegalCopyright", "Copyright (C) 2022 com.mono0926. All rights reserved." "\0"
97 | VALUE "OriginalFilename", "example.exe" "\0"
98 | VALUE "ProductName", "example" "\0"
99 | VALUE "ProductVersion", VERSION_AS_STRING "\0"
100 | END
101 | END
102 | BLOCK "VarFileInfo"
103 | BEGIN
104 | VALUE "Translation", 0x409, 1252
105 | END
106 | END
107 |
108 | #endif // English (United States) resources
109 | /////////////////////////////////////////////////////////////////////////////
110 |
111 |
112 |
113 | #ifndef APSTUDIO_INVOKED
114 | /////////////////////////////////////////////////////////////////////////////
115 | //
116 | // Generated from the TEXTINCLUDE 3 resource.
117 | //
118 |
119 |
120 | /////////////////////////////////////////////////////////////////////////////
121 | #endif // not APSTUDIO_INVOKED
122 |
--------------------------------------------------------------------------------
/example/windows/runner/flutter_window.cpp:
--------------------------------------------------------------------------------
1 | #include "flutter_window.h"
2 |
3 | #include
4 |
5 | #include "flutter/generated_plugin_registrant.h"
6 |
7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project)
8 | : project_(project) {}
9 |
10 | FlutterWindow::~FlutterWindow() {}
11 |
12 | bool FlutterWindow::OnCreate() {
13 | if (!Win32Window::OnCreate()) {
14 | return false;
15 | }
16 |
17 | RECT frame = GetClientArea();
18 |
19 | // The size here must match the window dimensions to avoid unnecessary surface
20 | // creation / destruction in the startup path.
21 | flutter_controller_ = std::make_unique(
22 | frame.right - frame.left, frame.bottom - frame.top, project_);
23 | // Ensure that basic setup of the controller was successful.
24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) {
25 | return false;
26 | }
27 | RegisterPlugins(flutter_controller_->engine());
28 | SetChildContent(flutter_controller_->view()->GetNativeWindow());
29 | return true;
30 | }
31 |
32 | void FlutterWindow::OnDestroy() {
33 | if (flutter_controller_) {
34 | flutter_controller_ = nullptr;
35 | }
36 |
37 | Win32Window::OnDestroy();
38 | }
39 |
40 | LRESULT
41 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message,
42 | WPARAM const wparam,
43 | LPARAM const lparam) noexcept {
44 | // Give Flutter, including plugins, an opportunity to handle window messages.
45 | if (flutter_controller_) {
46 | std::optional result =
47 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam,
48 | lparam);
49 | if (result) {
50 | return *result;
51 | }
52 | }
53 |
54 | switch (message) {
55 | case WM_FONTCHANGE:
56 | flutter_controller_->engine()->ReloadSystemFonts();
57 | break;
58 | }
59 |
60 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam);
61 | }
62 |
--------------------------------------------------------------------------------
/example/windows/runner/flutter_window.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_FLUTTER_WINDOW_H_
2 | #define RUNNER_FLUTTER_WINDOW_H_
3 |
4 | #include
5 | #include
6 |
7 | #include
8 |
9 | #include "win32_window.h"
10 |
11 | // A window that does nothing but host a Flutter view.
12 | class FlutterWindow : public Win32Window {
13 | public:
14 | // Creates a new FlutterWindow hosting a Flutter view running |project|.
15 | explicit FlutterWindow(const flutter::DartProject& project);
16 | virtual ~FlutterWindow();
17 |
18 | protected:
19 | // Win32Window:
20 | bool OnCreate() override;
21 | void OnDestroy() override;
22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam,
23 | LPARAM const lparam) noexcept override;
24 |
25 | private:
26 | // The project to run.
27 | flutter::DartProject project_;
28 |
29 | // The Flutter instance hosted by this window.
30 | std::unique_ptr flutter_controller_;
31 | };
32 |
33 | #endif // RUNNER_FLUTTER_WINDOW_H_
34 |
--------------------------------------------------------------------------------
/example/windows/runner/main.cpp:
--------------------------------------------------------------------------------
1 | #include
2 | #include
3 | #include
4 |
5 | #include "flutter_window.h"
6 | #include "utils.h"
7 |
8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
9 | _In_ wchar_t *command_line, _In_ int show_command) {
10 | // Attach to console when present (e.g., 'flutter run') or create a
11 | // new console when running with a debugger.
12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) {
13 | CreateAndAttachConsole();
14 | }
15 |
16 | // Initialize COM, so that it is available for use in the library and/or
17 | // plugins.
18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED);
19 |
20 | flutter::DartProject project(L"data");
21 |
22 | std::vector command_line_arguments =
23 | GetCommandLineArguments();
24 |
25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments));
26 |
27 | FlutterWindow window(project);
28 | Win32Window::Point origin(10, 10);
29 | Win32Window::Size size(1280, 720);
30 | if (!window.CreateAndShow(L"example", origin, size)) {
31 | return EXIT_FAILURE;
32 | }
33 | window.SetQuitOnClose(true);
34 |
35 | ::MSG msg;
36 | while (::GetMessage(&msg, nullptr, 0, 0)) {
37 | ::TranslateMessage(&msg);
38 | ::DispatchMessage(&msg);
39 | }
40 |
41 | ::CoUninitialize();
42 | return EXIT_SUCCESS;
43 | }
44 |
--------------------------------------------------------------------------------
/example/windows/runner/resource.h:
--------------------------------------------------------------------------------
1 | //{{NO_DEPENDENCIES}}
2 | // Microsoft Visual C++ generated include file.
3 | // Used by Runner.rc
4 | //
5 | #define IDI_APP_ICON 101
6 |
7 | // Next default values for new objects
8 | //
9 | #ifdef APSTUDIO_INVOKED
10 | #ifndef APSTUDIO_READONLY_SYMBOLS
11 | #define _APS_NEXT_RESOURCE_VALUE 102
12 | #define _APS_NEXT_COMMAND_VALUE 40001
13 | #define _APS_NEXT_CONTROL_VALUE 1001
14 | #define _APS_NEXT_SYMED_VALUE 101
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/example/windows/runner/resources/app_icon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/example/windows/runner/resources/app_icon.ico
--------------------------------------------------------------------------------
/example/windows/runner/runner.exe.manifest:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PerMonitorV2
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/example/windows/runner/utils.cpp:
--------------------------------------------------------------------------------
1 | #include "utils.h"
2 |
3 | #include
4 | #include
5 | #include
6 | #include
7 |
8 | #include
9 |
10 | void CreateAndAttachConsole() {
11 | if (::AllocConsole()) {
12 | FILE *unused;
13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) {
14 | _dup2(_fileno(stdout), 1);
15 | }
16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) {
17 | _dup2(_fileno(stdout), 2);
18 | }
19 | std::ios::sync_with_stdio();
20 | FlutterDesktopResyncOutputStreams();
21 | }
22 | }
23 |
24 | std::vector GetCommandLineArguments() {
25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use.
26 | int argc;
27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
28 | if (argv == nullptr) {
29 | return std::vector();
30 | }
31 |
32 | std::vector command_line_arguments;
33 |
34 | // Skip the first argument as it's the binary name.
35 | for (int i = 1; i < argc; i++) {
36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i]));
37 | }
38 |
39 | ::LocalFree(argv);
40 |
41 | return command_line_arguments;
42 | }
43 |
44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) {
45 | if (utf16_string == nullptr) {
46 | return std::string();
47 | }
48 | int target_length = ::WideCharToMultiByte(
49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
50 | -1, nullptr, 0, nullptr, nullptr);
51 | if (target_length == 0) {
52 | return std::string();
53 | }
54 | std::string utf8_string;
55 | utf8_string.resize(target_length);
56 | int converted_length = ::WideCharToMultiByte(
57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string,
58 | -1, utf8_string.data(),
59 | target_length, nullptr, nullptr);
60 | if (converted_length == 0) {
61 | return std::string();
62 | }
63 | return utf8_string;
64 | }
65 |
--------------------------------------------------------------------------------
/example/windows/runner/utils.h:
--------------------------------------------------------------------------------
1 | #ifndef RUNNER_UTILS_H_
2 | #define RUNNER_UTILS_H_
3 |
4 | #include
5 | #include
6 |
7 | // Creates a console for the process, and redirects stdout and stderr to
8 | // it for both the runner and the Flutter library.
9 | void CreateAndAttachConsole();
10 |
11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string
12 | // encoded in UTF-8. Returns an empty std::string on failure.
13 | std::string Utf8FromUtf16(const wchar_t* utf16_string);
14 |
15 | // Gets the command line arguments passed in as a std::vector,
16 | // encoded in UTF-8. Returns an empty std::vector on failure.
17 | std::vector GetCommandLineArguments();
18 |
19 | #endif // RUNNER_UTILS_H_
20 |
--------------------------------------------------------------------------------
/firebase.json:
--------------------------------------------------------------------------------
1 | {
2 | "hosting": [
3 | {
4 | "target": "mono-kit",
5 | "public": "example/build/web",
6 | "rewrites": [
7 | {
8 | "source": "**",
9 | "destination": "/index.html"
10 | }
11 | ]
12 | }
13 | ]
14 | }
15 |
--------------------------------------------------------------------------------
/ios/.gitignore:
--------------------------------------------------------------------------------
1 | .idea/
2 | .vagrant/
3 | .sconsign.dblite
4 | .svn/
5 |
6 | .DS_Store
7 | *.swp
8 | profile
9 |
10 | DerivedData/
11 | build/
12 | GeneratedPluginRegistrant.h
13 | GeneratedPluginRegistrant.m
14 |
15 | .generated/
16 |
17 | *.pbxuser
18 | *.mode1v3
19 | *.mode2v3
20 | *.perspectivev3
21 |
22 | !default.pbxuser
23 | !default.mode1v3
24 | !default.mode2v3
25 | !default.perspectivev3
26 |
27 | xcuserdata
28 |
29 | *.moved-aside
30 |
31 | *.pyc
32 | *sync/
33 | Icon?
34 | .tags*
35 |
36 | /Flutter/Generated.xcconfig
37 |
--------------------------------------------------------------------------------
/ios/Assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mono0926/flutter_mono_kit/eb41505420d5ffa8dcd04048a9a3dad6c9eae3ab/ios/Assets/.gitkeep
--------------------------------------------------------------------------------
/ios/Classes/MonoKitPlugin.h:
--------------------------------------------------------------------------------
1 | #import
2 |
3 | @interface MonoKitPlugin : NSObject
4 | @end
5 |
--------------------------------------------------------------------------------
/ios/Classes/MonoKitPlugin.m:
--------------------------------------------------------------------------------
1 | #import "MonoKitPlugin.h"
2 | #import
3 |
4 | @implementation MonoKitPlugin
5 | + (void)registerWithRegistrar:(NSObject*)registrar {
6 | [SwiftMonoKitPlugin registerWithRegistrar:registrar];
7 | }
8 | @end
9 |
--------------------------------------------------------------------------------
/ios/Classes/SwiftMonoKitPlugin.swift:
--------------------------------------------------------------------------------
1 | import Flutter
2 | import UIKit
3 |
4 | public class SwiftMonoKitPlugin: NSObject, FlutterPlugin {
5 | public static func register(with registrar: FlutterPluginRegistrar) {
6 | let channel = FlutterMethodChannel(name: "mono_kit", binaryMessenger: registrar.messenger())
7 | let instance = SwiftMonoKitPlugin()
8 | registrar.addMethodCallDelegate(instance, channel: channel)
9 | }
10 |
11 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
12 | let method = call.method
13 | let info = method.split(separator: ("/"))
14 | let group = info[0]
15 | let path = info[1]
16 | let arguments = call.arguments! as! [String: String]
17 | switch group {
18 | case "info_plist":
19 | let key = arguments["key"]!
20 | switch path {
21 | case "read_string":
22 | let value = Bundle.main.object(forInfoDictionaryKey: key) as! String
23 | result(value)
24 | default:
25 | result(FlutterMethodNotImplemented)
26 | }
27 |
28 | default:
29 | result(FlutterMethodNotImplemented)
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/ios/mono_kit.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
3 | #
4 | Pod::Spec.new do |s|
5 | s.name = 'mono_kit'
6 | s.version = '0.0.1'
7 | s.summary = 'A new Flutter plugin.'
8 | s.description = <<-DESC
9 | A new Flutter plugin.
10 | DESC
11 | s.homepage = 'https://mono0926.com'
12 | s.license = { :file => '../LICENSE' }
13 | s.author = { 'Masayuki Ono' => 'mono0926@gmail.com' }
14 | s.source = { :path => '.' }
15 | s.source_files = 'Classes/**/*'
16 | s.public_header_files = 'Classes/**/*.h'
17 | s.dependency 'Flutter'
18 |
19 | s.ios.deployment_target = '8.0'
20 | end
21 |
22 |
--------------------------------------------------------------------------------
/lib/errors/errors.dart:
--------------------------------------------------------------------------------
1 | export 'unexpected_error.dart';
2 |
--------------------------------------------------------------------------------
/lib/errors/unexpected_error.dart:
--------------------------------------------------------------------------------
1 | /// https://zenn.dev/mono/articles/082dde5601ab4de858a1
2 | class UnexpectedError extends AssertionError {
3 | UnexpectedError(Object value) : super('Unexpected value: $value');
4 | }
5 |
--------------------------------------------------------------------------------
/lib/extensions/color.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:tinycolor2/tinycolor2.dart';
3 |
4 | extension ColorEx on Color {
5 | MaterialColor get materialColor {
6 | final tiny = TinyColor.fromColor(this);
7 | return MaterialColor(
8 | // ignore: deprecated_member_use
9 | value,
10 | Map.fromIterables(
11 | [50, 100, 200, 300, 400, 500, 600, 700, 800, 900],
12 | List.generate(
13 | 10,
14 | (i) => (i * 100 - 500) ~/ 15,
15 | // TODO(mono): broken
16 | ).map((v) => (v.isNegative ? tiny.brighten(-v) : tiny.darken(v)).color),
17 | ),
18 | );
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/lib/extensions/enum.dart:
--------------------------------------------------------------------------------
1 | extension EnumByName on Iterable {
2 | T? byNameOrNull(String? name) {
3 | for (final value in this) {
4 | if (value.name == name) {
5 | return value;
6 | }
7 | }
8 | return null;
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/lib/extensions/extensions.dart:
--------------------------------------------------------------------------------
1 | export 'color.dart';
2 | export 'enum.dart';
3 | export 'iterable.dart';
4 | export 'navigator_state.dart';
5 | export 'scaffold_messenger_state.dart';
6 | export 'state_notifier.dart';
7 | export 'string.dart';
8 | export 'theme_data.dart';
9 |
--------------------------------------------------------------------------------
/lib/extensions/iterable.dart:
--------------------------------------------------------------------------------
1 | extension IterableEx on Iterable {
2 | bool containsAll(Iterable list) => !list.any((x) => !contains(x));
3 | }
4 |
--------------------------------------------------------------------------------
/lib/extensions/navigator_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 |
3 | extension NavigatorStateEx on NavigatorState {
4 | void popToRouteName(String name) {
5 | popUntil(ModalRoute.withName(name));
6 | }
7 |
8 | void popToRoot() {
9 | popUntil((r) => r.isFirst);
10 | }
11 |
12 | void popToFirstFullscreenDialog() {
13 | popUntil((r) => (r is PageRoute) && r.fullscreenDialog);
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/lib/extensions/scaffold_messenger_state.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | extension SnackBarPresenterEx on ScaffoldMessengerState {
4 | ScaffoldFeatureController showMessage(
5 | String text,
6 | ) {
7 | return _show(
8 | SnackBar(
9 | content: Text(text),
10 | ),
11 | );
12 | }
13 |
14 | ScaffoldFeatureController showUndo(
15 | String text, {
16 | required VoidCallback onUndo,
17 | required ThemeData theme,
18 | Color? undoButtonColor,
19 | SnackBarL10n l10n = const SnackBarL10n(),
20 | }) {
21 | return showMessageWithAction(
22 | text,
23 | onAction: onUndo,
24 | actionLabel: l10n.undo,
25 | actionColor: undoButtonColor,
26 | theme: theme,
27 | );
28 | }
29 |
30 | ScaffoldFeatureController
31 | showMessageWithAction(
32 | String text, {
33 | required VoidCallback onAction,
34 | required String actionLabel,
35 | required ThemeData theme,
36 | Color? actionColor,
37 | }) {
38 | return _show(
39 | SnackBar(
40 | content: Text(text),
41 | action: SnackBarAction(
42 | textColor: actionColor ?? theme.colorScheme.inversePrimary,
43 | label: actionLabel,
44 | onPressed: onAction,
45 | ),
46 | ),
47 | );
48 | }
49 |
50 | ScaffoldFeatureController showError(
51 | dynamic error, {
52 | required ThemeData theme,
53 | SnackBarL10n l10n = const SnackBarL10n(),
54 | Color? backgroundColor,
55 | Color? textColor,
56 | }) {
57 | final colorScheme = theme.colorScheme;
58 | return _show(
59 | SnackBar(
60 | backgroundColor: backgroundColor ?? colorScheme.error,
61 | content: Text(
62 | l10n.localizeError(error),
63 | style: TextStyle(
64 | color: textColor ?? colorScheme.onError,
65 | ),
66 | ),
67 | ),
68 | );
69 | }
70 |
71 | ScaffoldFeatureController _show(
72 | SnackBar snackBar,
73 | ) {
74 | removeCurrentSnackBar();
75 | return showSnackBar(snackBar);
76 | }
77 | }
78 |
79 | @immutable
80 | class SnackBarL10n {
81 | const SnackBarL10n();
82 | String get undo => 'UNDO';
83 | String localizeError(dynamic error) => '$error';
84 | }
85 |
--------------------------------------------------------------------------------
/lib/extensions/state_notifier.dart:
--------------------------------------------------------------------------------
1 | import 'package:rxdart/rxdart.dart';
2 | import 'package:state_notifier/state_notifier.dart';
3 |
4 | extension StateNotifierEx on StateNotifier {
5 | // stream.shareValueSeeded(state)してValueStream にしたいものの、
6 | // shareValueSeededの購読数がゼロになるとそれ以降の購読に反応しなくなる挙動が
7 | // 罠になりがちなので避けた(同期的に現在の値を取りたい場合は普通にstateアクセスで済む)。
8 | Stream get streamWithCurrent =>
9 | // ignore: invalid_use_of_protected_member, invalid_use_of_visible_for_testing_member
10 | Rx.concatEager([Stream.value(state), stream]);
11 | }
12 |
--------------------------------------------------------------------------------
/lib/extensions/string.dart:
--------------------------------------------------------------------------------
1 | extension StringEx on String? {
2 | bool get isNullOrEmpty {
3 | final string = this;
4 | return string == null || string.isEmpty;
5 | }
6 |
7 | String? get nullIfEmpty => isNullOrEmpty ? null : this;
8 | }
9 |
--------------------------------------------------------------------------------
/lib/extensions/theme_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/cupertino.dart';
2 | import 'package:flutter/material.dart';
3 |
4 | extension ThemeDataEx on ThemeData {
5 | ThemeData unifyToMobileApp() {
6 | return copyWith(
7 | visualDensity: VisualDensity.standard,
8 | materialTapTargetSize: MaterialTapTargetSize.padded,
9 | );
10 | }
11 |
12 | /// Create ThemeData which follows latest Material Design Spec.
13 | ThemeData followLatestSpec() {
14 | return copyWith(
15 | snackBarTheme: snackBarTheme.copyWith(
16 | behavior: SnackBarBehavior.floating,
17 | ),
18 | splashFactory: InkSparkle.splashFactory,
19 | pageTransitionsTheme: const PageTransitionsTheme(
20 | builders: {
21 | TargetPlatform.android: FadeForwardsPageTransitionsBuilder(),
22 | TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
23 | TargetPlatform.macOS: CupertinoPageTransitionsBuilder(),
24 | },
25 | ),
26 | progressIndicatorTheme: progressIndicatorTheme.copyWith(year2023: false),
27 | sliderTheme: sliderTheme.copyWith(year2023: false),
28 | );
29 | }
30 | }
31 |
32 | ThemeData lightTheme() => ThemeData.from(
33 | colorScheme: ColorScheme.fromSeed(
34 | seedColor: Colors.green,
35 | ),
36 | useMaterial3: true,
37 | ).followLatestSpec();
38 | ThemeData darkTheme() => ThemeData.from(
39 | colorScheme: ColorScheme.fromSeed(
40 | seedColor: Colors.green,
41 | brightness: Brightness.dark,
42 | ),
43 | useMaterial3: true,
44 | ).followLatestSpec().copyWith(
45 | cupertinoOverrideTheme: const CupertinoThemeData(
46 | // Needed for correct CupertinoTextField color (bug?)
47 | textTheme: CupertinoTextThemeData(),
48 | ),
49 | );
50 |
--------------------------------------------------------------------------------
/lib/functions/functions.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/foundation.dart';
2 | import 'package:flutter/widgets.dart';
3 |
4 | export 'show_error_dialog.dart';
5 | export 'show_photo_selection_sheet.dart';
6 |
7 | String convertToHalfWidth(String text) {
8 | return text.replaceAllMapped(
9 | RegExp(r'[0-9a-zA-Z]'),
10 | (m) => String.fromCharCode(m[0]!.codeUnitAt(0) - 65248),
11 | );
12 | }
13 |
14 | /// Show error unless ReleaseMode and isProduction is true.
15 | ///
16 | /// Modified from this:
17 | /// https://github.com/flutter/flutter/blob/62621507966463f9fe678b3e249a64f1be11c9a1/packages/flutter/lib/src/widgets/framework.dart#L4376
18 | void configureErrorWidgetBuilder({
19 | required bool isProduction,
20 | ErrorWidgetBuilder? productionBuilder,
21 | }) {
22 | ErrorWidget.builder = (details) {
23 | final message = kReleaseMode && isProduction
24 | ? ''
25 | : '${_stringifyException(details.exception)}\n'
26 | 'See also: https://flutter.dev/docs/testing/errors';
27 | final dynamic exception = details.exception;
28 | if (isProduction && productionBuilder != null) {
29 | return productionBuilder(details);
30 | }
31 | return ErrorWidget.withDetails(
32 | message: message,
33 | error: exception is FlutterError ? exception : null,
34 | );
35 | };
36 | }
37 |
38 | String _stringifyException(Object exception) {
39 | try {
40 | return exception.toString();
41 | // ignore: avoid_catches_without_on_clauses
42 | } catch (e) {
43 | // intentionally left empty.
44 | }
45 | return 'Error';
46 | }
47 |
--------------------------------------------------------------------------------
/lib/functions/show_error_dialog.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 |
3 | void showErrorDialog({
4 | required BuildContext context,
5 | @required dynamic error,
6 | ErrorDialogL10n l10n = const ErrorDialogL10n(),
7 | }) {
8 | showDialog(
9 | context: context,
10 | builder: (context) => AlertDialog(
11 | title: Text(
12 | l10n.errorTitle,
13 | style: TextStyle(
14 | color: Theme.of(context).colorScheme.error,
15 | ),
16 | ),
17 | content: Text(
18 | l10n.localizeError(error),
19 | ),
20 | actions: [
21 | ElevatedButton(
22 | onPressed: () {
23 | Navigator.of(context).pop();
24 | },
25 | child: Text(MaterialLocalizations.of(context).okButtonLabel),
26 | ),
27 | ],
28 | ),
29 | );
30 | }
31 |
32 | @immutable
33 | class ErrorDialogL10n {
34 | const ErrorDialogL10n();
35 | String get errorTitle => 'エラーが発生しました';
36 | String localizeError(dynamic error) => '$error';
37 | }
38 |
--------------------------------------------------------------------------------
/lib/functions/show_photo_selection_sheet.dart:
--------------------------------------------------------------------------------
1 | import 'package:adaptive_dialog/adaptive_dialog.dart';
2 | import 'package:flutter/material.dart';
3 | import 'package:flutter/services.dart';
4 | import 'package:image_picker/image_picker.dart';
5 | import 'package:mono_kit/utils/logger.dart';
6 | import 'package:mono_kit/utils/utils.dart';
7 |
8 | Future> showPhotoSelectionSheet({
9 | required BuildContext context,
10 | PhotoSelectionL10n l10n = const PhotoSelectionL10n(),
11 | VoidCallback? onSettingAppOpenRequested,
12 | bool requestFullMetadata = false,
13 | bool allowMultiple = false,
14 | (List>, ValueSetter)? additionalActions,
15 | }) async {
16 | final source = await showModalActionSheet