├── example
├── ios
│ ├── Flutter
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── 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-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ ├── contents.xcworkspacedata
│ │ │ └── xcshareddata
│ │ │ │ ├── WorkspaceSettings.xcsettings
│ │ │ │ └── IDEWorkspaceChecks.plist
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ └── .gitignore
├── android
│ ├── gradle.properties
│ ├── app
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── 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
│ │ │ │ │ ├── drawable
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ │ └── values
│ │ │ │ │ │ └── styles.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── .gitignore
│ ├── settings.gradle
│ └── build.gradle
├── .metadata
├── README.md
├── .gitignore
├── pubspec.yaml
├── pubspec.lock
└── lib
│ └── main.dart
├── logo.png
├── lib
├── spaces.dart
└── src
│ ├── spacing.dart
│ ├── space.dart
│ ├── spacing_data.dart
│ ├── spaced_flex.dart
│ └── spacing_data.freezed.dart
├── .metadata
├── .vscode
└── launch.json
├── analysis_options.yaml
├── pubspec.yaml
├── CHANGELOG.md
├── LICENSE
├── .gitignore
├── README.md
└── pubspec.lock
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/logo.png
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1536M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/lib/spaces.dart:
--------------------------------------------------------------------------------
1 | library spaces;
2 |
3 | export 'src/space.dart';
4 | export 'src/spacing.dart';
5 | export 'src/spaced_flex.dart';
6 | export 'src/spacing_data.dart';
7 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/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/aloisdeniel/spaces/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/aloisdeniel/spaces/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example
2 |
3 | import io.flutter.embedding.android.FlutterActivity
4 |
5 | class MainActivity: FlutterActivity() {
6 | }
7 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
9 | # Remember to never publicly share your keystore.
10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
11 | key.properties
12 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | PreviewsEnabled
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.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: bbfbf1770cca2da7c82e887e4e4af910034800b6
8 | channel: stable
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/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: bbfbf1770cca2da7c82e887e4e4af910034800b6
8 | channel: stable
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/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.
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // Use IntelliSense to learn about possible attributes.
3 | // Hover to view descriptions of existing attributes.
4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5 | "version": "0.2.0",
6 | "configurations": [
7 | {
8 | "name": "Example",
9 | "program": "example/lib/main.dart",
10 | "request": "launch",
11 | "type": "dart"
12 | }
13 | ]
14 | }
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4 | def properties = new Properties()
5 |
6 | assert localPropertiesFile.exists()
7 | localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
8 |
9 | def flutterSdkPath = properties.getProperty("flutter.sdk")
10 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11 | apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
12 |
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | # Defines a default set of lint rules enforced for
2 | # projects at Google. For details and rationale,
3 | # see https://github.com/dart-lang/pedantic#enabled-lints.
4 | include: package:pedantic/analysis_options.yaml
5 |
6 | # For lint rules and documentation, see http://dart-lang.github.io/linter/lints.
7 | # Uncomment to specify additional rules.
8 | # linter:
9 | # rules:
10 | # - camel_case_types
11 |
12 | analyzer:
13 | errors:
14 | missing_required_param: error
15 | missing_return: error
16 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: spaces
2 | description: Defining global spacing constants for building consistent and responsive apps.
3 | version: 0.5.0
4 | homepage: https://github.com/aloisdeniel/spaces
5 |
6 | environment:
7 | sdk: ">=2.12.0 <3.0.0"
8 | flutter: ">=2.0.0 <3.0.0"
9 |
10 | dependencies:
11 | gap: ^2.0.0-nullsafety.1
12 | flutter:
13 | sdk: flutter
14 | freezed_annotation: ^0.13.0-nullsafety.0
15 |
16 | dev_dependencies:
17 | freezed: ^0.14.0-nullsafety.0
18 | build_runner: ^1.11.5
19 | flutter_test:
20 | sdk: flutter
21 |
22 | flutter:
23 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example
2 |
3 | A new Flutter project.
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 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [0.5.0] - 2021/03/04
2 |
3 | * Migration to null-safety.
4 |
5 | ## [0.4.1] - 2020/08/20
6 |
7 | * Updated generated values.
8 | * Updated documentation.
9 |
10 | ## [0.4.0] - 2020/08/20
11 |
12 | * Updated `SpacingData.fromSpaces` constructor.
13 |
14 | ## [0.3.1] - 2020/08/20
15 |
16 | * Improved documentation with quickstart.
17 |
18 | ## [0.3.0] - 2020/08/20
19 |
20 | * Updated generated amount.
21 |
22 | ## [0.2.2] - 2020/08/20
23 |
24 | * Fixed sample in documentation
25 |
26 | ## [0.2.1] - 2020/08/20
27 |
28 | * Fixed logo in documentation
29 |
30 | ## [0.2.0] - 2020/08/20
31 |
32 | * Initial release
33 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/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 | **/ios/Flutter/.last_build_id
26 | .dart_tool/
27 | .flutter-plugins
28 | .flutter-plugins-dependencies
29 | .packages
30 | .pub-cache/
31 | .pub/
32 | /build/
33 |
34 | # Web related
35 | lib/generated_plugin_registrant.dart
36 |
37 | # Symbolication related
38 | app.*.symbols
39 |
40 | # Obfuscation related
41 | app.*.map.json
42 |
43 | # Exceptions to above rules.
44 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
45 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
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 | 8.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
15 |
18 |
19 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Aloïs Deniel
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 |
--------------------------------------------------------------------------------
/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 |
45 |
46 |
--------------------------------------------------------------------------------
/.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 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
76 |
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.example"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | }
47 |
48 | buildTypes {
49 | release {
50 | // TODO: Add your own signing config for the release build.
51 | // Signing with the debug keys for now, so `flutter run --release` works.
52 | signingConfig signingConfigs.debug
53 | }
54 | }
55 | }
56 |
57 | flutter {
58 | source '../..'
59 | }
60 |
61 | dependencies {
62 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
63 | }
64 |
--------------------------------------------------------------------------------
/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/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
23 |
27 |
32 |
36 |
37 |
38 |
39 |
40 |
41 |
43 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/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/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example
2 | description: A new Flutter project.
3 |
4 | # The following line prevents the package from being accidentally published to
5 | # pub.dev using `pub publish`. This is preferred for private packages.
6 | publish_to: 'none' # Remove this line if you wish to publish to pub.dev
7 |
8 | # The following defines the version and build number for your application.
9 | # A version number is three numbers separated by dots, like 1.2.43
10 | # followed by an optional build number separated by a +.
11 | # Both the version and the builder number may be overridden in flutter
12 | # build by specifying --build-name and --build-number, respectively.
13 | # In Android, build-name is used as versionName while build-number used as versionCode.
14 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
15 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
16 | # Read more about iOS versioning at
17 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
18 | version: 1.0.0+1
19 |
20 | environment:
21 | sdk: ">=2.12.0 <3.0.0"
22 |
23 | dependencies:
24 | spaces:
25 | path: ../
26 | flutter:
27 | sdk: flutter
28 |
29 |
30 | # The following adds the Cupertino Icons font to your application.
31 | # Use with the CupertinoIcons class for iOS style icons.
32 | cupertino_icons: ^0.1.3
33 |
34 | dev_dependencies:
35 | flutter_test:
36 | sdk: flutter
37 |
38 | # For information on the generic Dart part of this file, see the
39 | # following page: https://dart.dev/tools/pub/pubspec
40 |
41 | # The following section is specific to Flutter.
42 | flutter:
43 |
44 | # The following line ensures that the Material Icons font is
45 | # included with your application, so that you can use the icons in
46 | # the material Icons class.
47 | uses-material-design: true
48 |
49 | # To add assets to your application, add an assets section, like this:
50 | # assets:
51 | # - images/a_dot_burr.jpeg
52 | # - images/a_dot_ham.jpeg
53 |
54 | # An image asset can refer to one or more resolution-specific "variants", see
55 | # https://flutter.dev/assets-and-images/#resolution-aware.
56 |
57 | # For details regarding adding assets from package dependencies, see
58 | # https://flutter.dev/assets-and-images/#from-packages
59 |
60 | # To add custom fonts to your application, add a fonts section here,
61 | # in this "flutter" section. Each entry in this list should have a
62 | # "family" key with the font family name, and a "fonts" key with a
63 | # list giving the asset and other descriptors for the font. For
64 | # example:
65 | # fonts:
66 | # - family: Schyler
67 | # fonts:
68 | # - asset: fonts/Schyler-Regular.ttf
69 | # - asset: fonts/Schyler-Italic.ttf
70 | # style: italic
71 | # - family: Trajan Pro
72 | # fonts:
73 | # - asset: fonts/TrajanPro.ttf
74 | # - asset: fonts/TrajanPro_Bold.ttf
75 | # weight: 700
76 | #
77 | # For details regarding fonts from package dependencies,
78 | # see https://flutter.dev/custom-fonts/#from-packages
79 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/lib/src/spacing.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:spaces/src/spacing_data.dart';
3 |
4 | typedef DataBuilder = T Function(BuildContext context);
5 |
6 | /// Applies a global spacing configuration to descendant widgets.
7 | ///
8 | /// See also:
9 | ///
10 | /// * [SpacingData], which describes the actual spacing configuration
11 | /// * [Space], a gap widget that uses the spacing configuration
12 | /// * [SpacedFlex], a flex widget that uses the spacing configuration
13 | class Spacing extends StatelessWidget {
14 | final DataBuilder dataBuilder;
15 | final Widget child;
16 |
17 | /// Applies the spacing resulting from the given [dataBuilder] to [child].
18 | ///
19 | /// The [dataBuilder] and [child] arguments must not be null.
20 | const Spacing({
21 | Key? key,
22 | required this.child,
23 | required this.dataBuilder,
24 | }) : super(key: key);
25 |
26 | /// Applies the given [data] to [child].
27 | ///
28 | /// The [data] and [child] arguments must not be null.
29 | Spacing.fixed({
30 | Key? key,
31 | required this.child,
32 | required SpacingData data,
33 | }) : assert(data != null),
34 | assert(child != null),
35 | dataBuilder = ((BuildContext context) => data),
36 | super(key: key);
37 |
38 | /// The data from the closest [Spacing] instance that encloses the given
39 | /// context.
40 | ///
41 | /// Typical usage is as follows:
42 | ///
43 | /// ```dart
44 | /// @override
45 | /// Widget build(BuildContext context) {
46 | /// return SizedBox(
47 | /// height: Spacing.of(context).spaces.small,
48 | /// );
49 | /// }
50 | /// ```
51 | ///
52 | /// When the [Spacing] is actually created in the same `build` function
53 | /// (possibly indirectly, e.g. as part of a [MaterialApp]), the `context`
54 | /// argument to the `build` function can't be used to find the [Spacing] (since
55 | /// it's "above" the widget being returned). In such cases, the following
56 | /// technique with a [Builder] can be used to provide a new scope with a
57 | /// [BuildContext] that is "under" the [Spacing]:
58 | ///
59 | /// ```dart
60 | /// @override
61 | /// Widget build(BuildContext context) {
62 | /// return Spacing(
63 | /// data: SpacingData.fixed(10.0),
64 | /// body: Builder(
65 | /// // Create an inner BuildContext so that we can refer to
66 | /// // the Spacing with Spacing.of().
67 | /// builder: (BuildContext context) {
68 | /// return Center(
69 | /// child:SizedBox(
70 | /// height: Spacing.of(context).spaces.small,
71 | /// ),
72 | /// );
73 | /// },
74 | /// ),
75 | /// );
76 | /// }
77 | /// ```
78 | static SpacingData of(BuildContext context) {
79 | final provider =
80 | context.dependOnInheritedWidgetOfExactType<_SpacingDataProvider>();
81 | assert(
82 | provider != null,
83 | 'No Spacing in widget tree. Make sure that you declared a Spacing.',
84 | );
85 | return provider!.data;
86 | }
87 |
88 | @override
89 | Widget build(BuildContext context) {
90 | return _SpacingDataProvider(
91 | data: dataBuilder(context),
92 | child: child,
93 | );
94 | }
95 | }
96 |
97 | extension SpacingExtension on BuildContext {
98 | SpacingData spacing() => Spacing.of(this);
99 | }
100 |
101 | extension SpaceSizeExtension on SpaceSize {
102 | double toPoints(BuildContext context) {
103 | final spacing = context.spacing();
104 | switch (this) {
105 | case SpaceSize.extraSmall:
106 | return spacing.spaces.extraSmall;
107 | case SpaceSize.small:
108 | return spacing.spaces.small;
109 | case SpaceSize.semiSmall:
110 | return spacing.spaces.semiSmall;
111 | case SpaceSize.semiBig:
112 | return spacing.spaces.semiBig;
113 | case SpaceSize.big:
114 | return spacing.spaces.big;
115 | case SpaceSize.extraBig:
116 | return spacing.spaces.extraBig;
117 | default:
118 | return spacing.spaces.normal;
119 | }
120 | }
121 | }
122 |
123 | class _SpacingDataProvider extends InheritedWidget {
124 | final SpacingData data;
125 | const _SpacingDataProvider({
126 | Key? key,
127 | required Widget child,
128 | required this.data,
129 | }) : super(
130 | key: key,
131 | child: child,
132 | );
133 |
134 | @override
135 | bool updateShouldNotify(_SpacingDataProvider oldWidget) {
136 | return data != oldWidget.data;
137 | }
138 | }
139 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.5.0"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.1.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.2.0"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.15.0"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "0.1.3"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.2.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | freezed_annotation:
71 | dependency: transitive
72 | description:
73 | name: freezed_annotation
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.13.0-nullsafety.0"
77 | gap:
78 | dependency: transitive
79 | description:
80 | name: gap
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "2.0.0-nullsafety.1"
84 | json_annotation:
85 | dependency: transitive
86 | description:
87 | name: json_annotation
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "4.0.0"
91 | matcher:
92 | dependency: transitive
93 | description:
94 | name: matcher
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "0.12.10"
98 | meta:
99 | dependency: transitive
100 | description:
101 | name: meta
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "1.3.0"
105 | path:
106 | dependency: transitive
107 | description:
108 | name: path
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "1.8.0"
112 | sky_engine:
113 | dependency: transitive
114 | description: flutter
115 | source: sdk
116 | version: "0.0.99"
117 | source_span:
118 | dependency: transitive
119 | description:
120 | name: source_span
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.8.0"
124 | spaces:
125 | dependency: "direct main"
126 | description:
127 | path: ".."
128 | relative: true
129 | source: path
130 | version: "0.5.0"
131 | stack_trace:
132 | dependency: transitive
133 | description:
134 | name: stack_trace
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.10.0"
138 | stream_channel:
139 | dependency: transitive
140 | description:
141 | name: stream_channel
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "2.1.0"
145 | string_scanner:
146 | dependency: transitive
147 | description:
148 | name: string_scanner
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.1.0"
152 | term_glyph:
153 | dependency: transitive
154 | description:
155 | name: term_glyph
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "1.2.0"
159 | test_api:
160 | dependency: transitive
161 | description:
162 | name: test_api
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "0.2.19"
166 | typed_data:
167 | dependency: transitive
168 | description:
169 | name: typed_data
170 | url: "https://pub.dartlang.org"
171 | source: hosted
172 | version: "1.3.0"
173 | vector_math:
174 | dependency: transitive
175 | description:
176 | name: vector_math
177 | url: "https://pub.dartlang.org"
178 | source: hosted
179 | version: "2.1.0"
180 | sdks:
181 | dart: ">=2.12.0 <3.0.0"
182 | flutter: ">=2.0.0"
183 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | # Spaces
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 | Defining global spacing constants for building consistent and responsive apps.
13 |
14 | ## Install
15 |
16 | Add the dependency to your `pubspec.yaml` :
17 |
18 | ```yaml
19 | dependencies:
20 | spaces:
21 | ```
22 |
23 | ## Quick start
24 |
25 | ```dart
26 | return MaterialApp(
27 | // Defining
28 | builder: (context, child) => Spacing(
29 | dataBuilder: (context) {
30 | final mediaQuery = MediaQuery.of(context);
31 | if (mediaQuery.size.width > 500) {
32 | return SpacingData.generate(30);
33 | }
34 | return SpacingData.generate(10);
35 | },
36 | child: child,
37 | ),
38 | home:Builder(builder: (context) {
39 | // Using
40 | final spacing = Spacing.of(context);
41 | return SpacedColumn.normal(
42 | padding: spacing.insets.all.semiBig,
43 | children: [
44 | Text('hello'),
45 | Space.big(),
46 | Text('world'),
47 | ],
48 | );
49 | })
50 | ),
51 | )
52 | ```
53 |
54 | # Usage
55 |
56 | ## Configuring spacing
57 |
58 | A `Spacing` widget should declare a global spacing configuration for your application.
59 |
60 | ```dart
61 | return MaterialApp(
62 | builder: (context, child) => Spacing.fixed(
63 | data: SpacingData.generate(10.0), // This generates a set of spacing constants for your apps, from a base space of `10.0`.
64 | child: child,
65 | ),
66 | /// ...
67 | )
68 | ```
69 |
70 | ### Generate
71 |
72 | By calling the `Spacing.generate` constructor, a set of constants are automatically generated from a single base value.
73 |
74 | The generated values are :
75 |
76 | * **extraSmall** : `value * 0.2`
77 | * **small** : `value * 0.4`
78 | * **semiSmall** : `value * 0.6`
79 | * **normal** : `value`
80 | * **semiBig** : `value * 1.5`
81 | * **big** : `value * 2.5`
82 | * **extraBig** : `value * 5.0`
83 |
84 | ```dart
85 | SpacingData.generate(10.0)
86 | ```
87 |
88 | ### From spaces
89 |
90 | If you want to define the various spacing values, you can use the
91 |
92 | ```dart
93 | SpacingData.fromSpaces(
94 | extraSmall: 1.0,
95 | small: 2.0,
96 | semiSmall: 4.0,
97 | normal: 8.0,
98 | semiBig: 12.0,
99 | big: 20.0,
100 | extraBig: 100.0,
101 | )
102 | ```
103 |
104 | ## Responsive spacing
105 |
106 | You can define the `dataBuilder` property of the `Spacing` constructor to generate a configuration from the given context.
107 |
108 | ```dart
109 | Spacing(
110 | dataBuilder: (context) {
111 | final mediaQuery = MediaQuery.of(context);
112 | return SpacingData.generate(mediaQuery.size.width > 300.0 ? 20.0 : 10.0),
113 | },
114 | child: child,
115 | )
116 | ```
117 |
118 | ## Using constants
119 |
120 | To access various spacing constants, simply use the `Spacing.of(context)` getter, or the `context.spacing()` extension method.
121 |
122 | ```dart
123 | final spacing = Spacing.of(context);
124 | // spacing.spaces.semiBig
125 | ```
126 |
127 | ### Size variants
128 |
129 | There are seven availables spacing constants : `extraSmall`, `small`, `semiSmall`, `normal`, `semiBig`, `big`, `extraBig`;
130 |
131 | ```dart
132 | final spacing = Spacing.of(context);
133 | return SizedBox(
134 | width: spacing.spaces.semiSmall,
135 | );
136 | ```
137 |
138 | ### Insets helpers
139 |
140 | You have `EdgeInsets` presets available from `.insets..`.
141 |
142 | The available selectors are : `all`, `horizontal`, `vertical`, `onlyLeft`, `onlyTop`, `onlyRight`, `onlyBottom`, `exceptLeft`, `exceptRight`, `exceptTop`, `exceptBottom`.
143 |
144 | ```dart
145 | final spacing = Spacing.of(context);
146 | return Padding(
147 | padding: spacing.insets.exceptLeft.semiBig,
148 | child: Text('Hello'),
149 | );
150 | ```
151 |
152 | ## Widgets
153 |
154 | ### Space
155 |
156 | The `Space` widget uses [gap](https://pub.dev/packages/gap) under the hood to define a space in a `Flex`, `Column`, `Row` or `Scrollable` (such as `ListView`).
157 |
158 | ```dart
159 | return Column(
160 | children: [
161 | Text('hello'),
162 | const Space.semiSmall(),
163 | Text('world'),
164 | ],
165 | );
166 | ```
167 |
168 | ### SpacedFlex / SpacedColumn / SpacedRow
169 |
170 | Like `Flex` / `Column` / `Row`, but with additional `padding` and `spaceBetween` properties.
171 |
172 | ```dart
173 | final spacing = Spacing.of(context);
174 | return SpacedColumn.small(
175 | padding: spacing.insets.all.normal,
176 | children: [
177 | Text('hello'),
178 | Text('world'),
179 | ],
180 | );
181 | ```
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:spaces/spaces.dart';
3 |
4 | void main() {
5 | runApp(MyApp());
6 | }
7 |
8 | class MyApp extends StatelessWidget {
9 | // This widget is the root of your application.
10 | @override
11 | Widget build(BuildContext context) {
12 | return MaterialApp(
13 | title: 'Spacing Demo',
14 | theme: ThemeData(
15 | primarySwatch: Colors.blue,
16 | visualDensity: VisualDensity.adaptivePlatformDensity,
17 | ),
18 | builder: (context, child) => Spacing(
19 | dataBuilder: (context) {
20 | final mediaQuery = MediaQuery.of(context);
21 | if (mediaQuery.size.width > 500) {
22 | return SpacingData.generate(30);
23 | }
24 | return SpacingData.generate(10);
25 | },
26 | child: child ?? SizedBox(),
27 | ),
28 | home: HomePage(),
29 | );
30 | }
31 | }
32 |
33 | class HomePage extends StatelessWidget {
34 | const HomePage({Key? key}) : super(key: key);
35 |
36 | @override
37 | Widget build(BuildContext context) {
38 | return DefaultTabController(
39 | length: 3,
40 | child: Scaffold(
41 | appBar: AppBar(
42 | title: Text('Spacing'),
43 | bottom: TabBar(
44 | tabs: [
45 | Tab(
46 | text: 'Values',
47 | ),
48 | Tab(
49 | text: 'Space',
50 | ),
51 | Tab(
52 | text: 'SpacedFlex',
53 | ),
54 | ],
55 | ),
56 | ),
57 | body: TabBarView(
58 | children: [
59 | const ValuesTab(),
60 | const SpaceTab(),
61 | const SpacedFlexTab(),
62 | ],
63 | ),
64 | ),
65 | );
66 | }
67 | }
68 |
69 | class ValuesTab extends StatelessWidget {
70 | const ValuesTab();
71 |
72 | Widget _box(BuildContext context, String title, double height) {
73 | final spacing = Spacing.of(context);
74 | return Padding(
75 | padding: spacing.insets.all.normal,
76 | child: Column(
77 | children: [
78 | Text(
79 | title,
80 | textAlign: TextAlign.center,
81 | ),
82 | Container(
83 | color: Colors.red,
84 | width: spacing.spaces.big,
85 | height: height,
86 | ),
87 | ],
88 | ),
89 | );
90 | }
91 |
92 | @override
93 | Widget build(BuildContext context) {
94 | final spacing = Spacing.of(context);
95 | return Container(
96 | color: Colors.red.withOpacity(0.2),
97 | margin: spacing.insets.all.big,
98 | padding: spacing.insets.all.normal,
99 | child: ListView(
100 | children: [
101 | _box(context, 'extraSmall', spacing.spaces.extraSmall),
102 | _box(context, 'small', spacing.spaces.small),
103 | _box(context, 'semiSmall', spacing.spaces.semiSmall),
104 | _box(context, 'normal', spacing.spaces.normal),
105 | _box(context, 'semiBig', spacing.spaces.semiBig),
106 | _box(context, 'big', spacing.spaces.big),
107 | _box(context, 'extraBig', spacing.spaces.extraBig),
108 | ],
109 | ),
110 | );
111 | }
112 | }
113 |
114 | class SpaceTab extends StatelessWidget {
115 | const SpaceTab();
116 |
117 | Widget _box(BuildContext context) {
118 | return Container(
119 | color: Colors.blue,
120 | width: 20.0,
121 | height: 20.0,
122 | );
123 | }
124 |
125 | @override
126 | Widget build(BuildContext context) {
127 | final spacing = Spacing.of(context);
128 | return Container(
129 | color: Colors.blue.withOpacity(0.2),
130 | margin: spacing.insets.all.big,
131 | padding: spacing.insets.all.normal,
132 | child: ListView(
133 | children: [
134 | _box(context),
135 | Space.extraSmall(),
136 | _box(context),
137 | Space.small(),
138 | _box(context),
139 | Space.semiSmall(),
140 | _box(context),
141 | Space.normal(),
142 | _box(context),
143 | Space.semiBig(),
144 | _box(context),
145 | Space.big(),
146 | _box(context),
147 | Space.extraBig(),
148 | _box(context),
149 | ],
150 | ),
151 | );
152 | }
153 | }
154 |
155 | class SpacedFlexTab extends StatelessWidget {
156 | const SpacedFlexTab();
157 |
158 | Widget _box(BuildContext context) {
159 | return Container(
160 | color: Colors.green,
161 | width: 20.0,
162 | height: 20.0,
163 | );
164 | }
165 |
166 | @override
167 | Widget build(BuildContext context) {
168 | final spacing = Spacing.of(context);
169 | return Container(
170 | color: Colors.green.withOpacity(0.2),
171 | child: ListView(
172 | children: [
173 | SpacedColumn.normal(
174 | padding: spacing.insets.all.normal,
175 | children: [
176 | _box(context),
177 | _box(context),
178 | _box(context),
179 | _box(context),
180 | ],
181 | ),
182 | Center(
183 | child: SpacedRow.normal(
184 | padding: spacing.insets.all.normal,
185 | mainAxisSize: MainAxisSize.min,
186 | children: [
187 | _box(context),
188 | _box(context),
189 | _box(context),
190 | _box(context),
191 | ],
192 | ),
193 | ),
194 | ],
195 | ),
196 | );
197 | }
198 | }
199 |
--------------------------------------------------------------------------------
/lib/src/space.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:gap/gap.dart';
3 |
4 | import 'spacing.dart';
5 | import 'spacing_data.dart';
6 |
7 | /// A widget that takes a fixed amount of space in the direction of its parent.
8 | ///
9 | /// It only works in the following cases:
10 | /// - It is a descendant of a [Row], [Column], or [Flex],
11 | /// and the path from the [Gap] widget to its enclosing [Row], [Column], or
12 | /// [Flex] must contain only [StatelessWidget]s or [StatefulWidget]s (not other
13 | /// kinds of widgets, like [RenderObjectWidget]s).
14 | /// - It is a descendant of a [Scrollable].
15 | ///
16 | /// See also:
17 | ///
18 | /// * [Gap], the base widget on which this widget is based upon
19 | /// * [SliverSpace], the sliver version of this widget.
20 | class Space extends StatelessWidget {
21 | /// The amount of space this widget takes in the direction of its parent.
22 | ///
23 | /// For example:
24 | /// - If the parent is a [Column] this is the height of this widget.
25 | /// - If the parent is a [Row] this is the width of this widget.
26 | ///
27 | /// Must not be null and must be positive.
28 | ///
29 | /// If null, then [size] should be defined.
30 | final double? mainAxisExtent;
31 |
32 | /// The amount of space this widget takes in the opposite direction of the
33 | /// parent.
34 | ///
35 | /// For example:
36 | /// - If the parent is a [Column] this is the width of this widget.
37 | /// - If the parent is a [Row] this is the height of this widget.
38 | ///
39 | /// Must be positive or null. If it's null (the default) the cross axis extent
40 | /// will be the same as the constraints of the parent in the opposite
41 | /// direction.
42 | final double? crossAxisExtent;
43 |
44 | /// The color used to fill the gap.
45 | final Color? color;
46 |
47 | /// The amount of space from [Spacing] this widget takes in the direction of its parent.
48 | ///
49 | /// For example:
50 | /// - If the parent is a [Column] this is the height of this widget.
51 | /// - If the parent is a [Row] this is the width of this widget.
52 | ///
53 | /// Must not be null and must be positive.
54 | ///
55 | /// If null, then [mainAxisExtent] should be defined.
56 | final SpaceSize? size;
57 |
58 | /// Creates a widget that takes a fixed [mainAxisExtent] of space in the
59 | /// direction of its parent.
60 | ///
61 | /// The [mainAxisExtent] must not be null and must be positive.
62 | /// The [crossAxisExtent] must be either null or positive.
63 | const Space({
64 | Key? key,
65 | required double mainAxisExtent,
66 | this.crossAxisExtent,
67 | this.color,
68 | }) : mainAxisExtent = mainAxisExtent,
69 | size = null,
70 | assert(mainAxisExtent > 0),
71 | super(key: key);
72 |
73 | /// Creates a widget that takes an `extraSmall` amount of space in the
74 | /// direction of its parent.
75 | ///
76 | /// The spacing value is defined in the global [Spacing] definition.
77 | ///
78 | /// The [crossAxisExtent] must be either null or positive.
79 | const Space.extraSmall({
80 | this.crossAxisExtent,
81 | this.color,
82 | }) : size = SpaceSize.extraSmall,
83 | mainAxisExtent = null;
84 |
85 | /// Creates a widget that takes a `small` amount of space in the
86 | /// direction of its parent.
87 | ///
88 | /// The spacing value is defined in the global [Spacing] definition.
89 | ///
90 | /// The [crossAxisExtent] must be either null or positive.
91 | const Space.small({
92 | this.crossAxisExtent,
93 | this.color,
94 | }) : size = SpaceSize.small,
95 | mainAxisExtent = null;
96 |
97 | /// Creates a widget that takes a `semiSmall` amount of space in the
98 | /// direction of its parent.
99 | ///
100 | /// The spacing value is defined in the global [Spacing] definition.
101 | ///
102 | /// The [crossAxisExtent] must be either null or positive.
103 | const Space.semiSmall({
104 | this.crossAxisExtent,
105 | this.color,
106 | }) : size = SpaceSize.semiSmall,
107 | mainAxisExtent = null;
108 |
109 | /// Creates a widget that takes a `normal` amount of space in the
110 | /// direction of its parent.
111 | ///
112 | /// The spacing value is defined in the global [Spacing] definition.
113 | ///
114 | /// The [crossAxisExtent] must be either null or positive.
115 | const Space.normal({
116 | this.crossAxisExtent,
117 | this.color,
118 | }) : size = SpaceSize.normal,
119 | mainAxisExtent = null;
120 |
121 | /// Creates a widget that takes a `semiBig` amount of space in the
122 | /// direction of its parent.
123 | ///
124 | /// The spacing value is defined in the global [Spacing] definition.
125 | ///
126 | /// The [crossAxisExtent] must be either null or positive.
127 | const Space.semiBig({
128 | this.crossAxisExtent,
129 | this.color,
130 | }) : size = SpaceSize.semiBig,
131 | mainAxisExtent = null;
132 |
133 | /// Creates a widget that takes a `big` amount of space in the
134 | /// direction of its parent.
135 | ///
136 | /// The spacing value is defined in the global [Spacing] definition.
137 | ///
138 | /// The [crossAxisExtent] must be either null or positive.
139 | const Space.big({
140 | this.crossAxisExtent,
141 | this.color,
142 | }) : size = SpaceSize.big,
143 | mainAxisExtent = null;
144 |
145 | /// Creates a widget that takes an `extraBig` amount of space in the
146 | /// direction of its parent.
147 | ///
148 | /// The spacing value is defined in the global [Spacing] definition.
149 | ///
150 | /// The [crossAxisExtent] must be either null or positive.
151 | const Space.extraBig({
152 | this.crossAxisExtent,
153 | this.color,
154 | }) : size = SpaceSize.extraBig,
155 | mainAxisExtent = null;
156 |
157 | @override
158 | Widget build(BuildContext context) {
159 | var mainAxisExtent = this.mainAxisExtent;
160 | if (mainAxisExtent == null) {
161 | var size = this.size ?? SpaceSize.normal;
162 | mainAxisExtent = size.toPoints(context);
163 | }
164 | return Gap(
165 | mainAxisExtent,
166 | crossAxisExtent: crossAxisExtent,
167 | color: color,
168 | );
169 | }
170 | }
171 |
172 | /// A sliver that takes a fixed amount of space.
173 | ///
174 | /// See also:
175 | ///
176 | /// * [Space], the render box version of this widget.
177 | class SliverSpace extends StatelessWidget {
178 | /// The amount of space this widget takes in the direction of its parent.
179 | ///
180 | /// For example:
181 | /// - If the parent is a [Column] this is the height of this widget.
182 | /// - If the parent is a [Row] this is the width of this widget.
183 | ///
184 | /// Must not be null and must be positive.
185 | ///
186 | /// If null, then [size] should be defined.
187 | final double? mainAxisExtent;
188 |
189 | /// The amount of space this widget takes in the opposite direction of the
190 | /// parent.
191 | ///
192 | /// Must be positive or null. If it's null (the default) the cross axis extent
193 | /// will be the same as the constraints of the parent in the opposite
194 | /// direction.
195 | final double? crossAxisExtent;
196 |
197 | /// The color used to fill the gap.
198 | final Color? color;
199 |
200 | /// The amount of space from [Spacing] this widget takes in the direction of its parent.
201 | ///
202 | /// Must not be null and must be positive.
203 | ///
204 | /// If null, then [mainAxisExtent] should be defined.
205 | final SpaceSize? size;
206 |
207 | /// Creates a widget that takes a fixed [mainAxisExtent] of space in the
208 | /// direction of its parent.
209 | ///
210 | /// The [mainAxisExtent] must not be null and must be positive.
211 | /// The [crossAxisExtent] must be either null or positive.
212 | const SliverSpace({
213 | Key? key,
214 | required double mainAxisExtent,
215 | this.crossAxisExtent,
216 | this.color,
217 | }) : mainAxisExtent = mainAxisExtent,
218 | size = null,
219 | assert(mainAxisExtent > 0),
220 | super(key: key);
221 |
222 | /// Creates a widget that takes an `extraSmall` amount of space in the
223 | /// direction of its parent.
224 | ///
225 | /// The spacing value is defined in the global [Spacing] definition.
226 | ///
227 | /// The [crossAxisExtent] must be either null or positive.
228 | const SliverSpace.extraSmall({
229 | this.crossAxisExtent,
230 | this.color,
231 | }) : size = SpaceSize.extraSmall,
232 | mainAxisExtent = null;
233 |
234 | /// Creates a widget that takes a `small` amount of space in the
235 | /// direction of its parent.
236 | ///
237 | /// The spacing value is defined in the global [Spacing] definition.
238 | ///
239 | /// The [crossAxisExtent] must be either null or positive.
240 | const SliverSpace.small({
241 | this.crossAxisExtent,
242 | this.color,
243 | }) : size = SpaceSize.small,
244 | mainAxisExtent = null;
245 |
246 | /// Creates a widget that takes a `semiSmall` amount of space in the
247 | /// direction of its parent.
248 | ///
249 | /// The spacing value is defined in the global [Spacing] definition.
250 | ///
251 | /// The [crossAxisExtent] must be either null or positive.
252 | const SliverSpace.semiSmall({
253 | this.crossAxisExtent,
254 | this.color,
255 | }) : size = SpaceSize.semiSmall,
256 | mainAxisExtent = null;
257 |
258 | /// Creates a widget that takes a `normal` amount of space in the
259 | /// direction of its parent.
260 | ///
261 | /// The spacing value is defined in the global [Spacing] definition.
262 | ///
263 | /// The [crossAxisExtent] must be either null or positive.
264 | const SliverSpace.normal({
265 | this.crossAxisExtent,
266 | this.color,
267 | }) : size = SpaceSize.normal,
268 | mainAxisExtent = null;
269 |
270 | /// Creates a widget that takes a `semiBig` amount of space in the
271 | /// direction of its parent.
272 | ///
273 | /// The spacing value is defined in the global [Spacing] definition.
274 | ///
275 | /// The [crossAxisExtent] must be either null or positive.
276 | const SliverSpace.semiBig({
277 | this.crossAxisExtent,
278 | this.color,
279 | }) : size = SpaceSize.semiBig,
280 | mainAxisExtent = null;
281 |
282 | /// Creates a widget that takes a `big` amount of space in the
283 | /// direction of its parent.
284 | ///
285 | /// The spacing value is defined in the global [Spacing] definition.
286 | ///
287 | /// The [crossAxisExtent] must be either null or positive.
288 | const SliverSpace.big({
289 | this.crossAxisExtent,
290 | this.color,
291 | }) : size = SpaceSize.big,
292 | mainAxisExtent = null;
293 |
294 | /// Creates a widget that takes an `extraBig` amount of space in the
295 | /// direction of its parent.
296 | ///
297 | /// The spacing value is defined in the global [Spacing] definition.
298 | ///
299 | /// The [crossAxisExtent] must be either null or positive.
300 | const SliverSpace.extraBig({
301 | this.crossAxisExtent,
302 | this.color,
303 | }) : size = SpaceSize.extraBig,
304 | mainAxisExtent = null;
305 |
306 | @override
307 | Widget build(BuildContext context) {
308 | var mainAxisExtent = this.mainAxisExtent;
309 | if (mainAxisExtent == null) {
310 | var size = this.size ?? SpaceSize.normal;
311 | mainAxisExtent = size.toPoints(context);
312 | }
313 | return SliverGap(mainAxisExtent);
314 | }
315 | }
316 |
--------------------------------------------------------------------------------
/lib/src/spacing_data.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:freezed_annotation/freezed_annotation.dart';
3 |
4 | part 'spacing_data.freezed.dart';
5 |
6 | /// Defines the configuration of the overall visual [Spacing] for a
7 | /// widget subtree within the app.
8 | @freezed
9 | abstract class SpacingData with _$SpacingData {
10 | /// Generates all [spaces] and [insets] from a given
11 | /// [normal] base space value.
12 | ///
13 | /// Several types of spaces are available :
14 | ///
15 | /// * [spaces] : `double` values
16 | /// * [insets] : `EdgeInsets` values
17 | ///
18 | /// The values follows this calculation :
19 | ///
20 | // * extraSmall: `normal * 0.2`
21 | // * small: `normal * 0.4`
22 | // * semiSmall: `normal * 0.8`
23 | // * semiBig: `normal * 1.5`
24 | // * big: `normal * 2.5`
25 | // * extraBig: `normal * 5.0`
26 | factory SpacingData.generate(double normal) {
27 | return SpacingData.fromSpaces(
28 | extraSmall: normal * 0.2,
29 | small: normal * 0.4,
30 | semiSmall: normal * 0.6,
31 | normal: normal,
32 | semiBig: normal * 1.5,
33 | big: normal * 2.5,
34 | extraBig: normal * 5.0,
35 | );
36 | }
37 |
38 | /// Generates all [insets] from the given [spaces].
39 | factory SpacingData.fromSpaces({
40 | required double extraSmall,
41 | required double small,
42 | required double semiSmall,
43 | required double normal,
44 | required double semiBig,
45 | required double big,
46 | required double extraBig,
47 | }) {
48 | final spaces = SizeSet(
49 | extraSmall: extraSmall,
50 | small: small,
51 | semiSmall: semiSmall,
52 | normal: normal,
53 | semiBig: semiBig,
54 | big: big,
55 | extraBig: extraBig,
56 | );
57 | return SpacingData(
58 | spaces: spaces,
59 | insets: SpacingInsetsData.fromSpaces(spaces),
60 | );
61 | }
62 |
63 | /// A spacing configuration from the given [spaces] and [insets].
64 | const factory SpacingData({
65 | required SpacingInsetsData insets,
66 | required SizeSet spaces,
67 | }) = _SpacingData;
68 | }
69 |
70 | /// Defines the edge insets configuration.
71 | ///
72 | /// A set of presets are available :
73 | ///
74 | /// * [all] equivalent of `EdgeInsets.all()`
75 | /// * [vertical] equivalent of `EdgeInsets.symmetric(vertical: )`
76 | /// * [horizontal] equivalent of `EdgeInsets.symmetric(horizontal: )`
77 | /// * [onlyRight] equivalent of `EdgeInsets.only(right: )`
78 | /// * [onlyLeft] equivalent of `EdgeInsets.only(left: )`
79 | /// * [onlyTop] equivalent of `EdgeInsets.only(top: )`
80 | /// * [onlyBottom] equivalent of `EdgeInsets.only(bottom: )`
81 | /// * [exceptRight] equivalent of `EdgeInsets.fromLTRB(,,0,)`
82 | /// * [exceptLeft] equivalent of `EdgeInsets.fromLTRB(0,,,)`
83 | /// * [exceptTop] equivalent of `EdgeInsets.fromLTRB(,0,,)`
84 | /// * [exceptBottom] equivalent of `EdgeInsets.fromLTRB(,,,0)`
85 | @freezed
86 | abstract class SpacingInsetsData with _$SpacingInsetsData {
87 | factory SpacingInsetsData.fromSpaces(SizeSet spaces) {
88 | return SpacingInsetsData(
89 | all: SizeSet(
90 | extraSmall: EdgeInsets.all(spaces.extraSmall),
91 | small: EdgeInsets.all(spaces.small),
92 | semiSmall: EdgeInsets.all(spaces.semiSmall),
93 | normal: EdgeInsets.all(spaces.normal),
94 | semiBig: EdgeInsets.all(spaces.semiBig),
95 | big: EdgeInsets.all(spaces.big),
96 | extraBig: EdgeInsets.all(spaces.big),
97 | ),
98 | vertical: SizeSet(
99 | extraSmall: EdgeInsets.symmetric(vertical: spaces.extraSmall),
100 | small: EdgeInsets.symmetric(vertical: spaces.small),
101 | semiSmall: EdgeInsets.symmetric(vertical: spaces.semiSmall),
102 | normal: EdgeInsets.symmetric(vertical: spaces.normal),
103 | semiBig: EdgeInsets.symmetric(vertical: spaces.semiBig),
104 | big: EdgeInsets.symmetric(vertical: spaces.big),
105 | extraBig: EdgeInsets.symmetric(vertical: spaces.big),
106 | ),
107 | horizontal: SizeSet(
108 | extraSmall: EdgeInsets.symmetric(horizontal: spaces.extraSmall),
109 | small: EdgeInsets.symmetric(horizontal: spaces.small),
110 | semiSmall: EdgeInsets.symmetric(horizontal: spaces.semiSmall),
111 | normal: EdgeInsets.symmetric(horizontal: spaces.normal),
112 | semiBig: EdgeInsets.symmetric(horizontal: spaces.semiBig),
113 | big: EdgeInsets.symmetric(horizontal: spaces.big),
114 | extraBig: EdgeInsets.symmetric(horizontal: spaces.big),
115 | ),
116 | onlyRight: SizeSet(
117 | extraSmall: EdgeInsets.only(right: spaces.extraSmall),
118 | small: EdgeInsets.only(right: spaces.small),
119 | semiSmall: EdgeInsets.only(right: spaces.semiSmall),
120 | normal: EdgeInsets.only(right: spaces.normal),
121 | semiBig: EdgeInsets.only(right: spaces.semiBig),
122 | big: EdgeInsets.only(right: spaces.big),
123 | extraBig: EdgeInsets.only(right: spaces.big),
124 | ),
125 | onlyLeft: SizeSet(
126 | extraSmall: EdgeInsets.only(left: spaces.extraSmall),
127 | small: EdgeInsets.only(left: spaces.small),
128 | semiSmall: EdgeInsets.only(left: spaces.semiSmall),
129 | normal: EdgeInsets.only(left: spaces.normal),
130 | semiBig: EdgeInsets.only(left: spaces.semiBig),
131 | big: EdgeInsets.only(left: spaces.big),
132 | extraBig: EdgeInsets.only(left: spaces.big),
133 | ),
134 | onlyBottom: SizeSet(
135 | extraSmall: EdgeInsets.only(bottom: spaces.extraSmall),
136 | small: EdgeInsets.only(bottom: spaces.small),
137 | semiSmall: EdgeInsets.only(bottom: spaces.semiSmall),
138 | normal: EdgeInsets.only(bottom: spaces.normal),
139 | semiBig: EdgeInsets.only(bottom: spaces.semiBig),
140 | big: EdgeInsets.only(bottom: spaces.big),
141 | extraBig: EdgeInsets.only(bottom: spaces.big),
142 | ),
143 | onlyTop: SizeSet(
144 | extraSmall: EdgeInsets.only(top: spaces.extraSmall),
145 | small: EdgeInsets.only(top: spaces.small),
146 | semiSmall: EdgeInsets.only(top: spaces.semiSmall),
147 | normal: EdgeInsets.only(top: spaces.normal),
148 | semiBig: EdgeInsets.only(top: spaces.semiBig),
149 | big: EdgeInsets.only(top: spaces.big),
150 | extraBig: EdgeInsets.only(top: spaces.big),
151 | ),
152 | exceptBottom: SizeSet(
153 | extraSmall: EdgeInsets.fromLTRB(
154 | spaces.extraSmall,
155 | spaces.extraSmall,
156 | spaces.extraSmall,
157 | 0,
158 | ),
159 | small: EdgeInsets.fromLTRB(
160 | spaces.small,
161 | spaces.small,
162 | spaces.small,
163 | 0,
164 | ),
165 | semiSmall: EdgeInsets.fromLTRB(
166 | spaces.semiSmall,
167 | spaces.semiSmall,
168 | spaces.semiSmall,
169 | 0,
170 | ),
171 | normal: EdgeInsets.fromLTRB(
172 | spaces.normal,
173 | spaces.normal,
174 | spaces.normal,
175 | 0,
176 | ),
177 | semiBig: EdgeInsets.fromLTRB(
178 | spaces.semiBig,
179 | spaces.semiBig,
180 | spaces.semiBig,
181 | 0,
182 | ),
183 | big: EdgeInsets.fromLTRB(
184 | spaces.big,
185 | spaces.big,
186 | spaces.big,
187 | 0,
188 | ),
189 | extraBig: EdgeInsets.fromLTRB(
190 | spaces.extraBig,
191 | spaces.extraBig,
192 | spaces.extraBig,
193 | 0,
194 | ),
195 | ),
196 | exceptLeft: SizeSet(
197 | extraSmall: EdgeInsets.fromLTRB(
198 | 0,
199 | spaces.extraSmall,
200 | spaces.extraSmall,
201 | spaces.extraSmall,
202 | ),
203 | small: EdgeInsets.fromLTRB(
204 | 0,
205 | spaces.small,
206 | spaces.small,
207 | spaces.small,
208 | ),
209 | semiSmall: EdgeInsets.fromLTRB(
210 | 0,
211 | spaces.semiSmall,
212 | spaces.semiSmall,
213 | spaces.semiSmall,
214 | ),
215 | normal: EdgeInsets.fromLTRB(
216 | 0,
217 | spaces.normal,
218 | spaces.normal,
219 | spaces.normal,
220 | ),
221 | semiBig: EdgeInsets.fromLTRB(
222 | 0,
223 | spaces.semiBig,
224 | spaces.semiBig,
225 | spaces.semiBig,
226 | ),
227 | big: EdgeInsets.fromLTRB(
228 | 0,
229 | spaces.big,
230 | spaces.big,
231 | spaces.big,
232 | ),
233 | extraBig: EdgeInsets.fromLTRB(
234 | 0,
235 | spaces.extraBig,
236 | spaces.extraBig,
237 | spaces.extraBig,
238 | ),
239 | ),
240 | exceptRight: SizeSet(
241 | extraSmall: EdgeInsets.fromLTRB(
242 | spaces.extraSmall,
243 | spaces.extraSmall,
244 | 0,
245 | spaces.extraSmall,
246 | ),
247 | small: EdgeInsets.fromLTRB(
248 | spaces.small,
249 | spaces.small,
250 | 0,
251 | spaces.small,
252 | ),
253 | semiSmall: EdgeInsets.fromLTRB(
254 | spaces.semiSmall,
255 | spaces.semiSmall,
256 | 0,
257 | spaces.semiSmall,
258 | ),
259 | normal: EdgeInsets.fromLTRB(
260 | spaces.normal,
261 | spaces.normal,
262 | 0,
263 | spaces.normal,
264 | ),
265 | semiBig: EdgeInsets.fromLTRB(
266 | spaces.semiBig,
267 | spaces.semiBig,
268 | 0,
269 | spaces.semiBig,
270 | ),
271 | big: EdgeInsets.fromLTRB(
272 | spaces.big,
273 | spaces.big,
274 | 0,
275 | spaces.big,
276 | ),
277 | extraBig: EdgeInsets.fromLTRB(
278 | spaces.extraBig,
279 | spaces.extraBig,
280 | 0,
281 | spaces.extraBig,
282 | ),
283 | ),
284 | exceptTop: SizeSet(
285 | extraSmall: EdgeInsets.fromLTRB(
286 | spaces.extraSmall,
287 | 0,
288 | spaces.extraSmall,
289 | spaces.extraSmall,
290 | ),
291 | small: EdgeInsets.fromLTRB(
292 | spaces.small,
293 | 0,
294 | spaces.small,
295 | spaces.small,
296 | ),
297 | semiSmall: EdgeInsets.fromLTRB(
298 | spaces.semiSmall,
299 | 0,
300 | spaces.semiSmall,
301 | spaces.semiSmall,
302 | ),
303 | normal: EdgeInsets.fromLTRB(
304 | spaces.normal,
305 | 0,
306 | spaces.normal,
307 | spaces.normal,
308 | ),
309 | semiBig: EdgeInsets.fromLTRB(
310 | spaces.semiBig,
311 | 0,
312 | spaces.semiBig,
313 | spaces.semiBig,
314 | ),
315 | big: EdgeInsets.fromLTRB(
316 | spaces.big,
317 | 0,
318 | spaces.big,
319 | spaces.big,
320 | ),
321 | extraBig: EdgeInsets.fromLTRB(
322 | spaces.extraBig,
323 | 0,
324 | spaces.extraBig,
325 | spaces.extraBig,
326 | ),
327 | ),
328 | );
329 | }
330 |
331 | const factory SpacingInsetsData({
332 | required SizeSet all,
333 | required SizeSet horizontal,
334 | required SizeSet vertical,
335 | required SizeSet onlyRight,
336 | required SizeSet onlyTop,
337 | required SizeSet onlyBottom,
338 | required SizeSet onlyLeft,
339 | required SizeSet exceptLeft,
340 | required SizeSet exceptRight,
341 | required SizeSet exceptTop,
342 | required SizeSet exceptBottom,
343 | }) = _SpacingInsetsData;
344 | }
345 |
346 | /// A set of size variants, from [extraSmall] to [extraBig]
347 | @freezed
348 | abstract class SizeSet with _$SizeSet {
349 | /// The user is currently updating the login form.
350 | const factory SizeSet({
351 | required T extraSmall,
352 | required T small,
353 | required T semiSmall,
354 | required T normal,
355 | required T semiBig,
356 | required T big,
357 | required T extraBig,
358 | }) = _SizeSet;
359 | }
360 |
361 | enum SpaceSize {
362 | extraSmall,
363 | small,
364 | semiSmall,
365 | normal,
366 | semiBig,
367 | big,
368 | extraBig,
369 | }
370 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | _fe_analyzer_shared:
5 | dependency: transitive
6 | description:
7 | name: _fe_analyzer_shared
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "14.0.0"
11 | analyzer:
12 | dependency: transitive
13 | description:
14 | name: analyzer
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "0.41.2"
18 | args:
19 | dependency: transitive
20 | description:
21 | name: args
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.6.0"
25 | async:
26 | dependency: transitive
27 | description:
28 | name: async
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "2.5.0"
32 | boolean_selector:
33 | dependency: transitive
34 | description:
35 | name: boolean_selector
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "2.1.0"
39 | build:
40 | dependency: transitive
41 | description:
42 | name: build
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.6.2"
46 | build_config:
47 | dependency: transitive
48 | description:
49 | name: build_config
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "0.4.5"
53 | build_daemon:
54 | dependency: transitive
55 | description:
56 | name: build_daemon
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "2.1.4"
60 | build_resolvers:
61 | dependency: transitive
62 | description:
63 | name: build_resolvers
64 | url: "https://pub.dartlang.org"
65 | source: hosted
66 | version: "1.5.3"
67 | build_runner:
68 | dependency: "direct dev"
69 | description:
70 | name: build_runner
71 | url: "https://pub.dartlang.org"
72 | source: hosted
73 | version: "1.11.5"
74 | build_runner_core:
75 | dependency: transitive
76 | description:
77 | name: build_runner_core
78 | url: "https://pub.dartlang.org"
79 | source: hosted
80 | version: "6.1.10"
81 | built_collection:
82 | dependency: transitive
83 | description:
84 | name: built_collection
85 | url: "https://pub.dartlang.org"
86 | source: hosted
87 | version: "4.3.2"
88 | built_value:
89 | dependency: transitive
90 | description:
91 | name: built_value
92 | url: "https://pub.dartlang.org"
93 | source: hosted
94 | version: "7.1.0"
95 | characters:
96 | dependency: transitive
97 | description:
98 | name: characters
99 | url: "https://pub.dartlang.org"
100 | source: hosted
101 | version: "1.1.0"
102 | charcode:
103 | dependency: transitive
104 | description:
105 | name: charcode
106 | url: "https://pub.dartlang.org"
107 | source: hosted
108 | version: "1.2.0"
109 | checked_yaml:
110 | dependency: transitive
111 | description:
112 | name: checked_yaml
113 | url: "https://pub.dartlang.org"
114 | source: hosted
115 | version: "1.0.4"
116 | cli_util:
117 | dependency: transitive
118 | description:
119 | name: cli_util
120 | url: "https://pub.dartlang.org"
121 | source: hosted
122 | version: "0.1.4"
123 | clock:
124 | dependency: transitive
125 | description:
126 | name: clock
127 | url: "https://pub.dartlang.org"
128 | source: hosted
129 | version: "1.1.0"
130 | code_builder:
131 | dependency: transitive
132 | description:
133 | name: code_builder
134 | url: "https://pub.dartlang.org"
135 | source: hosted
136 | version: "3.4.1"
137 | collection:
138 | dependency: transitive
139 | description:
140 | name: collection
141 | url: "https://pub.dartlang.org"
142 | source: hosted
143 | version: "1.15.0"
144 | convert:
145 | dependency: transitive
146 | description:
147 | name: convert
148 | url: "https://pub.dartlang.org"
149 | source: hosted
150 | version: "2.1.1"
151 | crypto:
152 | dependency: transitive
153 | description:
154 | name: crypto
155 | url: "https://pub.dartlang.org"
156 | source: hosted
157 | version: "2.1.5"
158 | dart_style:
159 | dependency: transitive
160 | description:
161 | name: dart_style
162 | url: "https://pub.dartlang.org"
163 | source: hosted
164 | version: "1.3.12"
165 | fake_async:
166 | dependency: transitive
167 | description:
168 | name: fake_async
169 | url: "https://pub.dartlang.org"
170 | source: hosted
171 | version: "1.2.0"
172 | file:
173 | dependency: transitive
174 | description:
175 | name: file
176 | url: "https://pub.dartlang.org"
177 | source: hosted
178 | version: "6.1.0"
179 | fixnum:
180 | dependency: transitive
181 | description:
182 | name: fixnum
183 | url: "https://pub.dartlang.org"
184 | source: hosted
185 | version: "0.10.11"
186 | flutter:
187 | dependency: "direct main"
188 | description: flutter
189 | source: sdk
190 | version: "0.0.0"
191 | flutter_test:
192 | dependency: "direct dev"
193 | description: flutter
194 | source: sdk
195 | version: "0.0.0"
196 | freezed:
197 | dependency: "direct dev"
198 | description:
199 | name: freezed
200 | url: "https://pub.dartlang.org"
201 | source: hosted
202 | version: "0.14.0-nullsafety.0"
203 | freezed_annotation:
204 | dependency: "direct main"
205 | description:
206 | name: freezed_annotation
207 | url: "https://pub.dartlang.org"
208 | source: hosted
209 | version: "0.13.0-nullsafety.0"
210 | gap:
211 | dependency: "direct main"
212 | description:
213 | name: gap
214 | url: "https://pub.dartlang.org"
215 | source: hosted
216 | version: "2.0.0-nullsafety.1"
217 | glob:
218 | dependency: transitive
219 | description:
220 | name: glob
221 | url: "https://pub.dartlang.org"
222 | source: hosted
223 | version: "2.0.0"
224 | graphs:
225 | dependency: transitive
226 | description:
227 | name: graphs
228 | url: "https://pub.dartlang.org"
229 | source: hosted
230 | version: "0.2.0"
231 | http_multi_server:
232 | dependency: transitive
233 | description:
234 | name: http_multi_server
235 | url: "https://pub.dartlang.org"
236 | source: hosted
237 | version: "2.2.0"
238 | http_parser:
239 | dependency: transitive
240 | description:
241 | name: http_parser
242 | url: "https://pub.dartlang.org"
243 | source: hosted
244 | version: "3.1.4"
245 | io:
246 | dependency: transitive
247 | description:
248 | name: io
249 | url: "https://pub.dartlang.org"
250 | source: hosted
251 | version: "0.3.4"
252 | js:
253 | dependency: transitive
254 | description:
255 | name: js
256 | url: "https://pub.dartlang.org"
257 | source: hosted
258 | version: "0.6.2"
259 | json_annotation:
260 | dependency: transitive
261 | description:
262 | name: json_annotation
263 | url: "https://pub.dartlang.org"
264 | source: hosted
265 | version: "4.0.0"
266 | logging:
267 | dependency: transitive
268 | description:
269 | name: logging
270 | url: "https://pub.dartlang.org"
271 | source: hosted
272 | version: "0.11.4"
273 | matcher:
274 | dependency: transitive
275 | description:
276 | name: matcher
277 | url: "https://pub.dartlang.org"
278 | source: hosted
279 | version: "0.12.10"
280 | meta:
281 | dependency: transitive
282 | description:
283 | name: meta
284 | url: "https://pub.dartlang.org"
285 | source: hosted
286 | version: "1.3.0"
287 | mime:
288 | dependency: transitive
289 | description:
290 | name: mime
291 | url: "https://pub.dartlang.org"
292 | source: hosted
293 | version: "0.9.7"
294 | package_config:
295 | dependency: transitive
296 | description:
297 | name: package_config
298 | url: "https://pub.dartlang.org"
299 | source: hosted
300 | version: "1.9.3"
301 | path:
302 | dependency: transitive
303 | description:
304 | name: path
305 | url: "https://pub.dartlang.org"
306 | source: hosted
307 | version: "1.8.0"
308 | pedantic:
309 | dependency: transitive
310 | description:
311 | name: pedantic
312 | url: "https://pub.dartlang.org"
313 | source: hosted
314 | version: "1.11.0"
315 | pool:
316 | dependency: transitive
317 | description:
318 | name: pool
319 | url: "https://pub.dartlang.org"
320 | source: hosted
321 | version: "1.4.0"
322 | pub_semver:
323 | dependency: transitive
324 | description:
325 | name: pub_semver
326 | url: "https://pub.dartlang.org"
327 | source: hosted
328 | version: "1.4.4"
329 | pubspec_parse:
330 | dependency: transitive
331 | description:
332 | name: pubspec_parse
333 | url: "https://pub.dartlang.org"
334 | source: hosted
335 | version: "0.1.8"
336 | quiver:
337 | dependency: transitive
338 | description:
339 | name: quiver
340 | url: "https://pub.dartlang.org"
341 | source: hosted
342 | version: "2.1.3"
343 | shelf:
344 | dependency: transitive
345 | description:
346 | name: shelf
347 | url: "https://pub.dartlang.org"
348 | source: hosted
349 | version: "0.7.9"
350 | shelf_web_socket:
351 | dependency: transitive
352 | description:
353 | name: shelf_web_socket
354 | url: "https://pub.dartlang.org"
355 | source: hosted
356 | version: "0.2.3"
357 | sky_engine:
358 | dependency: transitive
359 | description: flutter
360 | source: sdk
361 | version: "0.0.99"
362 | source_gen:
363 | dependency: transitive
364 | description:
365 | name: source_gen
366 | url: "https://pub.dartlang.org"
367 | source: hosted
368 | version: "0.9.10+3"
369 | source_span:
370 | dependency: transitive
371 | description:
372 | name: source_span
373 | url: "https://pub.dartlang.org"
374 | source: hosted
375 | version: "1.8.0"
376 | stack_trace:
377 | dependency: transitive
378 | description:
379 | name: stack_trace
380 | url: "https://pub.dartlang.org"
381 | source: hosted
382 | version: "1.10.0"
383 | stream_channel:
384 | dependency: transitive
385 | description:
386 | name: stream_channel
387 | url: "https://pub.dartlang.org"
388 | source: hosted
389 | version: "2.1.0"
390 | stream_transform:
391 | dependency: transitive
392 | description:
393 | name: stream_transform
394 | url: "https://pub.dartlang.org"
395 | source: hosted
396 | version: "1.2.0"
397 | string_scanner:
398 | dependency: transitive
399 | description:
400 | name: string_scanner
401 | url: "https://pub.dartlang.org"
402 | source: hosted
403 | version: "1.1.0"
404 | term_glyph:
405 | dependency: transitive
406 | description:
407 | name: term_glyph
408 | url: "https://pub.dartlang.org"
409 | source: hosted
410 | version: "1.2.0"
411 | test_api:
412 | dependency: transitive
413 | description:
414 | name: test_api
415 | url: "https://pub.dartlang.org"
416 | source: hosted
417 | version: "0.2.19"
418 | timing:
419 | dependency: transitive
420 | description:
421 | name: timing
422 | url: "https://pub.dartlang.org"
423 | source: hosted
424 | version: "0.1.1+3"
425 | typed_data:
426 | dependency: transitive
427 | description:
428 | name: typed_data
429 | url: "https://pub.dartlang.org"
430 | source: hosted
431 | version: "1.3.0"
432 | vector_math:
433 | dependency: transitive
434 | description:
435 | name: vector_math
436 | url: "https://pub.dartlang.org"
437 | source: hosted
438 | version: "2.1.0"
439 | watcher:
440 | dependency: transitive
441 | description:
442 | name: watcher
443 | url: "https://pub.dartlang.org"
444 | source: hosted
445 | version: "0.9.7+15"
446 | web_socket_channel:
447 | dependency: transitive
448 | description:
449 | name: web_socket_channel
450 | url: "https://pub.dartlang.org"
451 | source: hosted
452 | version: "1.1.0"
453 | yaml:
454 | dependency: transitive
455 | description:
456 | name: yaml
457 | url: "https://pub.dartlang.org"
458 | source: hosted
459 | version: "2.2.1"
460 | sdks:
461 | dart: ">=2.12.0 <3.0.0"
462 | flutter: ">=2.0.0"
463 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
94 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
95 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
96 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
97 | );
98 | path = Runner;
99 | sourceTree = "";
100 | };
101 | /* End PBXGroup section */
102 |
103 | /* Begin PBXNativeTarget section */
104 | 97C146ED1CF9000F007C117D /* Runner */ = {
105 | isa = PBXNativeTarget;
106 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
107 | buildPhases = (
108 | 9740EEB61CF901F6004384FC /* Run Script */,
109 | 97C146EA1CF9000F007C117D /* Sources */,
110 | 97C146EB1CF9000F007C117D /* Frameworks */,
111 | 97C146EC1CF9000F007C117D /* Resources */,
112 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
113 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
114 | );
115 | buildRules = (
116 | );
117 | dependencies = (
118 | );
119 | name = Runner;
120 | productName = Runner;
121 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
122 | productType = "com.apple.product-type.application";
123 | };
124 | /* End PBXNativeTarget section */
125 |
126 | /* Begin PBXProject section */
127 | 97C146E61CF9000F007C117D /* Project object */ = {
128 | isa = PBXProject;
129 | attributes = {
130 | LastUpgradeCheck = 1020;
131 | ORGANIZATIONNAME = "";
132 | TargetAttributes = {
133 | 97C146ED1CF9000F007C117D = {
134 | CreatedOnToolsVersion = 7.3.1;
135 | LastSwiftMigration = 1100;
136 | };
137 | };
138 | };
139 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
140 | compatibilityVersion = "Xcode 9.3";
141 | developmentRegion = en;
142 | hasScannedForEncodings = 0;
143 | knownRegions = (
144 | en,
145 | Base,
146 | );
147 | mainGroup = 97C146E51CF9000F007C117D;
148 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
149 | projectDirPath = "";
150 | projectRoot = "";
151 | targets = (
152 | 97C146ED1CF9000F007C117D /* Runner */,
153 | );
154 | };
155 | /* End PBXProject section */
156 |
157 | /* Begin PBXResourcesBuildPhase section */
158 | 97C146EC1CF9000F007C117D /* Resources */ = {
159 | isa = PBXResourcesBuildPhase;
160 | buildActionMask = 2147483647;
161 | files = (
162 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
163 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
164 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
165 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
166 | );
167 | runOnlyForDeploymentPostprocessing = 0;
168 | };
169 | /* End PBXResourcesBuildPhase section */
170 |
171 | /* Begin PBXShellScriptBuildPhase section */
172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173 | isa = PBXShellScriptBuildPhase;
174 | buildActionMask = 2147483647;
175 | files = (
176 | );
177 | inputPaths = (
178 | );
179 | name = "Thin Binary";
180 | outputPaths = (
181 | );
182 | runOnlyForDeploymentPostprocessing = 0;
183 | shellPath = /bin/sh;
184 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
185 | };
186 | 9740EEB61CF901F6004384FC /* Run Script */ = {
187 | isa = PBXShellScriptBuildPhase;
188 | buildActionMask = 2147483647;
189 | files = (
190 | );
191 | inputPaths = (
192 | );
193 | name = "Run Script";
194 | outputPaths = (
195 | );
196 | runOnlyForDeploymentPostprocessing = 0;
197 | shellPath = /bin/sh;
198 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
199 | };
200 | /* End PBXShellScriptBuildPhase section */
201 |
202 | /* Begin PBXSourcesBuildPhase section */
203 | 97C146EA1CF9000F007C117D /* Sources */ = {
204 | isa = PBXSourcesBuildPhase;
205 | buildActionMask = 2147483647;
206 | files = (
207 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
208 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
209 | );
210 | runOnlyForDeploymentPostprocessing = 0;
211 | };
212 | /* End PBXSourcesBuildPhase section */
213 |
214 | /* Begin PBXVariantGroup section */
215 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
216 | isa = PBXVariantGroup;
217 | children = (
218 | 97C146FB1CF9000F007C117D /* Base */,
219 | );
220 | name = Main.storyboard;
221 | sourceTree = "";
222 | };
223 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C147001CF9000F007C117D /* Base */,
227 | );
228 | name = LaunchScreen.storyboard;
229 | sourceTree = "";
230 | };
231 | /* End PBXVariantGroup section */
232 |
233 | /* Begin XCBuildConfiguration section */
234 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
235 | isa = XCBuildConfiguration;
236 | buildSettings = {
237 | ALWAYS_SEARCH_USER_PATHS = NO;
238 | CLANG_ANALYZER_NONNULL = YES;
239 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
240 | CLANG_CXX_LIBRARY = "libc++";
241 | CLANG_ENABLE_MODULES = YES;
242 | CLANG_ENABLE_OBJC_ARC = YES;
243 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
244 | CLANG_WARN_BOOL_CONVERSION = YES;
245 | CLANG_WARN_COMMA = YES;
246 | CLANG_WARN_CONSTANT_CONVERSION = YES;
247 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
248 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
249 | CLANG_WARN_EMPTY_BODY = YES;
250 | CLANG_WARN_ENUM_CONVERSION = YES;
251 | CLANG_WARN_INFINITE_RECURSION = YES;
252 | CLANG_WARN_INT_CONVERSION = YES;
253 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
254 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
255 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
257 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
258 | CLANG_WARN_STRICT_PROTOTYPES = YES;
259 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
260 | CLANG_WARN_UNREACHABLE_CODE = YES;
261 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
262 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
263 | COPY_PHASE_STRIP = NO;
264 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
265 | ENABLE_NS_ASSERTIONS = NO;
266 | ENABLE_STRICT_OBJC_MSGSEND = YES;
267 | GCC_C_LANGUAGE_STANDARD = gnu99;
268 | GCC_NO_COMMON_BLOCKS = YES;
269 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
270 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
271 | GCC_WARN_UNDECLARED_SELECTOR = YES;
272 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273 | GCC_WARN_UNUSED_FUNCTION = YES;
274 | GCC_WARN_UNUSED_VARIABLE = YES;
275 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
276 | MTL_ENABLE_DEBUG_INFO = NO;
277 | SDKROOT = iphoneos;
278 | SUPPORTED_PLATFORMS = iphoneos;
279 | TARGETED_DEVICE_FAMILY = "1,2";
280 | VALIDATE_PRODUCT = YES;
281 | };
282 | name = Profile;
283 | };
284 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
285 | isa = XCBuildConfiguration;
286 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
287 | buildSettings = {
288 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289 | CLANG_ENABLE_MODULES = YES;
290 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
291 | ENABLE_BITCODE = NO;
292 | FRAMEWORK_SEARCH_PATHS = (
293 | "$(inherited)",
294 | "$(PROJECT_DIR)/Flutter",
295 | );
296 | INFOPLIST_FILE = Runner/Info.plist;
297 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
298 | LIBRARY_SEARCH_PATHS = (
299 | "$(inherited)",
300 | "$(PROJECT_DIR)/Flutter",
301 | );
302 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
303 | PRODUCT_NAME = "$(TARGET_NAME)";
304 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
305 | SWIFT_VERSION = 5.0;
306 | VERSIONING_SYSTEM = "apple-generic";
307 | };
308 | name = Profile;
309 | };
310 | 97C147031CF9000F007C117D /* Debug */ = {
311 | isa = XCBuildConfiguration;
312 | buildSettings = {
313 | ALWAYS_SEARCH_USER_PATHS = NO;
314 | CLANG_ANALYZER_NONNULL = YES;
315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
316 | CLANG_CXX_LIBRARY = "libc++";
317 | CLANG_ENABLE_MODULES = YES;
318 | CLANG_ENABLE_OBJC_ARC = YES;
319 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
320 | CLANG_WARN_BOOL_CONVERSION = YES;
321 | CLANG_WARN_COMMA = YES;
322 | CLANG_WARN_CONSTANT_CONVERSION = YES;
323 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
324 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
325 | CLANG_WARN_EMPTY_BODY = YES;
326 | CLANG_WARN_ENUM_CONVERSION = YES;
327 | CLANG_WARN_INFINITE_RECURSION = YES;
328 | CLANG_WARN_INT_CONVERSION = YES;
329 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
330 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
331 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
332 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
333 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
334 | CLANG_WARN_STRICT_PROTOTYPES = YES;
335 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
336 | CLANG_WARN_UNREACHABLE_CODE = YES;
337 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
339 | COPY_PHASE_STRIP = NO;
340 | DEBUG_INFORMATION_FORMAT = dwarf;
341 | ENABLE_STRICT_OBJC_MSGSEND = YES;
342 | ENABLE_TESTABILITY = YES;
343 | GCC_C_LANGUAGE_STANDARD = gnu99;
344 | GCC_DYNAMIC_NO_PIC = NO;
345 | GCC_NO_COMMON_BLOCKS = YES;
346 | GCC_OPTIMIZATION_LEVEL = 0;
347 | GCC_PREPROCESSOR_DEFINITIONS = (
348 | "DEBUG=1",
349 | "$(inherited)",
350 | );
351 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
352 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
353 | GCC_WARN_UNDECLARED_SELECTOR = YES;
354 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
355 | GCC_WARN_UNUSED_FUNCTION = YES;
356 | GCC_WARN_UNUSED_VARIABLE = YES;
357 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
358 | MTL_ENABLE_DEBUG_INFO = YES;
359 | ONLY_ACTIVE_ARCH = YES;
360 | SDKROOT = iphoneos;
361 | TARGETED_DEVICE_FAMILY = "1,2";
362 | };
363 | name = Debug;
364 | };
365 | 97C147041CF9000F007C117D /* Release */ = {
366 | isa = XCBuildConfiguration;
367 | buildSettings = {
368 | ALWAYS_SEARCH_USER_PATHS = NO;
369 | CLANG_ANALYZER_NONNULL = YES;
370 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
371 | CLANG_CXX_LIBRARY = "libc++";
372 | CLANG_ENABLE_MODULES = YES;
373 | CLANG_ENABLE_OBJC_ARC = YES;
374 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
375 | CLANG_WARN_BOOL_CONVERSION = YES;
376 | CLANG_WARN_COMMA = YES;
377 | CLANG_WARN_CONSTANT_CONVERSION = YES;
378 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
379 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
380 | CLANG_WARN_EMPTY_BODY = YES;
381 | CLANG_WARN_ENUM_CONVERSION = YES;
382 | CLANG_WARN_INFINITE_RECURSION = YES;
383 | CLANG_WARN_INT_CONVERSION = YES;
384 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
385 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
386 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
387 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
388 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
389 | CLANG_WARN_STRICT_PROTOTYPES = YES;
390 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
391 | CLANG_WARN_UNREACHABLE_CODE = YES;
392 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
393 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
394 | COPY_PHASE_STRIP = NO;
395 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
396 | ENABLE_NS_ASSERTIONS = NO;
397 | ENABLE_STRICT_OBJC_MSGSEND = YES;
398 | GCC_C_LANGUAGE_STANDARD = gnu99;
399 | GCC_NO_COMMON_BLOCKS = YES;
400 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
401 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
402 | GCC_WARN_UNDECLARED_SELECTOR = YES;
403 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
404 | GCC_WARN_UNUSED_FUNCTION = YES;
405 | GCC_WARN_UNUSED_VARIABLE = YES;
406 | IPHONEOS_DEPLOYMENT_TARGET = 8.0;
407 | MTL_ENABLE_DEBUG_INFO = NO;
408 | SDKROOT = iphoneos;
409 | SUPPORTED_PLATFORMS = iphoneos;
410 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
411 | TARGETED_DEVICE_FAMILY = "1,2";
412 | VALIDATE_PRODUCT = YES;
413 | };
414 | name = Release;
415 | };
416 | 97C147061CF9000F007C117D /* Debug */ = {
417 | isa = XCBuildConfiguration;
418 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
419 | buildSettings = {
420 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
421 | CLANG_ENABLE_MODULES = YES;
422 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
423 | ENABLE_BITCODE = NO;
424 | FRAMEWORK_SEARCH_PATHS = (
425 | "$(inherited)",
426 | "$(PROJECT_DIR)/Flutter",
427 | );
428 | INFOPLIST_FILE = Runner/Info.plist;
429 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
430 | LIBRARY_SEARCH_PATHS = (
431 | "$(inherited)",
432 | "$(PROJECT_DIR)/Flutter",
433 | );
434 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
435 | PRODUCT_NAME = "$(TARGET_NAME)";
436 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
437 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
438 | SWIFT_VERSION = 5.0;
439 | VERSIONING_SYSTEM = "apple-generic";
440 | };
441 | name = Debug;
442 | };
443 | 97C147071CF9000F007C117D /* Release */ = {
444 | isa = XCBuildConfiguration;
445 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
446 | buildSettings = {
447 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
448 | CLANG_ENABLE_MODULES = YES;
449 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
450 | ENABLE_BITCODE = NO;
451 | FRAMEWORK_SEARCH_PATHS = (
452 | "$(inherited)",
453 | "$(PROJECT_DIR)/Flutter",
454 | );
455 | INFOPLIST_FILE = Runner/Info.plist;
456 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
457 | LIBRARY_SEARCH_PATHS = (
458 | "$(inherited)",
459 | "$(PROJECT_DIR)/Flutter",
460 | );
461 | PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
462 | PRODUCT_NAME = "$(TARGET_NAME)";
463 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
464 | SWIFT_VERSION = 5.0;
465 | VERSIONING_SYSTEM = "apple-generic";
466 | };
467 | name = Release;
468 | };
469 | /* End XCBuildConfiguration section */
470 |
471 | /* Begin XCConfigurationList section */
472 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
473 | isa = XCConfigurationList;
474 | buildConfigurations = (
475 | 97C147031CF9000F007C117D /* Debug */,
476 | 97C147041CF9000F007C117D /* Release */,
477 | 249021D3217E4FDB00AE95B9 /* Profile */,
478 | );
479 | defaultConfigurationIsVisible = 0;
480 | defaultConfigurationName = Release;
481 | };
482 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
483 | isa = XCConfigurationList;
484 | buildConfigurations = (
485 | 97C147061CF9000F007C117D /* Debug */,
486 | 97C147071CF9000F007C117D /* Release */,
487 | 249021D4217E4FDB00AE95B9 /* Profile */,
488 | );
489 | defaultConfigurationIsVisible = 0;
490 | defaultConfigurationName = Release;
491 | };
492 | /* End XCConfigurationList section */
493 | };
494 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
495 | }
496 |
--------------------------------------------------------------------------------
/lib/src/spaced_flex.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/widgets.dart';
2 | import 'package:gap/gap.dart';
3 |
4 | import 'spacing.dart';
5 | import 'spacing_data.dart';
6 |
7 | /// Create a new list of [widget]s but inserting a [Gap] width the given
8 | /// [spaceBetween] space widget between each child of the [children] list.
9 | List spacedWidgets({
10 | required List children,
11 | required double spaceBetween,
12 | }) {
13 | if (children.isEmpty) return const [];
14 | return Iterable.generate(children.length * 2 - 1, (i) {
15 | if ((i % 2) == 1) {
16 | return Gap(spaceBetween);
17 | }
18 | return children[i ~/ 2];
19 | }).toList();
20 | }
21 |
22 | /// A widget that behaves like a [Flex], but with the possibility to
23 | /// add a [spaceBetween] children, and a [padding] around them.
24 | ///
25 | /// See also:
26 | ///
27 | /// * [SpacedColumn], the space version of the [Column] equivalent.
28 | /// * [SpacedRow], the space version of the [Row] equivalent.
29 | /// * [Flex], the base widget this one is based on.
30 | class SpacedFlex extends StatelessWidget {
31 | /// The amount of space between children.
32 | ///
33 | /// If null, then [spaceBetween] should be defined.
34 | final SpaceSize? sizeBetween;
35 |
36 | /// The amount of space between children.
37 | ///
38 | /// If null, then [sizeBetween] should be defined.
39 | final double? spaceBetween;
40 |
41 | /// The amount of space around children.
42 | final EdgeInsets? padding;
43 |
44 | /// {@macro flutter.widgets.Flex.children}
45 | final List? children;
46 |
47 | /// {@macro flutter.widgets.Flex.direction}
48 | final Axis direction;
49 |
50 | /// {@macro flutter.widgets.Flex.mainAxisAlignment}
51 | final MainAxisAlignment mainAxisAlignment;
52 |
53 | /// {@macro flutter.widgets.Flex.mainAxisSize}
54 | final MainAxisSize mainAxisSize;
55 |
56 | /// {@macro flutter.widgets.Flex.crossAxisAlignment}
57 | final CrossAxisAlignment crossAxisAlignment;
58 |
59 | /// {@macro flutter.widgets.Flex.textDirection}
60 | final TextDirection? textDirection;
61 |
62 | /// {@macro flutter.widgets.Flex.verticalDirection}
63 | final VerticalDirection verticalDirection;
64 |
65 | /// {@macro flutter.widgets.Flex.textBaseline}
66 | final TextBaseline? textBaseline;
67 |
68 | /// {@macro flutter.widgets.Flex.clipBehavior}
69 | final Clip clipBehavior;
70 |
71 | /// Creates a flex layout with spaces.
72 | ///
73 | /// The [direction] is required.
74 | ///
75 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
76 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
77 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
78 | ///
79 | /// The [textDirection] argument defaults to the ambient [Directionality], if
80 | /// any. If there is no ambient directionality, and a text direction is going
81 | /// to be necessary to decide which direction to lay the children in or to
82 | /// disambiguate `start` or `end` values for the main or cross axis
83 | /// directions, the [textDirection] must not be null.
84 | ///
85 | /// A [padding] can be defined to add space around children.
86 | ///
87 | /// The [spaceBetween] will add this amount of space between all children.
88 | const SpacedFlex({
89 | Key? key,
90 | required this.direction,
91 | this.clipBehavior = Clip.hardEdge,
92 | this.mainAxisAlignment = MainAxisAlignment.start,
93 | this.mainAxisSize = MainAxisSize.max,
94 | this.crossAxisAlignment = CrossAxisAlignment.center,
95 | this.textDirection,
96 | this.verticalDirection = VerticalDirection.down,
97 | this.textBaseline,
98 | this.children,
99 | this.spaceBetween,
100 | this.padding,
101 | }) : sizeBetween = null;
102 |
103 | /// Creates a flex layout with an `extraSmall` space between children.
104 | ///
105 | /// The [direction] is required.
106 | ///
107 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
108 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
109 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
110 | ///
111 | /// The [textDirection] argument defaults to the ambient [Directionality], if
112 | /// any. If there is no ambient directionality, and a text direction is going
113 | /// to be necessary to decide which direction to lay the children in or to
114 | /// disambiguate `start` or `end` values for the main or cross axis
115 | /// directions, the [textDirection] must not be null.
116 | ///
117 | /// A [padding] can be defined to add space around children.
118 | const SpacedFlex.extraSmall({
119 | Key? key,
120 | required this.direction,
121 | this.clipBehavior = Clip.hardEdge,
122 | this.mainAxisAlignment = MainAxisAlignment.start,
123 | this.mainAxisSize = MainAxisSize.max,
124 | this.crossAxisAlignment = CrossAxisAlignment.center,
125 | this.textDirection,
126 | this.verticalDirection = VerticalDirection.down,
127 | this.textBaseline,
128 | this.children,
129 | this.padding,
130 | }) : sizeBetween = SpaceSize.extraSmall,
131 | spaceBetween = null;
132 |
133 | /// Creates a flex layout with a `small` space between children.
134 | ///
135 | /// The [direction] is required.
136 | ///
137 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
138 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
139 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
140 | ///
141 | /// The [textDirection] argument defaults to the ambient [Directionality], if
142 | /// any. If there is no ambient directionality, and a text direction is going
143 | /// to be necessary to decide which direction to lay the children in or to
144 | /// disambiguate `start` or `end` values for the main or cross axis
145 | /// directions, the [textDirection] must not be null.
146 | ///
147 | /// A [padding] can be defined to add space around children.
148 | const SpacedFlex.small({
149 | Key? key,
150 | required this.direction,
151 | this.clipBehavior = Clip.hardEdge,
152 | this.mainAxisAlignment = MainAxisAlignment.start,
153 | this.mainAxisSize = MainAxisSize.max,
154 | this.crossAxisAlignment = CrossAxisAlignment.center,
155 | this.textDirection,
156 | this.verticalDirection = VerticalDirection.down,
157 | this.textBaseline,
158 | this.children,
159 | this.padding,
160 | }) : sizeBetween = SpaceSize.small,
161 | spaceBetween = null;
162 |
163 | /// Creates a flex layout with a `semiSmall` space between children.
164 | ///
165 | /// The [direction] is required.
166 | ///
167 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
168 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
169 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
170 | ///
171 | /// The [textDirection] argument defaults to the ambient [Directionality], if
172 | /// any. If there is no ambient directionality, and a text direction is going
173 | /// to be necessary to decide which direction to lay the children in or to
174 | /// disambiguate `start` or `end` values for the main or cross axis
175 | /// directions, the [textDirection] must not be null.
176 | ///
177 | /// A [padding] can be defined to add space around children.
178 | const SpacedFlex.semiSmall({
179 | Key? key,
180 | required this.direction,
181 | this.clipBehavior = Clip.hardEdge,
182 | this.mainAxisAlignment = MainAxisAlignment.start,
183 | this.mainAxisSize = MainAxisSize.max,
184 | this.crossAxisAlignment = CrossAxisAlignment.center,
185 | this.textDirection,
186 | this.verticalDirection = VerticalDirection.down,
187 | this.textBaseline,
188 | this.children,
189 | this.padding,
190 | }) : sizeBetween = SpaceSize.semiSmall,
191 | spaceBetween = null;
192 |
193 | /// Creates a flex layout with a `normal` space between children.
194 | ///
195 | /// The [direction] is required.
196 | ///
197 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
198 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
199 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
200 | ///
201 | /// The [textDirection] argument defaults to the ambient [Directionality], if
202 | /// any. If there is no ambient directionality, and a text direction is going
203 | /// to be necessary to decide which direction to lay the children in or to
204 | /// disambiguate `start` or `end` values for the main or cross axis
205 | /// directions, the [textDirection] must not be null.
206 | ///
207 | /// A [padding] can be defined to add space around children.
208 | const SpacedFlex.normal({
209 | Key? key,
210 | required this.direction,
211 | this.clipBehavior = Clip.hardEdge,
212 | this.mainAxisAlignment = MainAxisAlignment.start,
213 | this.mainAxisSize = MainAxisSize.max,
214 | this.crossAxisAlignment = CrossAxisAlignment.center,
215 | this.textDirection,
216 | this.verticalDirection = VerticalDirection.down,
217 | this.textBaseline,
218 | this.children,
219 | this.padding,
220 | }) : sizeBetween = SpaceSize.normal,
221 | spaceBetween = null;
222 |
223 | /// Creates a flex layout with a `semiBig` space between children.
224 | ///
225 | /// The [direction] is required.
226 | ///
227 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
228 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
229 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
230 | ///
231 | /// The [textDirection] argument defaults to the ambient [Directionality], if
232 | /// any. If there is no ambient directionality, and a text direction is going
233 | /// to be necessary to decide which direction to lay the children in or to
234 | /// disambiguate `start` or `end` values for the main or cross axis
235 | /// directions, the [textDirection] must not be null.
236 | ///
237 | /// A [padding] can be defined to add space around children.
238 | const SpacedFlex.semiBig({
239 | Key? key,
240 | required this.direction,
241 | this.clipBehavior = Clip.hardEdge,
242 | this.mainAxisAlignment = MainAxisAlignment.start,
243 | this.mainAxisSize = MainAxisSize.max,
244 | this.crossAxisAlignment = CrossAxisAlignment.center,
245 | this.textDirection,
246 | this.verticalDirection = VerticalDirection.down,
247 | this.textBaseline,
248 | this.children,
249 | this.padding,
250 | }) : sizeBetween = SpaceSize.semiBig,
251 | spaceBetween = null;
252 |
253 | /// Creates a flex layout with a `big` space between children.
254 | ///
255 | /// The [direction] is required.
256 | ///
257 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
258 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
259 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
260 | ///
261 | /// The [textDirection] argument defaults to the ambient [Directionality], if
262 | /// any. If there is no ambient directionality, and a text direction is going
263 | /// to be necessary to decide which direction to lay the children in or to
264 | /// disambiguate `start` or `end` values for the main or cross axis
265 | /// directions, the [textDirection] must not be null.
266 | ///
267 | /// A [padding] can be defined to add space around children.
268 | const SpacedFlex.big({
269 | Key? key,
270 | required this.direction,
271 | this.clipBehavior = Clip.hardEdge,
272 | this.mainAxisAlignment = MainAxisAlignment.start,
273 | this.mainAxisSize = MainAxisSize.max,
274 | this.crossAxisAlignment = CrossAxisAlignment.center,
275 | this.textDirection,
276 | this.verticalDirection = VerticalDirection.down,
277 | this.textBaseline,
278 | this.children,
279 | this.padding,
280 | }) : sizeBetween = SpaceSize.big,
281 | spaceBetween = null;
282 |
283 | /// Creates a flex layout with an `extraBig` space between children.
284 | ///
285 | /// The [direction] is required.
286 | ///
287 | /// The [direction], [mainAxisAlignment], [crossAxisAlignment], and
288 | /// [verticalDirection] arguments must not be null. If [crossAxisAlignment] is
289 | /// [CrossAxisAlignment.baseline], then [textBaseline] must not be null.
290 | ///
291 | /// The [textDirection] argument defaults to the ambient [Directionality], if
292 | /// any. If there is no ambient directionality, and a text direction is going
293 | /// to be necessary to decide which direction to lay the children in or to
294 | /// disambiguate `start` or `end` values for the main or cross axis
295 | /// directions, the [textDirection] must not be null.
296 | ///
297 | /// A [padding] can be defined to add space around children.
298 | const SpacedFlex.extraBig({
299 | Key? key,
300 | required this.direction,
301 | this.clipBehavior = Clip.hardEdge,
302 | this.mainAxisAlignment = MainAxisAlignment.start,
303 | this.mainAxisSize = MainAxisSize.max,
304 | this.crossAxisAlignment = CrossAxisAlignment.center,
305 | this.textDirection,
306 | this.verticalDirection = VerticalDirection.down,
307 | this.textBaseline,
308 | this.children,
309 | this.padding,
310 | }) : sizeBetween = SpaceSize.extraBig,
311 | spaceBetween = null;
312 |
313 | @override
314 | Widget build(BuildContext context) {
315 | var spaceBetween = this.spaceBetween;
316 | if (spaceBetween == null) {
317 | var sizeBetween = this.sizeBetween ?? SpaceSize.normal;
318 | spaceBetween = sizeBetween.toPoints(context);
319 | }
320 |
321 | Widget result = Flex(
322 | clipBehavior: clipBehavior,
323 | direction: direction,
324 | mainAxisAlignment: mainAxisAlignment,
325 | mainAxisSize: mainAxisSize,
326 | crossAxisAlignment: crossAxisAlignment,
327 | textDirection: textDirection,
328 | verticalDirection: verticalDirection,
329 | textBaseline: textBaseline,
330 | children: spacedWidgets(
331 | children: children ?? const [],
332 | spaceBetween: spaceBetween,
333 | ),
334 | );
335 |
336 | if (padding != null && padding != EdgeInsets.zero) {
337 | result = Padding(
338 | child: result,
339 | padding: padding!,
340 | );
341 | }
342 |
343 | return result;
344 | }
345 | }
346 |
347 | /// A widget that behaves like a [Column], but with the possibility to
348 | /// add a [spaceBetween] children, and a [padding] around them.
349 | ///
350 | /// See also:
351 | ///
352 | /// * [SpacedRow], the space version of the [Row] equivalent.
353 | /// * [SpacedFlex], the base widget this one is based on.
354 | class SpacedColumn extends SpacedFlex {
355 | const SpacedColumn({
356 | Key? key,
357 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
358 | MainAxisSize mainAxisSize = MainAxisSize.max,
359 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
360 | TextDirection? textDirection,
361 | VerticalDirection verticalDirection = VerticalDirection.down,
362 | TextBaseline? textBaseline,
363 | List? children,
364 | double? spaceBetween,
365 | EdgeInsets? padding,
366 | Clip clipBehavior = Clip.hardEdge,
367 | }) : super(
368 | children: children,
369 | key: key,
370 | direction: Axis.vertical,
371 | clipBehavior: clipBehavior,
372 | mainAxisAlignment: mainAxisAlignment,
373 | mainAxisSize: mainAxisSize,
374 | crossAxisAlignment: crossAxisAlignment,
375 | textDirection: textDirection,
376 | verticalDirection: verticalDirection,
377 | textBaseline: textBaseline,
378 | spaceBetween: spaceBetween,
379 | padding: padding,
380 | );
381 |
382 | const SpacedColumn.extraSmall({
383 | Key? key,
384 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
385 | MainAxisSize mainAxisSize = MainAxisSize.max,
386 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
387 | TextDirection? textDirection,
388 | VerticalDirection verticalDirection = VerticalDirection.down,
389 | TextBaseline? textBaseline,
390 | List? children,
391 | EdgeInsets? padding,
392 | Clip clipBehavior = Clip.hardEdge,
393 | }) : super.extraSmall(
394 | children: children,
395 | key: key,
396 | direction: Axis.vertical,
397 | clipBehavior: clipBehavior,
398 | mainAxisAlignment: mainAxisAlignment,
399 | mainAxisSize: mainAxisSize,
400 | crossAxisAlignment: crossAxisAlignment,
401 | textDirection: textDirection,
402 | verticalDirection: verticalDirection,
403 | textBaseline: textBaseline,
404 | padding: padding,
405 | );
406 |
407 | const SpacedColumn.small({
408 | Key? key,
409 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
410 | MainAxisSize mainAxisSize = MainAxisSize.max,
411 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
412 | TextDirection? textDirection,
413 | VerticalDirection verticalDirection = VerticalDirection.down,
414 | TextBaseline? textBaseline,
415 | List? children,
416 | EdgeInsets? padding,
417 | Clip clipBehavior = Clip.hardEdge,
418 | }) : super.small(
419 | children: children,
420 | key: key,
421 | direction: Axis.vertical,
422 | clipBehavior: clipBehavior,
423 | mainAxisAlignment: mainAxisAlignment,
424 | mainAxisSize: mainAxisSize,
425 | crossAxisAlignment: crossAxisAlignment,
426 | textDirection: textDirection,
427 | verticalDirection: verticalDirection,
428 | textBaseline: textBaseline,
429 | padding: padding,
430 | );
431 |
432 | const SpacedColumn.semiSmall({
433 | Key? key,
434 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
435 | MainAxisSize mainAxisSize = MainAxisSize.max,
436 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
437 | TextDirection? textDirection,
438 | VerticalDirection verticalDirection = VerticalDirection.down,
439 | TextBaseline? textBaseline,
440 | List? children,
441 | EdgeInsets? padding,
442 | Clip clipBehavior = Clip.hardEdge,
443 | }) : super.semiSmall(
444 | children: children,
445 | key: key,
446 | direction: Axis.vertical,
447 | clipBehavior: clipBehavior,
448 | mainAxisAlignment: mainAxisAlignment,
449 | mainAxisSize: mainAxisSize,
450 | crossAxisAlignment: crossAxisAlignment,
451 | textDirection: textDirection,
452 | verticalDirection: verticalDirection,
453 | textBaseline: textBaseline,
454 | padding: padding,
455 | );
456 |
457 | const SpacedColumn.normal({
458 | Key? key,
459 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
460 | MainAxisSize mainAxisSize = MainAxisSize.max,
461 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
462 | TextDirection? textDirection,
463 | VerticalDirection verticalDirection = VerticalDirection.down,
464 | TextBaseline? textBaseline,
465 | List? children,
466 | EdgeInsets? padding,
467 | Clip clipBehavior = Clip.hardEdge,
468 | }) : super.normal(
469 | children: children,
470 | key: key,
471 | direction: Axis.vertical,
472 | clipBehavior: clipBehavior,
473 | mainAxisAlignment: mainAxisAlignment,
474 | mainAxisSize: mainAxisSize,
475 | crossAxisAlignment: crossAxisAlignment,
476 | textDirection: textDirection,
477 | verticalDirection: verticalDirection,
478 | textBaseline: textBaseline,
479 | padding: padding,
480 | );
481 |
482 | const SpacedColumn.semiBig({
483 | Key? key,
484 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
485 | MainAxisSize mainAxisSize = MainAxisSize.max,
486 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
487 | TextDirection? textDirection,
488 | VerticalDirection verticalDirection = VerticalDirection.down,
489 | TextBaseline? textBaseline,
490 | List? children,
491 | EdgeInsets? padding,
492 | Clip clipBehavior = Clip.hardEdge,
493 | }) : super.semiBig(
494 | children: children,
495 | key: key,
496 | direction: Axis.vertical,
497 | clipBehavior: clipBehavior,
498 | mainAxisAlignment: mainAxisAlignment,
499 | mainAxisSize: mainAxisSize,
500 | crossAxisAlignment: crossAxisAlignment,
501 | textDirection: textDirection,
502 | verticalDirection: verticalDirection,
503 | textBaseline: textBaseline,
504 | padding: padding,
505 | );
506 |
507 | const SpacedColumn.big({
508 | Key? key,
509 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
510 | MainAxisSize mainAxisSize = MainAxisSize.max,
511 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
512 | TextDirection? textDirection,
513 | VerticalDirection verticalDirection = VerticalDirection.down,
514 | TextBaseline? textBaseline,
515 | List? children,
516 | EdgeInsets? padding,
517 | Clip clipBehavior = Clip.hardEdge,
518 | }) : super.big(
519 | children: children,
520 | key: key,
521 | direction: Axis.vertical,
522 | clipBehavior: clipBehavior,
523 | mainAxisAlignment: mainAxisAlignment,
524 | mainAxisSize: mainAxisSize,
525 | crossAxisAlignment: crossAxisAlignment,
526 | textDirection: textDirection,
527 | verticalDirection: verticalDirection,
528 | textBaseline: textBaseline,
529 | padding: padding,
530 | );
531 |
532 | const SpacedColumn.extraBig({
533 | Key? key,
534 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
535 | MainAxisSize mainAxisSize = MainAxisSize.max,
536 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
537 | TextDirection? textDirection,
538 | VerticalDirection verticalDirection = VerticalDirection.down,
539 | TextBaseline? textBaseline,
540 | List? children,
541 | EdgeInsets? padding,
542 | Clip clipBehavior = Clip.hardEdge,
543 | }) : super.extraBig(
544 | children: children,
545 | key: key,
546 | direction: Axis.vertical,
547 | clipBehavior: clipBehavior,
548 | mainAxisAlignment: mainAxisAlignment,
549 | mainAxisSize: mainAxisSize,
550 | crossAxisAlignment: crossAxisAlignment,
551 | textDirection: textDirection,
552 | verticalDirection: verticalDirection,
553 | textBaseline: textBaseline,
554 | padding: padding,
555 | );
556 | }
557 |
558 | /// A widget that behaves like a [Row], but with the possibility to
559 | /// add a [spaceBetween] children, and a [padding] around them.
560 | ///
561 | /// See also:
562 | ///
563 | /// * [SpacedRow], the space version of the [Row] equivalent.
564 | /// * [SpacedFlex], the base widget this one is based on.
565 | class SpacedRow extends SpacedFlex {
566 | const SpacedRow({
567 | Key? key,
568 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
569 | MainAxisSize mainAxisSize = MainAxisSize.max,
570 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
571 | TextDirection? textDirection,
572 | VerticalDirection verticalDirection = VerticalDirection.down,
573 | TextBaseline? textBaseline,
574 | List? children,
575 | double? spaceBetween,
576 | EdgeInsets? padding,
577 | Clip clipBehavior = Clip.hardEdge,
578 | }) : super(
579 | children: children,
580 | key: key,
581 | clipBehavior: clipBehavior,
582 | direction: Axis.horizontal,
583 | mainAxisAlignment: mainAxisAlignment,
584 | mainAxisSize: mainAxisSize,
585 | crossAxisAlignment: crossAxisAlignment,
586 | textDirection: textDirection,
587 | verticalDirection: verticalDirection,
588 | textBaseline: textBaseline,
589 | spaceBetween: spaceBetween,
590 | padding: padding,
591 | );
592 |
593 | const SpacedRow.extraSmall({
594 | Key? key,
595 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
596 | MainAxisSize mainAxisSize = MainAxisSize.max,
597 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
598 | TextDirection? textDirection,
599 | VerticalDirection verticalDirection = VerticalDirection.down,
600 | TextBaseline? textBaseline,
601 | List? children,
602 | EdgeInsets? padding,
603 | Clip clipBehavior = Clip.hardEdge,
604 | }) : super.extraSmall(
605 | children: children,
606 | key: key,
607 | direction: Axis.horizontal,
608 | clipBehavior: clipBehavior,
609 | mainAxisAlignment: mainAxisAlignment,
610 | mainAxisSize: mainAxisSize,
611 | crossAxisAlignment: crossAxisAlignment,
612 | textDirection: textDirection,
613 | verticalDirection: verticalDirection,
614 | textBaseline: textBaseline,
615 | padding: padding,
616 | );
617 |
618 | const SpacedRow.small({
619 | Key? key,
620 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
621 | MainAxisSize mainAxisSize = MainAxisSize.max,
622 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
623 | TextDirection? textDirection,
624 | VerticalDirection verticalDirection = VerticalDirection.down,
625 | TextBaseline? textBaseline,
626 | List? children,
627 | EdgeInsets? padding,
628 | Clip clipBehavior = Clip.hardEdge,
629 | }) : super.small(
630 | children: children,
631 | key: key,
632 | direction: Axis.horizontal,
633 | clipBehavior: clipBehavior,
634 | mainAxisAlignment: mainAxisAlignment,
635 | mainAxisSize: mainAxisSize,
636 | crossAxisAlignment: crossAxisAlignment,
637 | textDirection: textDirection,
638 | verticalDirection: verticalDirection,
639 | textBaseline: textBaseline,
640 | padding: padding,
641 | );
642 |
643 | const SpacedRow.semiSmall({
644 | Key? key,
645 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
646 | MainAxisSize mainAxisSize = MainAxisSize.max,
647 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
648 | TextDirection? textDirection,
649 | VerticalDirection verticalDirection = VerticalDirection.down,
650 | TextBaseline? textBaseline,
651 | List? children,
652 | EdgeInsets? padding,
653 | Clip clipBehavior = Clip.hardEdge,
654 | }) : super.semiSmall(
655 | children: children,
656 | key: key,
657 | direction: Axis.horizontal,
658 | clipBehavior: clipBehavior,
659 | mainAxisAlignment: mainAxisAlignment,
660 | mainAxisSize: mainAxisSize,
661 | crossAxisAlignment: crossAxisAlignment,
662 | textDirection: textDirection,
663 | verticalDirection: verticalDirection,
664 | textBaseline: textBaseline,
665 | padding: padding,
666 | );
667 |
668 | const SpacedRow.normal({
669 | Key? key,
670 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
671 | MainAxisSize mainAxisSize = MainAxisSize.max,
672 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
673 | TextDirection? textDirection,
674 | VerticalDirection verticalDirection = VerticalDirection.down,
675 | TextBaseline? textBaseline,
676 | List? children,
677 | EdgeInsets? padding,
678 | Clip clipBehavior = Clip.hardEdge,
679 | }) : super.normal(
680 | children: children,
681 | key: key,
682 | direction: Axis.horizontal,
683 | clipBehavior: clipBehavior,
684 | mainAxisAlignment: mainAxisAlignment,
685 | mainAxisSize: mainAxisSize,
686 | crossAxisAlignment: crossAxisAlignment,
687 | textDirection: textDirection,
688 | verticalDirection: verticalDirection,
689 | textBaseline: textBaseline,
690 | padding: padding,
691 | );
692 |
693 | const SpacedRow.semiBig({
694 | Key? key,
695 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
696 | MainAxisSize mainAxisSize = MainAxisSize.max,
697 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
698 | TextDirection? textDirection,
699 | VerticalDirection verticalDirection = VerticalDirection.down,
700 | TextBaseline? textBaseline,
701 | List? children,
702 | EdgeInsets? padding,
703 | Clip clipBehavior = Clip.hardEdge,
704 | }) : super.semiBig(
705 | children: children,
706 | key: key,
707 | direction: Axis.horizontal,
708 | clipBehavior: clipBehavior,
709 | mainAxisAlignment: mainAxisAlignment,
710 | mainAxisSize: mainAxisSize,
711 | crossAxisAlignment: crossAxisAlignment,
712 | textDirection: textDirection,
713 | verticalDirection: verticalDirection,
714 | textBaseline: textBaseline,
715 | padding: padding,
716 | );
717 |
718 | const SpacedRow.big({
719 | Key? key,
720 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
721 | MainAxisSize mainAxisSize = MainAxisSize.max,
722 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
723 | TextDirection? textDirection,
724 | VerticalDirection verticalDirection = VerticalDirection.down,
725 | TextBaseline? textBaseline,
726 | List? children,
727 | EdgeInsets? padding,
728 | Clip clipBehavior = Clip.hardEdge,
729 | }) : super.big(
730 | children: children,
731 | key: key,
732 | direction: Axis.horizontal,
733 | clipBehavior: clipBehavior,
734 | mainAxisAlignment: mainAxisAlignment,
735 | mainAxisSize: mainAxisSize,
736 | crossAxisAlignment: crossAxisAlignment,
737 | textDirection: textDirection,
738 | verticalDirection: verticalDirection,
739 | textBaseline: textBaseline,
740 | padding: padding,
741 | );
742 |
743 | const SpacedRow.extraBig({
744 | Key? key,
745 | MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start,
746 | MainAxisSize mainAxisSize = MainAxisSize.max,
747 | CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center,
748 | TextDirection? textDirection,
749 | VerticalDirection verticalDirection = VerticalDirection.down,
750 | TextBaseline? textBaseline,
751 | List? children,
752 | EdgeInsets? padding,
753 | Clip clipBehavior = Clip.hardEdge,
754 | }) : super.extraBig(
755 | children: children,
756 | key: key,
757 | direction: Axis.horizontal,
758 | clipBehavior: clipBehavior,
759 | mainAxisAlignment: mainAxisAlignment,
760 | mainAxisSize: mainAxisSize,
761 | crossAxisAlignment: crossAxisAlignment,
762 | textDirection: textDirection,
763 | verticalDirection: verticalDirection,
764 | textBaseline: textBaseline,
765 | padding: padding,
766 | );
767 | }
768 |
--------------------------------------------------------------------------------
/lib/src/spacing_data.freezed.dart:
--------------------------------------------------------------------------------
1 | // GENERATED CODE - DO NOT MODIFY BY HAND
2 | // ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides
3 |
4 | part of 'spacing_data.dart';
5 |
6 | // **************************************************************************
7 | // FreezedGenerator
8 | // **************************************************************************
9 |
10 | T _$identity(T value) => value;
11 |
12 | final _privateConstructorUsedError = UnsupportedError(
13 | 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
14 |
15 | /// @nodoc
16 | class _$SpacingDataTearOff {
17 | const _$SpacingDataTearOff();
18 |
19 | _SpacingData call(
20 | {required SpacingInsetsData insets, required SizeSet spaces}) {
21 | return _SpacingData(
22 | insets: insets,
23 | spaces: spaces,
24 | );
25 | }
26 | }
27 |
28 | /// @nodoc
29 | const $SpacingData = _$SpacingDataTearOff();
30 |
31 | /// @nodoc
32 | mixin _$SpacingData {
33 | SpacingInsetsData get insets => throw _privateConstructorUsedError;
34 | SizeSet get spaces => throw _privateConstructorUsedError;
35 |
36 | @JsonKey(ignore: true)
37 | $SpacingDataCopyWith get copyWith =>
38 | throw _privateConstructorUsedError;
39 | }
40 |
41 | /// @nodoc
42 | abstract class $SpacingDataCopyWith<$Res> {
43 | factory $SpacingDataCopyWith(
44 | SpacingData value, $Res Function(SpacingData) then) =
45 | _$SpacingDataCopyWithImpl<$Res>;
46 | $Res call({SpacingInsetsData insets, SizeSet spaces});
47 |
48 | $SpacingInsetsDataCopyWith<$Res> get insets;
49 | $SizeSetCopyWith get spaces;
50 | }
51 |
52 | /// @nodoc
53 | class _$SpacingDataCopyWithImpl<$Res> implements $SpacingDataCopyWith<$Res> {
54 | _$SpacingDataCopyWithImpl(this._value, this._then);
55 |
56 | final SpacingData _value;
57 | // ignore: unused_field
58 | final $Res Function(SpacingData) _then;
59 |
60 | @override
61 | $Res call({
62 | Object? insets = freezed,
63 | Object? spaces = freezed,
64 | }) {
65 | return _then(_value.copyWith(
66 | insets: insets == freezed ? _value.insets : insets as SpacingInsetsData,
67 | spaces: spaces == freezed ? _value.spaces : spaces as SizeSet,
68 | ));
69 | }
70 |
71 | @override
72 | $SpacingInsetsDataCopyWith<$Res> get insets {
73 | return $SpacingInsetsDataCopyWith<$Res>(_value.insets, (value) {
74 | return _then(_value.copyWith(insets: value));
75 | });
76 | }
77 |
78 | @override
79 | $SizeSetCopyWith get spaces {
80 | return $SizeSetCopyWith(_value.spaces, (value) {
81 | return _then(_value.copyWith(spaces: value));
82 | });
83 | }
84 | }
85 |
86 | /// @nodoc
87 | abstract class _$SpacingDataCopyWith<$Res>
88 | implements $SpacingDataCopyWith<$Res> {
89 | factory _$SpacingDataCopyWith(
90 | _SpacingData value, $Res Function(_SpacingData) then) =
91 | __$SpacingDataCopyWithImpl<$Res>;
92 | @override
93 | $Res call({SpacingInsetsData insets, SizeSet spaces});
94 |
95 | @override
96 | $SpacingInsetsDataCopyWith<$Res> get insets;
97 | @override
98 | $SizeSetCopyWith get spaces;
99 | }
100 |
101 | /// @nodoc
102 | class __$SpacingDataCopyWithImpl<$Res> extends _$SpacingDataCopyWithImpl<$Res>
103 | implements _$SpacingDataCopyWith<$Res> {
104 | __$SpacingDataCopyWithImpl(
105 | _SpacingData _value, $Res Function(_SpacingData) _then)
106 | : super(_value, (v) => _then(v as _SpacingData));
107 |
108 | @override
109 | _SpacingData get _value => super._value as _SpacingData;
110 |
111 | @override
112 | $Res call({
113 | Object? insets = freezed,
114 | Object? spaces = freezed,
115 | }) {
116 | return _then(_SpacingData(
117 | insets: insets == freezed ? _value.insets : insets as SpacingInsetsData,
118 | spaces: spaces == freezed ? _value.spaces : spaces as SizeSet,
119 | ));
120 | }
121 | }
122 |
123 | /// @nodoc
124 | class _$_SpacingData implements _SpacingData {
125 | const _$_SpacingData({required this.insets, required this.spaces});
126 |
127 | @override
128 | final SpacingInsetsData insets;
129 | @override
130 | final SizeSet spaces;
131 |
132 | @override
133 | String toString() {
134 | return 'SpacingData(insets: $insets, spaces: $spaces)';
135 | }
136 |
137 | @override
138 | bool operator ==(dynamic other) {
139 | return identical(this, other) ||
140 | (other is _SpacingData &&
141 | (identical(other.insets, insets) ||
142 | const DeepCollectionEquality().equals(other.insets, insets)) &&
143 | (identical(other.spaces, spaces) ||
144 | const DeepCollectionEquality().equals(other.spaces, spaces)));
145 | }
146 |
147 | @override
148 | int get hashCode =>
149 | runtimeType.hashCode ^
150 | const DeepCollectionEquality().hash(insets) ^
151 | const DeepCollectionEquality().hash(spaces);
152 |
153 | @JsonKey(ignore: true)
154 | @override
155 | _$SpacingDataCopyWith<_SpacingData> get copyWith =>
156 | __$SpacingDataCopyWithImpl<_SpacingData>(this, _$identity);
157 | }
158 |
159 | abstract class _SpacingData implements SpacingData {
160 | const factory _SpacingData(
161 | {required SpacingInsetsData insets,
162 | required SizeSet spaces}) = _$_SpacingData;
163 |
164 | @override
165 | SpacingInsetsData get insets => throw _privateConstructorUsedError;
166 | @override
167 | SizeSet get spaces => throw _privateConstructorUsedError;
168 | @override
169 | @JsonKey(ignore: true)
170 | _$SpacingDataCopyWith<_SpacingData> get copyWith =>
171 | throw _privateConstructorUsedError;
172 | }
173 |
174 | /// @nodoc
175 | class _$SpacingInsetsDataTearOff {
176 | const _$SpacingInsetsDataTearOff();
177 |
178 | _SpacingInsetsData call(
179 | {required SizeSet all,
180 | required SizeSet horizontal,
181 | required SizeSet vertical,
182 | required SizeSet onlyRight,
183 | required SizeSet onlyTop,
184 | required SizeSet onlyBottom,
185 | required SizeSet onlyLeft,
186 | required SizeSet exceptLeft,
187 | required SizeSet exceptRight,
188 | required SizeSet exceptTop,
189 | required SizeSet exceptBottom}) {
190 | return _SpacingInsetsData(
191 | all: all,
192 | horizontal: horizontal,
193 | vertical: vertical,
194 | onlyRight: onlyRight,
195 | onlyTop: onlyTop,
196 | onlyBottom: onlyBottom,
197 | onlyLeft: onlyLeft,
198 | exceptLeft: exceptLeft,
199 | exceptRight: exceptRight,
200 | exceptTop: exceptTop,
201 | exceptBottom: exceptBottom,
202 | );
203 | }
204 | }
205 |
206 | /// @nodoc
207 | const $SpacingInsetsData = _$SpacingInsetsDataTearOff();
208 |
209 | /// @nodoc
210 | mixin _$SpacingInsetsData {
211 | SizeSet get all => throw _privateConstructorUsedError;
212 | SizeSet get horizontal => throw _privateConstructorUsedError;
213 | SizeSet get vertical => throw _privateConstructorUsedError;
214 | SizeSet get onlyRight => throw _privateConstructorUsedError;
215 | SizeSet get onlyTop => throw _privateConstructorUsedError;
216 | SizeSet get onlyBottom => throw _privateConstructorUsedError;
217 | SizeSet get onlyLeft => throw _privateConstructorUsedError;
218 | SizeSet get exceptLeft => throw _privateConstructorUsedError;
219 | SizeSet get exceptRight => throw _privateConstructorUsedError;
220 | SizeSet get exceptTop => throw _privateConstructorUsedError;
221 | SizeSet get exceptBottom => throw _privateConstructorUsedError;
222 |
223 | @JsonKey(ignore: true)
224 | $SpacingInsetsDataCopyWith get copyWith =>
225 | throw _privateConstructorUsedError;
226 | }
227 |
228 | /// @nodoc
229 | abstract class $SpacingInsetsDataCopyWith<$Res> {
230 | factory $SpacingInsetsDataCopyWith(
231 | SpacingInsetsData value, $Res Function(SpacingInsetsData) then) =
232 | _$SpacingInsetsDataCopyWithImpl<$Res>;
233 | $Res call(
234 | {SizeSet all,
235 | SizeSet horizontal,
236 | SizeSet vertical,
237 | SizeSet onlyRight,
238 | SizeSet onlyTop,
239 | SizeSet onlyBottom,
240 | SizeSet onlyLeft,
241 | SizeSet exceptLeft,
242 | SizeSet exceptRight,
243 | SizeSet exceptTop,
244 | SizeSet exceptBottom});
245 |
246 | $SizeSetCopyWith get all;
247 | $SizeSetCopyWith get horizontal;
248 | $SizeSetCopyWith get vertical;
249 | $SizeSetCopyWith get onlyRight;
250 | $SizeSetCopyWith get onlyTop;
251 | $SizeSetCopyWith get onlyBottom;
252 | $SizeSetCopyWith get onlyLeft;
253 | $SizeSetCopyWith get exceptLeft;
254 | $SizeSetCopyWith get exceptRight;
255 | $SizeSetCopyWith get exceptTop;
256 | $SizeSetCopyWith get exceptBottom;
257 | }
258 |
259 | /// @nodoc
260 | class _$SpacingInsetsDataCopyWithImpl<$Res>
261 | implements $SpacingInsetsDataCopyWith<$Res> {
262 | _$SpacingInsetsDataCopyWithImpl(this._value, this._then);
263 |
264 | final SpacingInsetsData _value;
265 | // ignore: unused_field
266 | final $Res Function(SpacingInsetsData) _then;
267 |
268 | @override
269 | $Res call({
270 | Object? all = freezed,
271 | Object? horizontal = freezed,
272 | Object? vertical = freezed,
273 | Object? onlyRight = freezed,
274 | Object? onlyTop = freezed,
275 | Object? onlyBottom = freezed,
276 | Object? onlyLeft = freezed,
277 | Object? exceptLeft = freezed,
278 | Object? exceptRight = freezed,
279 | Object? exceptTop = freezed,
280 | Object? exceptBottom = freezed,
281 | }) {
282 | return _then(_value.copyWith(
283 | all: all == freezed ? _value.all : all as SizeSet,
284 | horizontal: horizontal == freezed
285 | ? _value.horizontal
286 | : horizontal as SizeSet,
287 | vertical: vertical == freezed
288 | ? _value.vertical
289 | : vertical as SizeSet,
290 | onlyRight: onlyRight == freezed
291 | ? _value.onlyRight
292 | : onlyRight as SizeSet,
293 | onlyTop:
294 | onlyTop == freezed ? _value.onlyTop : onlyTop as SizeSet,
295 | onlyBottom: onlyBottom == freezed
296 | ? _value.onlyBottom
297 | : onlyBottom as SizeSet,
298 | onlyLeft: onlyLeft == freezed
299 | ? _value.onlyLeft
300 | : onlyLeft as SizeSet,
301 | exceptLeft: exceptLeft == freezed
302 | ? _value.exceptLeft
303 | : exceptLeft as SizeSet,
304 | exceptRight: exceptRight == freezed
305 | ? _value.exceptRight
306 | : exceptRight as SizeSet,
307 | exceptTop: exceptTop == freezed
308 | ? _value.exceptTop
309 | : exceptTop as SizeSet,
310 | exceptBottom: exceptBottom == freezed
311 | ? _value.exceptBottom
312 | : exceptBottom as SizeSet,
313 | ));
314 | }
315 |
316 | @override
317 | $SizeSetCopyWith get all {
318 | return $SizeSetCopyWith(_value.all, (value) {
319 | return _then(_value.copyWith(all: value));
320 | });
321 | }
322 |
323 | @override
324 | $SizeSetCopyWith get horizontal {
325 | return $SizeSetCopyWith(_value.horizontal, (value) {
326 | return _then(_value.copyWith(horizontal: value));
327 | });
328 | }
329 |
330 | @override
331 | $SizeSetCopyWith get vertical {
332 | return $SizeSetCopyWith(_value.vertical, (value) {
333 | return _then(_value.copyWith(vertical: value));
334 | });
335 | }
336 |
337 | @override
338 | $SizeSetCopyWith get onlyRight {
339 | return $SizeSetCopyWith(_value.onlyRight, (value) {
340 | return _then(_value.copyWith(onlyRight: value));
341 | });
342 | }
343 |
344 | @override
345 | $SizeSetCopyWith get onlyTop {
346 | return $SizeSetCopyWith(_value.onlyTop, (value) {
347 | return _then(_value.copyWith(onlyTop: value));
348 | });
349 | }
350 |
351 | @override
352 | $SizeSetCopyWith get onlyBottom {
353 | return $SizeSetCopyWith(_value.onlyBottom, (value) {
354 | return _then(_value.copyWith(onlyBottom: value));
355 | });
356 | }
357 |
358 | @override
359 | $SizeSetCopyWith get onlyLeft {
360 | return $SizeSetCopyWith(_value.onlyLeft, (value) {
361 | return _then(_value.copyWith(onlyLeft: value));
362 | });
363 | }
364 |
365 | @override
366 | $SizeSetCopyWith get exceptLeft {
367 | return $SizeSetCopyWith(_value.exceptLeft, (value) {
368 | return _then(_value.copyWith(exceptLeft: value));
369 | });
370 | }
371 |
372 | @override
373 | $SizeSetCopyWith get exceptRight {
374 | return $SizeSetCopyWith(_value.exceptRight, (value) {
375 | return _then(_value.copyWith(exceptRight: value));
376 | });
377 | }
378 |
379 | @override
380 | $SizeSetCopyWith get exceptTop {
381 | return $SizeSetCopyWith(_value.exceptTop, (value) {
382 | return _then(_value.copyWith(exceptTop: value));
383 | });
384 | }
385 |
386 | @override
387 | $SizeSetCopyWith get exceptBottom {
388 | return $SizeSetCopyWith(_value.exceptBottom, (value) {
389 | return _then(_value.copyWith(exceptBottom: value));
390 | });
391 | }
392 | }
393 |
394 | /// @nodoc
395 | abstract class _$SpacingInsetsDataCopyWith<$Res>
396 | implements $SpacingInsetsDataCopyWith<$Res> {
397 | factory _$SpacingInsetsDataCopyWith(
398 | _SpacingInsetsData value, $Res Function(_SpacingInsetsData) then) =
399 | __$SpacingInsetsDataCopyWithImpl<$Res>;
400 | @override
401 | $Res call(
402 | {SizeSet all,
403 | SizeSet horizontal,
404 | SizeSet vertical,
405 | SizeSet onlyRight,
406 | SizeSet onlyTop,
407 | SizeSet onlyBottom,
408 | SizeSet onlyLeft,
409 | SizeSet exceptLeft,
410 | SizeSet exceptRight,
411 | SizeSet exceptTop,
412 | SizeSet exceptBottom});
413 |
414 | @override
415 | $SizeSetCopyWith get all;
416 | @override
417 | $SizeSetCopyWith get horizontal;
418 | @override
419 | $SizeSetCopyWith get vertical;
420 | @override
421 | $SizeSetCopyWith get onlyRight;
422 | @override
423 | $SizeSetCopyWith get onlyTop;
424 | @override
425 | $SizeSetCopyWith get onlyBottom;
426 | @override
427 | $SizeSetCopyWith get onlyLeft;
428 | @override
429 | $SizeSetCopyWith get exceptLeft;
430 | @override
431 | $SizeSetCopyWith get exceptRight;
432 | @override
433 | $SizeSetCopyWith get exceptTop;
434 | @override
435 | $SizeSetCopyWith get exceptBottom;
436 | }
437 |
438 | /// @nodoc
439 | class __$SpacingInsetsDataCopyWithImpl<$Res>
440 | extends _$SpacingInsetsDataCopyWithImpl<$Res>
441 | implements _$SpacingInsetsDataCopyWith<$Res> {
442 | __$SpacingInsetsDataCopyWithImpl(
443 | _SpacingInsetsData _value, $Res Function(_SpacingInsetsData) _then)
444 | : super(_value, (v) => _then(v as _SpacingInsetsData));
445 |
446 | @override
447 | _SpacingInsetsData get _value => super._value as _SpacingInsetsData;
448 |
449 | @override
450 | $Res call({
451 | Object? all = freezed,
452 | Object? horizontal = freezed,
453 | Object? vertical = freezed,
454 | Object? onlyRight = freezed,
455 | Object? onlyTop = freezed,
456 | Object? onlyBottom = freezed,
457 | Object? onlyLeft = freezed,
458 | Object? exceptLeft = freezed,
459 | Object? exceptRight = freezed,
460 | Object? exceptTop = freezed,
461 | Object? exceptBottom = freezed,
462 | }) {
463 | return _then(_SpacingInsetsData(
464 | all: all == freezed ? _value.all : all as SizeSet,
465 | horizontal: horizontal == freezed
466 | ? _value.horizontal
467 | : horizontal as SizeSet,
468 | vertical: vertical == freezed
469 | ? _value.vertical
470 | : vertical as SizeSet,
471 | onlyRight: onlyRight == freezed
472 | ? _value.onlyRight
473 | : onlyRight as SizeSet,
474 | onlyTop:
475 | onlyTop == freezed ? _value.onlyTop : onlyTop as SizeSet,
476 | onlyBottom: onlyBottom == freezed
477 | ? _value.onlyBottom
478 | : onlyBottom as SizeSet,
479 | onlyLeft: onlyLeft == freezed
480 | ? _value.onlyLeft
481 | : onlyLeft as SizeSet,
482 | exceptLeft: exceptLeft == freezed
483 | ? _value.exceptLeft
484 | : exceptLeft as SizeSet,
485 | exceptRight: exceptRight == freezed
486 | ? _value.exceptRight
487 | : exceptRight as SizeSet,
488 | exceptTop: exceptTop == freezed
489 | ? _value.exceptTop
490 | : exceptTop as SizeSet,
491 | exceptBottom: exceptBottom == freezed
492 | ? _value.exceptBottom
493 | : exceptBottom as SizeSet,
494 | ));
495 | }
496 | }
497 |
498 | /// @nodoc
499 | class _$_SpacingInsetsData implements _SpacingInsetsData {
500 | const _$_SpacingInsetsData(
501 | {required this.all,
502 | required this.horizontal,
503 | required this.vertical,
504 | required this.onlyRight,
505 | required this.onlyTop,
506 | required this.onlyBottom,
507 | required this.onlyLeft,
508 | required this.exceptLeft,
509 | required this.exceptRight,
510 | required this.exceptTop,
511 | required this.exceptBottom});
512 |
513 | @override
514 | final SizeSet all;
515 | @override
516 | final SizeSet horizontal;
517 | @override
518 | final SizeSet vertical;
519 | @override
520 | final SizeSet onlyRight;
521 | @override
522 | final SizeSet onlyTop;
523 | @override
524 | final SizeSet onlyBottom;
525 | @override
526 | final SizeSet onlyLeft;
527 | @override
528 | final SizeSet exceptLeft;
529 | @override
530 | final SizeSet exceptRight;
531 | @override
532 | final SizeSet exceptTop;
533 | @override
534 | final SizeSet exceptBottom;
535 |
536 | @override
537 | String toString() {
538 | return 'SpacingInsetsData(all: $all, horizontal: $horizontal, vertical: $vertical, onlyRight: $onlyRight, onlyTop: $onlyTop, onlyBottom: $onlyBottom, onlyLeft: $onlyLeft, exceptLeft: $exceptLeft, exceptRight: $exceptRight, exceptTop: $exceptTop, exceptBottom: $exceptBottom)';
539 | }
540 |
541 | @override
542 | bool operator ==(dynamic other) {
543 | return identical(this, other) ||
544 | (other is _SpacingInsetsData &&
545 | (identical(other.all, all) ||
546 | const DeepCollectionEquality().equals(other.all, all)) &&
547 | (identical(other.horizontal, horizontal) ||
548 | const DeepCollectionEquality()
549 | .equals(other.horizontal, horizontal)) &&
550 | (identical(other.vertical, vertical) ||
551 | const DeepCollectionEquality()
552 | .equals(other.vertical, vertical)) &&
553 | (identical(other.onlyRight, onlyRight) ||
554 | const DeepCollectionEquality()
555 | .equals(other.onlyRight, onlyRight)) &&
556 | (identical(other.onlyTop, onlyTop) ||
557 | const DeepCollectionEquality()
558 | .equals(other.onlyTop, onlyTop)) &&
559 | (identical(other.onlyBottom, onlyBottom) ||
560 | const DeepCollectionEquality()
561 | .equals(other.onlyBottom, onlyBottom)) &&
562 | (identical(other.onlyLeft, onlyLeft) ||
563 | const DeepCollectionEquality()
564 | .equals(other.onlyLeft, onlyLeft)) &&
565 | (identical(other.exceptLeft, exceptLeft) ||
566 | const DeepCollectionEquality()
567 | .equals(other.exceptLeft, exceptLeft)) &&
568 | (identical(other.exceptRight, exceptRight) ||
569 | const DeepCollectionEquality()
570 | .equals(other.exceptRight, exceptRight)) &&
571 | (identical(other.exceptTop, exceptTop) ||
572 | const DeepCollectionEquality()
573 | .equals(other.exceptTop, exceptTop)) &&
574 | (identical(other.exceptBottom, exceptBottom) ||
575 | const DeepCollectionEquality()
576 | .equals(other.exceptBottom, exceptBottom)));
577 | }
578 |
579 | @override
580 | int get hashCode =>
581 | runtimeType.hashCode ^
582 | const DeepCollectionEquality().hash(all) ^
583 | const DeepCollectionEquality().hash(horizontal) ^
584 | const DeepCollectionEquality().hash(vertical) ^
585 | const DeepCollectionEquality().hash(onlyRight) ^
586 | const DeepCollectionEquality().hash(onlyTop) ^
587 | const DeepCollectionEquality().hash(onlyBottom) ^
588 | const DeepCollectionEquality().hash(onlyLeft) ^
589 | const DeepCollectionEquality().hash(exceptLeft) ^
590 | const DeepCollectionEquality().hash(exceptRight) ^
591 | const DeepCollectionEquality().hash(exceptTop) ^
592 | const DeepCollectionEquality().hash(exceptBottom);
593 |
594 | @JsonKey(ignore: true)
595 | @override
596 | _$SpacingInsetsDataCopyWith<_SpacingInsetsData> get copyWith =>
597 | __$SpacingInsetsDataCopyWithImpl<_SpacingInsetsData>(this, _$identity);
598 | }
599 |
600 | abstract class _SpacingInsetsData implements SpacingInsetsData {
601 | const factory _SpacingInsetsData(
602 | {required SizeSet all,
603 | required SizeSet horizontal,
604 | required SizeSet vertical,
605 | required SizeSet onlyRight,
606 | required SizeSet onlyTop,
607 | required SizeSet onlyBottom,
608 | required SizeSet onlyLeft,
609 | required SizeSet exceptLeft,
610 | required SizeSet exceptRight,
611 | required SizeSet exceptTop,
612 | required SizeSet exceptBottom}) = _$_SpacingInsetsData;
613 |
614 | @override
615 | SizeSet get all => throw _privateConstructorUsedError;
616 | @override
617 | SizeSet get horizontal => throw _privateConstructorUsedError;
618 | @override
619 | SizeSet get vertical => throw _privateConstructorUsedError;
620 | @override
621 | SizeSet get onlyRight => throw _privateConstructorUsedError;
622 | @override
623 | SizeSet get onlyTop => throw _privateConstructorUsedError;
624 | @override
625 | SizeSet get onlyBottom => throw _privateConstructorUsedError;
626 | @override
627 | SizeSet get onlyLeft => throw _privateConstructorUsedError;
628 | @override
629 | SizeSet get exceptLeft => throw _privateConstructorUsedError;
630 | @override
631 | SizeSet get exceptRight => throw _privateConstructorUsedError;
632 | @override
633 | SizeSet get exceptTop => throw _privateConstructorUsedError;
634 | @override
635 | SizeSet get exceptBottom => throw _privateConstructorUsedError;
636 | @override
637 | @JsonKey(ignore: true)
638 | _$SpacingInsetsDataCopyWith<_SpacingInsetsData> get copyWith =>
639 | throw _privateConstructorUsedError;
640 | }
641 |
642 | /// @nodoc
643 | class _$SizeSetTearOff {
644 | const _$SizeSetTearOff();
645 |
646 | _SizeSet call(
647 | {required T extraSmall,
648 | required T small,
649 | required T semiSmall,
650 | required T normal,
651 | required T semiBig,
652 | required T big,
653 | required T extraBig}) {
654 | return _SizeSet(
655 | extraSmall: extraSmall,
656 | small: small,
657 | semiSmall: semiSmall,
658 | normal: normal,
659 | semiBig: semiBig,
660 | big: big,
661 | extraBig: extraBig,
662 | );
663 | }
664 | }
665 |
666 | /// @nodoc
667 | const $SizeSet = _$SizeSetTearOff();
668 |
669 | /// @nodoc
670 | mixin _$SizeSet {
671 | T get extraSmall => throw _privateConstructorUsedError;
672 | T get small => throw _privateConstructorUsedError;
673 | T get semiSmall => throw _privateConstructorUsedError;
674 | T get normal => throw _privateConstructorUsedError;
675 | T get semiBig => throw _privateConstructorUsedError;
676 | T get big => throw _privateConstructorUsedError;
677 | T get extraBig => throw _privateConstructorUsedError;
678 |
679 | @JsonKey(ignore: true)
680 | $SizeSetCopyWith> get copyWith =>
681 | throw _privateConstructorUsedError;
682 | }
683 |
684 | /// @nodoc
685 | abstract class $SizeSetCopyWith {
686 | factory $SizeSetCopyWith(SizeSet value, $Res Function(SizeSet) then) =
687 | _$SizeSetCopyWithImpl;
688 | $Res call(
689 | {T extraSmall,
690 | T small,
691 | T semiSmall,
692 | T normal,
693 | T semiBig,
694 | T big,
695 | T extraBig});
696 | }
697 |
698 | /// @nodoc
699 | class _$SizeSetCopyWithImpl implements $SizeSetCopyWith {
700 | _$SizeSetCopyWithImpl(this._value, this._then);
701 |
702 | final SizeSet