diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index fc1bc54..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,146 +0,0 @@ -## 0.7.0 -### Changed -* Bump minimal Flutter version to 3.7.0 -### Fixed -* Warning with Scrollable.of - -## 0.6.2 -### Fixed -* Issue with Quilted layout algorithm. (https://github.com/letsar/flutter_staggered_grid_view/issues/232) - -## 0.6.1 -### Fixed -* Issue when childCount is 0 with Quilted layout. - -## 0.6.0 -### Added -* SliverAlignedGrid and AlignedGridView widgets. -### Changed -* Renamed SliverMasonryGridDelegate to SliverSimpleGridDelegate. - -## 0.5.1 -### Added -* StaggeredTile.fit constructor. - -## 0.5.0 -### Changed -* Stable release - -## 0.5.0-dev.8 -### Changed -* Make the `childCount` parameter of `SliverMasonryGrid` constructors, nullable and not required. - -## 0.5.0-dev.7 -### Fixed -* Remove position issue with staired pattern. - -## 0.5.0-dev.6 -### Fixed -* Remove extra space on fixed woven grid. - -## 0.5.0-dev.5 -### Fixed -* Remove extra space on fixed quilted grid (#216). - -## 0.5.0-dev.4 -### Fixed -* Issue with Woven pattern layout flow in second run. - -## 0.5.0-dev.3 -### Fixed -* Issue with Woven pattern and text direction. - -## 0.5.0-dev.2 -### Fixed -* Issue with Quilted pattern. - -## 0.5.0-dev.1 -### Changed -* Complete rewriting of the package. -It comes now with 5 differents grid layouts (Staggered, Masonry, Quilted, Woven, Staired). - -## 0.4.1 -### Changed -* Add option to disable keepAlives - -## 0.4.0 -### Changed -* Stable null safety version - -## 0.4.0-nullsafety.3 -### Fixed -* LateInitializationError: Local `firstIndex` has not been initialized. (https://github.com/letsar/flutter_staggered_grid_view/issues/151) - -## 0.4.0-nullsafety.2 -### Added -* Support for state restoration - -## 0.4.0-nullsafety.1 -### Added -* Null Safety Support - -## 0.3.4 -### Fixed -* KeepAliveBucket logic, should improve performances - -## 0.3.3 -### Added -* Support for state restoration. - -## 0.3.2 -### Fixed -* Flutter version dependency. - -## 0.3.1 -### Fixed -* Static analysis issues. - -## 0.3.0 -### Fixed -* Upgrade to AndroidX and fixes the BoxHitTestResult exception (https://github.com/letsar/flutter_staggered_grid_view/issues/49) - -## 0.2.7 -### Fixed -* Better fix for the bug where items are built only once. - -## 0.2.6 -### Fixed -* Fix a bug where items are built only once. - -## 0.2.5 -### Changed -* Use the new SliverWithKeepAliveWidget. - -## 0.2.4 -### Fixed -* Dart 2.1 mixin support. - -## 0.2.3 -### Fixed -* Fix the rtl support (https://github.com/letsar/flutter_staggered_grid_view/issues/17). - -## 0.2.2 -* Add Dart 2 support. - -## 0.2.1 -* Fix #10 `StatefulWidget.createState must return a subtype of State`. - -## 0.2.0 -* Add a way to let the tile's content to define the tile's extent in the main axis. -* Add `fit` constructor to `StaggeredTile`. - -## 0.1.4 -* Add `countBuilder` and `extendBuilder` constructors to `SliverStaggeredGrid` - -## 0.1.3 -* Remove Flutter SDK constraint - -## 0.1.2 -* Remove update Flutter SDK constraint - -## 0.1.1 -* Fix images in readme -* Add dynamic resizing demo - -## 0.1.0 -* Initial Open Source release \ No newline at end of file diff --git a/docs/images/aligned.png b/docs/images/aligned.png deleted file mode 100644 index 4f69871..0000000 Binary files a/docs/images/aligned.png and /dev/null differ diff --git a/docs/images/aligned_example.png b/docs/images/aligned_example.png deleted file mode 100644 index 54a84b4..0000000 Binary files a/docs/images/aligned_example.png and /dev/null differ diff --git a/docs/images/masonry.png b/docs/images/masonry.png deleted file mode 100644 index da79a4a..0000000 Binary files a/docs/images/masonry.png and /dev/null differ diff --git a/docs/images/masonry_example.png b/docs/images/masonry_example.png deleted file mode 100644 index 6ca30e8..0000000 Binary files a/docs/images/masonry_example.png and /dev/null differ diff --git a/docs/images/quilted.png b/docs/images/quilted.png deleted file mode 100644 index 9e6031e..0000000 Binary files a/docs/images/quilted.png and /dev/null differ diff --git a/docs/images/quilted_example.png b/docs/images/quilted_example.png deleted file mode 100644 index 8263e3a..0000000 Binary files a/docs/images/quilted_example.png and /dev/null differ diff --git a/docs/images/staggered.png b/docs/images/staggered.png deleted file mode 100644 index a50f0d3..0000000 Binary files a/docs/images/staggered.png and /dev/null differ diff --git a/docs/images/staggered_example.png b/docs/images/staggered_example.png deleted file mode 100644 index 044d53b..0000000 Binary files a/docs/images/staggered_example.png and /dev/null differ diff --git a/docs/images/staired.png b/docs/images/staired.png deleted file mode 100644 index 1622356..0000000 Binary files a/docs/images/staired.png and /dev/null differ diff --git a/docs/images/staired_example.png b/docs/images/staired_example.png deleted file mode 100644 index 0b9b246..0000000 Binary files a/docs/images/staired_example.png and /dev/null differ diff --git a/docs/images/woven.png b/docs/images/woven.png deleted file mode 100644 index 9b0e317..0000000 Binary files a/docs/images/woven.png and /dev/null differ diff --git a/docs/images/woven_example.png b/docs/images/woven_example.png deleted file mode 100644 index 1f54301..0000000 Binary files a/docs/images/woven_example.png and /dev/null differ diff --git a/example/README.md b/example/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/examples/.gitignore b/examples/.gitignore deleted file mode 100644 index 0fa6b67..0000000 --- a/examples/.gitignore +++ /dev/null @@ -1,46 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.packages -.pub-cache/ -.pub/ -/build/ - -# Web related -lib/generated_plugin_registrant.dart - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/examples/.metadata b/examples/.metadata deleted file mode 100644 index a5584fc..0000000 --- a/examples/.metadata +++ /dev/null @@ -1,10 +0,0 @@ -# This file tracks properties of this Flutter project. -# Used by Flutter tool to assess capabilities and perform upgrades etc. -# -# This file should be version controlled and should not be manually edited. - -version: - revision: 18116933e77adc82f80866c928266a5b4f1ed645 - channel: stable - -project_type: app diff --git a/examples/README.md b/examples/README.md deleted file mode 100644 index a135626..0000000 --- a/examples/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# example - -A new Flutter project. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -For help getting started with Flutter, view our -[online documentation](https://flutter.dev/docs), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/examples/analysis_options.yaml b/examples/analysis_options.yaml deleted file mode 100644 index 61b6c4d..0000000 --- a/examples/analysis_options.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at - # https://dart-lang.github.io/linter/lints/index.html. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/examples/android/.gitignore b/examples/android/.gitignore deleted file mode 100644 index 6f56801..0000000 --- a/examples/android/.gitignore +++ /dev/null @@ -1,13 +0,0 @@ -gradle-wrapper.jar -/.gradle -/captures/ -/gradlew -/gradlew.bat -/local.properties -GeneratedPluginRegistrant.java - -# Remember to never publicly share your keystore. -# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app -key.properties -**/*.keystore -**/*.jks diff --git a/examples/android/app/build.gradle b/examples/android/app/build.gradle deleted file mode 100644 index 18f276f..0000000 --- a/examples/android/app/build.gradle +++ /dev/null @@ -1,68 +0,0 @@ -def localProperties = new Properties() -def localPropertiesFile = rootProject.file('local.properties') -if (localPropertiesFile.exists()) { - localPropertiesFile.withReader('UTF-8') { reader -> - localProperties.load(reader) - } -} - -def flutterRoot = localProperties.getProperty('flutter.sdk') -if (flutterRoot == null) { - throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") -} - -def flutterVersionCode = localProperties.getProperty('flutter.versionCode') -if (flutterVersionCode == null) { - flutterVersionCode = '1' -} - -def flutterVersionName = localProperties.getProperty('flutter.versionName') -if (flutterVersionName == null) { - flutterVersionName = '1.0' -} - -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - -android { - compileSdkVersion 30 - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - kotlinOptions { - jvmTarget = '1.8' - } - - sourceSets { - main.java.srcDirs += 'src/main/kotlin' - } - - defaultConfig { - // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.example.examples" - minSdkVersion 16 - targetSdkVersion 30 - versionCode flutterVersionCode.toInteger() - versionName flutterVersionName - } - - buildTypes { - release { - // TODO: Add your own signing config for the release build. - // Signing with the debug keys for now, so `flutter run --release` works. - signingConfig signingConfigs.debug - } - } -} - -flutter { - source '../..' -} - -dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" -} diff --git a/examples/android/app/src/debug/AndroidManifest.xml b/examples/android/app/src/debug/AndroidManifest.xml deleted file mode 100644 index 1f203b3..0000000 --- a/examples/android/app/src/debug/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/examples/android/app/src/main/AndroidManifest.xml b/examples/android/app/src/main/AndroidManifest.xml deleted file mode 100644 index 7234537..0000000 --- a/examples/android/app/src/main/AndroidManifest.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/examples/android/app/src/main/kotlin/com/example/examples/MainActivity.kt b/examples/android/app/src/main/kotlin/com/example/examples/MainActivity.kt deleted file mode 100644 index 275b8bf..0000000 --- a/examples/android/app/src/main/kotlin/com/example/examples/MainActivity.kt +++ /dev/null @@ -1,6 +0,0 @@ -package com.example.examples - -import io.flutter.embedding.android.FlutterActivity - -class MainActivity: FlutterActivity() { -} diff --git a/examples/android/app/src/main/res/drawable-v21/launch_background.xml b/examples/android/app/src/main/res/drawable-v21/launch_background.xml deleted file mode 100644 index f74085f..0000000 --- a/examples/android/app/src/main/res/drawable-v21/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/examples/android/app/src/main/res/drawable/launch_background.xml b/examples/android/app/src/main/res/drawable/launch_background.xml deleted file mode 100644 index 304732f..0000000 --- a/examples/android/app/src/main/res/drawable/launch_background.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - diff --git a/examples/android/app/src/main/res/mipmap-hdpi/ic_launcher.png b/examples/android/app/src/main/res/mipmap-hdpi/ic_launcher.png deleted file mode 100644 index db77bb4..0000000 Binary files a/examples/android/app/src/main/res/mipmap-hdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/app/src/main/res/mipmap-mdpi/ic_launcher.png b/examples/android/app/src/main/res/mipmap-mdpi/ic_launcher.png deleted file mode 100644 index 17987b7..0000000 Binary files a/examples/android/app/src/main/res/mipmap-mdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/examples/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png deleted file mode 100644 index 09d4391..0000000 Binary files a/examples/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/examples/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png deleted file mode 100644 index d5f1c8d..0000000 Binary files a/examples/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/examples/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png deleted file mode 100644 index 4d6372e..0000000 Binary files a/examples/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and /dev/null differ diff --git a/examples/android/app/src/main/res/values-night/styles.xml b/examples/android/app/src/main/res/values-night/styles.xml deleted file mode 100644 index 449a9f9..0000000 --- a/examples/android/app/src/main/res/values-night/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/examples/android/app/src/main/res/values/styles.xml b/examples/android/app/src/main/res/values/styles.xml deleted file mode 100644 index d74aa35..0000000 --- a/examples/android/app/src/main/res/values/styles.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - diff --git a/examples/android/app/src/profile/AndroidManifest.xml b/examples/android/app/src/profile/AndroidManifest.xml deleted file mode 100644 index 1f203b3..0000000 --- a/examples/android/app/src/profile/AndroidManifest.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/examples/android/build.gradle b/examples/android/build.gradle deleted file mode 100644 index ed45c65..0000000 --- a/examples/android/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -buildscript { - ext.kotlin_version = '1.3.50' - repositories { - google() - mavenCentral() - } - - dependencies { - classpath 'com.android.tools.build:gradle:4.1.0' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - -allprojects { - repositories { - google() - mavenCentral() - } -} - -rootProject.buildDir = '../build' -subprojects { - project.buildDir = "${rootProject.buildDir}/${project.name}" - project.evaluationDependsOn(':app') -} - -task clean(type: Delete) { - delete rootProject.buildDir -} diff --git a/examples/android/gradle.properties b/examples/android/gradle.properties deleted file mode 100644 index 94adc3a..0000000 --- a/examples/android/gradle.properties +++ /dev/null @@ -1,3 +0,0 @@ -org.gradle.jvmargs=-Xmx1536M -android.useAndroidX=true -android.enableJetifier=true diff --git a/examples/android/gradle/wrapper/gradle-wrapper.properties b/examples/android/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index bc6a58a..0000000 --- a/examples/android/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Fri Jun 23 08:50:38 CEST 2017 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip diff --git a/examples/android/settings.gradle b/examples/android/settings.gradle deleted file mode 100644 index 44e62bc..0000000 --- a/examples/android/settings.gradle +++ /dev/null @@ -1,11 +0,0 @@ -include ':app' - -def localPropertiesFile = new File(rootProject.projectDir, "local.properties") -def properties = new Properties() - -assert localPropertiesFile.exists() -localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) } - -def flutterSdkPath = properties.getProperty("flutter.sdk") -assert flutterSdkPath != null, "flutter.sdk not set in local.properties" -apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle" diff --git a/examples/assets/aligned.png b/examples/assets/aligned.png deleted file mode 100644 index 4f69871..0000000 Binary files a/examples/assets/aligned.png and /dev/null differ diff --git a/examples/assets/masonry.png b/examples/assets/masonry.png deleted file mode 100644 index da79a4a..0000000 Binary files a/examples/assets/masonry.png and /dev/null differ diff --git a/examples/assets/quilted.png b/examples/assets/quilted.png deleted file mode 100644 index 9e6031e..0000000 Binary files a/examples/assets/quilted.png and /dev/null differ diff --git a/examples/assets/staggered.png b/examples/assets/staggered.png deleted file mode 100644 index a50f0d3..0000000 Binary files a/examples/assets/staggered.png and /dev/null differ diff --git a/examples/assets/staired.png b/examples/assets/staired.png deleted file mode 100644 index 1622356..0000000 Binary files a/examples/assets/staired.png and /dev/null differ diff --git a/examples/assets/woven.png b/examples/assets/woven.png deleted file mode 100644 index 9b0e317..0000000 Binary files a/examples/assets/woven.png and /dev/null differ diff --git a/examples/ios/.gitignore b/examples/ios/.gitignore deleted file mode 100644 index 7a7f987..0000000 --- a/examples/ios/.gitignore +++ /dev/null @@ -1,34 +0,0 @@ -**/dgph -*.mode1v3 -*.mode2v3 -*.moved-aside -*.pbxuser -*.perspectivev3 -**/*sync/ -.sconsign.dblite -.tags* -**/.vagrant/ -**/DerivedData/ -Icon? -**/Pods/ -**/.symlinks/ -profile -xcuserdata -**/.generated/ -Flutter/App.framework -Flutter/Flutter.framework -Flutter/Flutter.podspec -Flutter/Generated.xcconfig -Flutter/ephemeral/ -Flutter/app.flx -Flutter/app.zip -Flutter/flutter_assets/ -Flutter/flutter_export_environment.sh -ServiceDefinitions.json -Runner/GeneratedPluginRegistrant.* - -# Exceptions to above rules. -!default.mode1v3 -!default.mode2v3 -!default.pbxuser -!default.perspectivev3 diff --git a/examples/ios/Flutter/AppFrameworkInfo.plist b/examples/ios/Flutter/AppFrameworkInfo.plist deleted file mode 100644 index 9625e10..0000000 --- a/examples/ios/Flutter/AppFrameworkInfo.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - App - CFBundleIdentifier - io.flutter.flutter.app - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - App - CFBundlePackageType - FMWK - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1.0 - MinimumOSVersion - 11.0 - - diff --git a/examples/ios/Flutter/Debug.xcconfig b/examples/ios/Flutter/Debug.xcconfig deleted file mode 100644 index 592ceee..0000000 --- a/examples/ios/Flutter/Debug.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/examples/ios/Flutter/Release.xcconfig b/examples/ios/Flutter/Release.xcconfig deleted file mode 100644 index 592ceee..0000000 --- a/examples/ios/Flutter/Release.xcconfig +++ /dev/null @@ -1 +0,0 @@ -#include "Generated.xcconfig" diff --git a/examples/ios/Runner.xcodeproj/project.pbxproj b/examples/ios/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index c61babf..0000000 --- a/examples/ios/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,474 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 54; - objects = { - -/* Begin PBXBuildFile section */ - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; -/* End PBXBuildFile section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 9705A1C41CF9048500538489 /* Embed Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Embed Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; - 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; - 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; - 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; - 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; - 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 97C146EB1CF9000F007C117D /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 9740EEB11CF90186004384FC /* Flutter */ = { - isa = PBXGroup; - children = ( - 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 9740EEB31CF90195004384FC /* Generated.xcconfig */, - ); - name = Flutter; - sourceTree = ""; - }; - 97C146E51CF9000F007C117D = { - isa = PBXGroup; - children = ( - 9740EEB11CF90186004384FC /* Flutter */, - 97C146F01CF9000F007C117D /* Runner */, - 97C146EF1CF9000F007C117D /* Products */, - ); - sourceTree = ""; - }; - 97C146EF1CF9000F007C117D /* Products */ = { - isa = PBXGroup; - children = ( - 97C146EE1CF9000F007C117D /* Runner.app */, - ); - name = Products; - sourceTree = ""; - }; - 97C146F01CF9000F007C117D /* Runner */ = { - isa = PBXGroup; - children = ( - 97C146FA1CF9000F007C117D /* Main.storyboard */, - 97C146FD1CF9000F007C117D /* Assets.xcassets */, - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, - 97C147021CF9000F007C117D /* Info.plist */, - 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, - 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, - 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, - 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, - ); - path = Runner; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 97C146ED1CF9000F007C117D /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 9740EEB61CF901F6004384FC /* Run Script */, - 97C146EA1CF9000F007C117D /* Sources */, - 97C146EB1CF9000F007C117D /* Frameworks */, - 97C146EC1CF9000F007C117D /* Resources */, - 9705A1C41CF9048500538489 /* Embed Frameworks */, - 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = Runner; - productName = Runner; - productReference = 97C146EE1CF9000F007C117D /* Runner.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 97C146E61CF9000F007C117D /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1300; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 97C146ED1CF9000F007C117D = { - CreatedOnToolsVersion = 7.3.1; - LastSwiftMigration = 1100; - }; - }; - }; - buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 97C146E51CF9000F007C117D; - productRefGroup = 97C146EF1CF9000F007C117D /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 97C146ED1CF9000F007C117D /* Runner */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 97C146EC1CF9000F007C117D /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, - 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, - 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, - 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", - ); - name = "Thin Binary"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; - }; - 9740EEB61CF901F6004384FC /* Run Script */ = { - isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Run Script"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 97C146EA1CF9000F007C117D /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, - 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXVariantGroup section */ - 97C146FA1CF9000F007C117D /* Main.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C146FB1CF9000F007C117D /* Base */, - ); - name = Main.storyboard; - sourceTree = ""; - }; - 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 97C147001CF9000F007C117D /* Base */, - ); - name = LaunchScreen.storyboard; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 249021D3217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Profile; - }; - 249021D4217E4FDB00AE95B9 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.example.examples; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Profile; - }; - 97C147031CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 97C147041CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SUPPORTED_PLATFORMS = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - }; - name = Release; - }; - 97C147061CF9000F007C117D /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.example.examples; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Debug; - }; - 97C147071CF9000F007C117D /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - ENABLE_BITCODE = NO; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = com.example.examples; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; - SWIFT_VERSION = 5.0; - VERSIONING_SYSTEM = "apple-generic"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147031CF9000F007C117D /* Debug */, - 97C147041CF9000F007C117D /* Release */, - 249021D3217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 97C147061CF9000F007C117D /* Debug */, - 97C147071CF9000F007C117D /* Release */, - 249021D4217E4FDB00AE95B9 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 97C146E61CF9000F007C117D /* Project object */; -} diff --git a/examples/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/examples/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/examples/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/examples/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/examples/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/examples/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/examples/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/examples/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/examples/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index 3db53b6..0000000 --- a/examples/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,91 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/ios/Runner.xcworkspace/contents.xcworkspacedata b/examples/ios/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a1..0000000 --- a/examples/ios/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/examples/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/examples/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/examples/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index f9b0d7c..0000000 --- a/examples/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - PreviewsEnabled - - - diff --git a/examples/ios/Runner/AppDelegate.swift b/examples/ios/Runner/AppDelegate.swift deleted file mode 100644 index 70693e4..0000000 --- a/examples/ios/Runner/AppDelegate.swift +++ /dev/null @@ -1,13 +0,0 @@ -import UIKit -import Flutter - -@UIApplicationMain -@objc class AppDelegate: FlutterAppDelegate { - override func application( - _ application: UIApplication, - didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? - ) -> Bool { - GeneratedPluginRegistrant.register(with: self) - return super.application(application, didFinishLaunchingWithOptions: launchOptions) - } -} diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index d36b1fa..0000000 --- a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "images" : [ - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "20x20", - "idiom" : "iphone", - "filename" : "Icon-App-20x20@3x.png", - "scale" : "3x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "iphone", - "filename" : "Icon-App-29x29@3x.png", - "scale" : "3x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "iphone", - "filename" : "Icon-App-40x40@3x.png", - "scale" : "3x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@2x.png", - "scale" : "2x" - }, - { - "size" : "60x60", - "idiom" : "iphone", - "filename" : "Icon-App-60x60@3x.png", - "scale" : "3x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@1x.png", - "scale" : "1x" - }, - { - "size" : "20x20", - "idiom" : "ipad", - "filename" : "Icon-App-20x20@2x.png", - "scale" : "2x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@1x.png", - "scale" : "1x" - }, - { - "size" : "29x29", - "idiom" : "ipad", - "filename" : "Icon-App-29x29@2x.png", - "scale" : "2x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@1x.png", - "scale" : "1x" - }, - { - "size" : "40x40", - "idiom" : "ipad", - "filename" : "Icon-App-40x40@2x.png", - "scale" : "2x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@1x.png", - "scale" : "1x" - }, - { - "size" : "76x76", - "idiom" : "ipad", - "filename" : "Icon-App-76x76@2x.png", - "scale" : "2x" - }, - { - "size" : "83.5x83.5", - "idiom" : "ipad", - "filename" : "Icon-App-83.5x83.5@2x.png", - "scale" : "2x" - }, - { - "size" : "1024x1024", - "idiom" : "ios-marketing", - "filename" : "Icon-App-1024x1024@1x.png", - "scale" : "1x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png deleted file mode 100644 index dc9ada4..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png deleted file mode 100644 index 28c6bf0..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png deleted file mode 100644 index f091b6b..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png deleted file mode 100644 index 4cde121..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png deleted file mode 100644 index d0ef06e..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png deleted file mode 100644 index dcdc230..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png deleted file mode 100644 index 2ccbfd9..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png deleted file mode 100644 index c8f9ed8..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png deleted file mode 100644 index a6d6b86..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png deleted file mode 100644 index 75b2d16..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png deleted file mode 100644 index c4df70d..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png deleted file mode 100644 index 6a84f41..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png b/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png deleted file mode 100644 index d0e1f58..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json b/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json deleted file mode 100644 index 0bedcf2..0000000 --- a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "images" : [ - { - "idiom" : "universal", - "filename" : "LaunchImage.png", - "scale" : "1x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@2x.png", - "scale" : "2x" - }, - { - "idiom" : "universal", - "filename" : "LaunchImage@3x.png", - "scale" : "3x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png b/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png b/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png b/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png deleted file mode 100644 index 9da19ea..0000000 Binary files a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png and /dev/null differ diff --git a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md b/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md deleted file mode 100644 index 89c2725..0000000 --- a/examples/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Launch Screen Assets - -You can customize the launch screen with your own desired assets by replacing the image files in this directory. - -You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. \ No newline at end of file diff --git a/examples/ios/Runner/Base.lproj/LaunchScreen.storyboard b/examples/ios/Runner/Base.lproj/LaunchScreen.storyboard deleted file mode 100644 index f2e259c..0000000 --- a/examples/ios/Runner/Base.lproj/LaunchScreen.storyboard +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/ios/Runner/Base.lproj/Main.storyboard b/examples/ios/Runner/Base.lproj/Main.storyboard deleted file mode 100644 index f3c2851..0000000 --- a/examples/ios/Runner/Base.lproj/Main.storyboard +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/ios/Runner/Info.plist b/examples/ios/Runner/Info.plist deleted file mode 100644 index aad4194..0000000 --- a/examples/ios/Runner/Info.plist +++ /dev/null @@ -1,49 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - examples - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleSignature - ???? - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSRequiresIPhoneOS - - UILaunchStoryboardName - LaunchScreen - UIMainStoryboardFile - Main - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - CADisableMinimumFrameDurationOnPhone - - UIApplicationSupportsIndirectInputEvents - - - diff --git a/examples/ios/Runner/Runner-Bridging-Header.h b/examples/ios/Runner/Runner-Bridging-Header.h deleted file mode 100644 index 308a2a5..0000000 --- a/examples/ios/Runner/Runner-Bridging-Header.h +++ /dev/null @@ -1 +0,0 @@ -#import "GeneratedPluginRegistrant.h" diff --git a/examples/lib/common.dart b/examples/lib/common.dart deleted file mode 100644 index a8ef541..0000000 --- a/examples/lib/common.dart +++ /dev/null @@ -1,139 +0,0 @@ -import 'package:flutter/material.dart'; - -const _defaultColor = Color(0xFF34568B); - -class AppScaffold extends StatelessWidget { - const AppScaffold({ - Key? key, - required this.title, - this.topPadding = 0, - required this.child, - }) : super(key: key); - - final String title; - final Widget child; - final double topPadding; - - @override - Widget build(BuildContext context) { - return Scaffold( - appBar: AppBar( - title: Text(title), - ), - body: Padding( - padding: EdgeInsets.only(top: topPadding), - child: child, - ), - ); - } -} - -class Tile extends StatelessWidget { - const Tile({ - Key? key, - required this.index, - this.extent, - this.backgroundColor, - this.bottomSpace, - }) : super(key: key); - - final int index; - final double? extent; - final double? bottomSpace; - final Color? backgroundColor; - - @override - Widget build(BuildContext context) { - final child = Container( - color: backgroundColor ?? _defaultColor, - height: extent, - child: Center( - child: CircleAvatar( - minRadius: 20, - maxRadius: 20, - backgroundColor: Colors.white, - foregroundColor: Colors.black, - child: Text('$index', style: const TextStyle(fontSize: 20)), - ), - ), - ); - - if (bottomSpace == null) { - return child; - } - - return Column( - children: [ - Expanded(child: child), - Container( - height: bottomSpace, - color: Colors.green, - ) - ], - ); - } -} - -class ImageTile extends StatelessWidget { - const ImageTile({ - Key? key, - required this.index, - required this.width, - required this.height, - }) : super(key: key); - - final int index; - final int width; - final int height; - - @override - Widget build(BuildContext context) { - return Image.network( - 'https://picsum.photos/$width/$height?random=$index', - width: width.toDouble(), - height: height.toDouble(), - fit: BoxFit.cover, - ); - } -} - -class InteractiveTile extends StatefulWidget { - const InteractiveTile({ - Key? key, - required this.index, - this.extent, - this.bottomSpace, - }) : super(key: key); - - final int index; - final double? extent; - final double? bottomSpace; - - @override - _InteractiveTileState createState() => _InteractiveTileState(); -} - -class _InteractiveTileState extends State { - Color color = _defaultColor; - - @override - Widget build(BuildContext context) { - return GestureDetector( - onTap: () { - setState(() { - if (color == _defaultColor) { - color = Colors.red; - } else { - color = _defaultColor; - } - }); - }, - child: Tile( - index: widget.index, - extent: widget.extent, - backgroundColor: color, - bottomSpace: widget.bottomSpace, - ), - ); - } -} diff --git a/examples/lib/examples/aligned.dart b/examples/lib/examples/aligned.dart deleted file mode 100644 index 3a6fed6..0000000 --- a/examples/lib/examples/aligned.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class AlignedPage extends StatelessWidget { - const AlignedPage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Aligned', - child: AlignedGridView.count( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - itemBuilder: (context, index) { - return Tile( - index: index, - extent: (index % 7 + 1) * 30, - ); - }, - ), - ); - } -} diff --git a/examples/lib/examples/masonry.dart b/examples/lib/examples/masonry.dart deleted file mode 100644 index 3726218..0000000 --- a/examples/lib/examples/masonry.dart +++ /dev/null @@ -1,28 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class MasonryPage extends StatelessWidget { - const MasonryPage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Masonry', - child: MasonryGridView.count( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - itemBuilder: (context, index) { - return Tile( - index: index, - extent: (index % 5 + 1) * 100, - ); - }, - ), - ); - } -} diff --git a/examples/lib/examples/quilted.dart b/examples/lib/examples/quilted.dart deleted file mode 100644 index a448133..0000000 --- a/examples/lib/examples/quilted.dart +++ /dev/null @@ -1,33 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class QuiltedPage extends StatelessWidget { - const QuiltedPage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Quilted', - child: GridView.custom( - gridDelegate: SliverQuiltedGridDelegate( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.inverted, - pattern: const [ - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 2), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ); - } -} diff --git a/examples/lib/examples/staggered.dart b/examples/lib/examples/staggered.dart deleted file mode 100644 index 8cded28..0000000 --- a/examples/lib/examples/staggered.dart +++ /dev/null @@ -1,50 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class StaggeredPage extends StatelessWidget { - const StaggeredPage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Staggered', - child: SingleChildScrollView( - child: StaggeredGrid.count( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - children: const [ - StaggeredGridTile.count( - crossAxisCellCount: 2, - mainAxisCellCount: 2, - child: Tile(index: 0), - ), - StaggeredGridTile.count( - crossAxisCellCount: 2, - mainAxisCellCount: 1, - child: Tile(index: 1), - ), - StaggeredGridTile.count( - crossAxisCellCount: 1, - mainAxisCellCount: 1, - child: Tile(index: 2), - ), - StaggeredGridTile.count( - crossAxisCellCount: 1, - mainAxisCellCount: 1, - child: Tile(index: 3), - ), - StaggeredGridTile.count( - crossAxisCellCount: 4, - mainAxisCellCount: 2, - child: Tile(index: 4), - ), - ], - ), - ), - ); - } -} diff --git a/examples/lib/examples/staired.dart b/examples/lib/examples/staired.dart deleted file mode 100644 index dd2662a..0000000 --- a/examples/lib/examples/staired.dart +++ /dev/null @@ -1,31 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class StairedPage extends StatelessWidget { - const StairedPage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Staired', - child: GridView.custom( - gridDelegate: SliverStairedGridDelegate( - crossAxisSpacing: 48, - mainAxisSpacing: 24, - startCrossAxisDirectionReversed: true, - pattern: const [ - StairedGridTile(0.5, 1), - StairedGridTile(0.5, 3 / 4), - StairedGridTile(1.0, 10 / 4), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ); - } -} diff --git a/examples/lib/examples/woven.dart b/examples/lib/examples/woven.dart deleted file mode 100644 index b025201..0000000 --- a/examples/lib/examples/woven.dart +++ /dev/null @@ -1,34 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class WovenPage extends StatelessWidget { - const WovenPage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Woven', - child: GridView.custom( - gridDelegate: SliverWovenGridDelegate.count( - crossAxisCount: 2, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - pattern: const [ - WovenGridTile(1), - WovenGridTile( - 5 / 7, - crossAxisRatio: 0.9, - alignment: AlignmentDirectional.centerEnd, - ), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ); - } -} diff --git a/examples/lib/main.dart b/examples/lib/main.dart deleted file mode 100644 index 18675b2..0000000 --- a/examples/lib/main.dart +++ /dev/null @@ -1,137 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:examples/pages/aligned.dart'; -import 'package:examples/pages/masonry.dart'; -import 'package:examples/pages/quilted.dart'; -import 'package:examples/pages/staggered.dart'; -import 'package:examples/pages/staired.dart'; -import 'package:examples/pages/woven.dart'; -import 'package:flutter/material.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Staggered Grid View Demo', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: const HomePage(), - ); - } -} - -class HomePage extends StatelessWidget { - const HomePage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Staggered Grid View Demo', - child: GridView( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 16, - crossAxisSpacing: 16, - ), - children: const [ - MenuEntry( - title: 'Staggered', - imageName: 'staggered', - destination: StaggeredPage(), - ), - MenuEntry( - title: 'Masonry', - imageName: 'masonry', - destination: MasonryPage(), - ), - MenuEntry( - title: 'Quilted', - imageName: 'quilted', - destination: QuiltedPage(), - ), - MenuEntry( - title: 'Woven', - imageName: 'woven', - destination: WovenPage(), - ), - MenuEntry( - title: 'Staired', - imageName: 'staired', - destination: StairedPage(), - ), - MenuEntry( - title: 'Aligned', - imageName: 'aligned', - destination: AlignedPage(), - ), - ], - ), - ); - } -} - -class MenuEntry extends StatelessWidget { - const MenuEntry({ - Key? key, - required this.title, - required this.imageName, - required this.destination, - }) : super(key: key); - - final String title; - final Widget destination; - final String imageName; - - @override - Widget build(BuildContext context) { - return Card( - elevation: 4, - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => destination, - ), - ); - }, - child: Stack( - children: [ - Image.asset( - 'assets/$imageName.png', - fit: BoxFit.fill, - ), - Positioned.fill( - child: FractionallySizedBox( - heightFactor: 0.25, - alignment: Alignment.bottomCenter, - child: ColoredBox( - color: Colors.black.withOpacity(0.75), - child: Center( - child: Text( - title, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.center, - style: Theme.of(context) - .textTheme - .headline6! - .copyWith(color: Colors.white), - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/examples/lib/main_examples.dart b/examples/lib/main_examples.dart deleted file mode 100644 index 5cfb2d7..0000000 --- a/examples/lib/main_examples.dart +++ /dev/null @@ -1,137 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:examples/examples/aligned.dart'; -import 'package:examples/examples/masonry.dart'; -import 'package:examples/examples/quilted.dart'; -import 'package:examples/examples/staggered.dart'; -import 'package:examples/examples/staired.dart'; -import 'package:examples/examples/woven.dart'; -import 'package:flutter/material.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); - - @override - Widget build(BuildContext context) { - return MaterialApp( - title: 'Staggered Grid View Demo', - theme: ThemeData( - primarySwatch: Colors.blue, - ), - home: const HomePage(), - ); - } -} - -class HomePage extends StatelessWidget { - const HomePage({ - Key? key, - }) : super(key: key); - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Staggered Grid View Demo', - child: GridView( - gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount( - crossAxisCount: 2, - mainAxisSpacing: 16, - crossAxisSpacing: 16, - ), - children: const [ - MenuEntry( - title: 'Staggered', - imageName: 'staggered', - destination: StaggeredPage(), - ), - MenuEntry( - title: 'Masonry', - imageName: 'masonry', - destination: MasonryPage(), - ), - MenuEntry( - title: 'Quilted', - imageName: 'quilted', - destination: QuiltedPage(), - ), - MenuEntry( - title: 'Woven', - imageName: 'woven', - destination: WovenPage(), - ), - MenuEntry( - title: 'Staired', - imageName: 'staired', - destination: StairedPage(), - ), - MenuEntry( - title: 'Aligned', - imageName: 'aligned', - destination: AlignedPage(), - ), - ], - ), - ); - } -} - -class MenuEntry extends StatelessWidget { - const MenuEntry({ - Key? key, - required this.title, - required this.imageName, - required this.destination, - }) : super(key: key); - - final String title; - final Widget destination; - final String imageName; - - @override - Widget build(BuildContext context) { - return Card( - elevation: 4, - child: InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => destination, - ), - ); - }, - child: Stack( - children: [ - Image.asset( - 'assets/$imageName.png', - fit: BoxFit.cover, - ), - Positioned.fill( - child: FractionallySizedBox( - heightFactor: 0.25, - alignment: Alignment.bottomCenter, - child: ColoredBox( - color: Colors.black.withOpacity(0.75), - child: Center( - child: Text( - title, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.center, - style: Theme.of(context) - .textTheme - .headline6! - .copyWith(color: Colors.white), - ), - ), - ), - ), - ), - ], - ), - ), - ); - } -} diff --git a/examples/lib/pages/aligned.dart b/examples/lib/pages/aligned.dart deleted file mode 100644 index 595badf..0000000 --- a/examples/lib/pages/aligned.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'dart:math'; - -import 'package:examples/common.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class AlignedPage extends StatefulWidget { - const AlignedPage({ - Key? key, - }) : super(key: key); - - @override - State createState() => _AlignedPageState(); -} - -class _AlignedPageState extends State { - final rnd = Random(); - late List extents; - int crossAxisCount = 4; - - @override - void initState() { - super.initState(); - extents = List.generate(10000, (int index) => rnd.nextInt(7) + 1); - } - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Aligned', - child: AlignedGridView.count( - crossAxisCount: crossAxisCount, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - itemBuilder: (context, index) { - final height = extents[index] * 40; - return ImageTile( - index: index, - width: 100, - height: height, - ); - }, - itemCount: extents.length, - ), - ); - } -} diff --git a/examples/lib/pages/masonry.dart b/examples/lib/pages/masonry.dart deleted file mode 100644 index 081a657..0000000 --- a/examples/lib/pages/masonry.dart +++ /dev/null @@ -1,48 +0,0 @@ -import 'dart:math'; - -import 'package:examples/common.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class MasonryPage extends StatefulWidget { - const MasonryPage({ - Key? key, - }) : super(key: key); - - @override - State createState() => _MasonryPageState(); -} - -class _MasonryPageState extends State { - final rnd = Random(); - late List extents; - int crossAxisCount = 4; - - @override - void initState() { - super.initState(); - extents = List.generate(10000, (int index) => rnd.nextInt(5) + 1); - } - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Masonry', - child: MasonryGridView.count( - crossAxisCount: crossAxisCount, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - itemBuilder: (context, index) { - final height = extents[index] * 100; - return ImageTile( - index: index, - width: 100, - height: height, - ); - }, - itemCount: extents.length, - ), - ); - } -} diff --git a/examples/lib/pages/quilted.dart b/examples/lib/pages/quilted.dart deleted file mode 100644 index 00f1ae6..0000000 --- a/examples/lib/pages/quilted.dart +++ /dev/null @@ -1,42 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class QuiltedPage extends StatelessWidget { - const QuiltedPage({ - Key? key, - }) : super(key: key); - - static const pattern = [ - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 2), - ]; - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Quilted', - child: GridView.custom( - gridDelegate: SliverQuiltedGridDelegate( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.inverted, - pattern: pattern, - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) { - final tile = pattern[index % pattern.length]; - return ImageTile( - index: index, - width: tile.crossAxisCount * 100, - height: tile.mainAxisCount * 100, - ); - }, - ), - ), - ); - } -} diff --git a/examples/lib/pages/staggered.dart b/examples/lib/pages/staggered.dart deleted file mode 100644 index f1a3ba2..0000000 --- a/examples/lib/pages/staggered.dart +++ /dev/null @@ -1,56 +0,0 @@ -import 'package:collection/collection.dart'; -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class StaggeredPage extends StatelessWidget { - const StaggeredPage({ - Key? key, - }) : super(key: key); - - static const tiles = [ - GridTile(2, 2), - GridTile(2, 1), - GridTile(1, 2), - GridTile(1, 1), - GridTile(2, 2), - GridTile(1, 2), - GridTile(1, 1), - GridTile(3, 1), - GridTile(1, 1), - GridTile(4, 1), - ]; - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Staggered', - child: SingleChildScrollView( - child: StaggeredGrid.count( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - children: [ - ...tiles.mapIndexed((index, tile) { - return StaggeredGridTile.count( - crossAxisCellCount: tile.crossAxisCount, - mainAxisCellCount: tile.mainAxisCount, - child: ImageTile( - index: index, - width: tile.crossAxisCount * 100, - height: tile.mainAxisCount * 100, - ), - ); - }), - ], - ), - ), - ); - } -} - -class GridTile { - const GridTile(this.crossAxisCount, this.mainAxisCount); - final int crossAxisCount; - final int mainAxisCount; -} diff --git a/examples/lib/pages/staired.dart b/examples/lib/pages/staired.dart deleted file mode 100644 index 954ccc8..0000000 --- a/examples/lib/pages/staired.dart +++ /dev/null @@ -1,44 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class StairedPage extends StatelessWidget { - const StairedPage({ - Key? key, - }) : super(key: key); - - static const pattern = [ - StairedGridTile(0.5, 1), - StairedGridTile(0.5, 3 / 4), - StairedGridTile(1.0, 10 / 4), - ]; - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Staired', - child: Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - scrollDirection: Axis.vertical, - gridDelegate: SliverStairedGridDelegate( - mainAxisSpacing: 24, - crossAxisSpacing: 48, - startCrossAxisDirectionReversed: true, - pattern: pattern, - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) { - final tile = pattern[index % pattern.length]; - return ImageTile( - index: index, - width: (tile.aspectRatio * 200).ceil(), - height: 200, - ); - }, - ), - ), - ), - ); - } -} diff --git a/examples/lib/pages/woven.dart b/examples/lib/pages/woven.dart deleted file mode 100644 index 72977a8..0000000 --- a/examples/lib/pages/woven.dart +++ /dev/null @@ -1,43 +0,0 @@ -import 'package:examples/common.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; - -class WovenPage extends StatelessWidget { - const WovenPage({ - Key? key, - }) : super(key: key); - - static const pattern = [ - WovenGridTile(1), - WovenGridTile( - 5 / 7, - crossAxisRatio: 0.9, - alignment: AlignmentDirectional.centerEnd, - ), - ]; - - @override - Widget build(BuildContext context) { - return AppScaffold( - title: 'Woven', - child: GridView.custom( - gridDelegate: SliverWovenGridDelegate.count( - crossAxisCount: 2, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - pattern: pattern, - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) { - final tile = pattern[index % pattern.length]; - return ImageTile( - index: index, - width: (200 * tile.aspectRatio).ceil(), - height: 200, - ); - }, - ), - ), - ); - } -} diff --git a/examples/macos/.gitignore b/examples/macos/.gitignore deleted file mode 100644 index 746adbb..0000000 --- a/examples/macos/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -# Flutter-related -**/Flutter/ephemeral/ -**/Pods/ - -# Xcode-related -**/dgph -**/xcuserdata/ diff --git a/examples/macos/Runner.xcodeproj/project.pbxproj b/examples/macos/Runner.xcodeproj/project.pbxproj deleted file mode 100644 index e4f2b72..0000000 --- a/examples/macos/Runner.xcodeproj/project.pbxproj +++ /dev/null @@ -1,572 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 51; - objects = { - -/* Begin PBXAggregateTarget section */ - 33CC111A2044C6BA0003C045 /* Flutter Assemble */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */; - buildPhases = ( - 33CC111E2044C6BF0003C045 /* ShellScript */, - ); - dependencies = ( - ); - name = "Flutter Assemble"; - productName = FLX; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */ = {isa = PBXBuildFile; fileRef = 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */; }; - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC10F02044A3C60003C045 /* AppDelegate.swift */; }; - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F22044A3C60003C045 /* Assets.xcassets */; }; - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 33CC10F42044A3C60003C045 /* MainMenu.xib */; }; - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 33CC10E52044A3C60003C045 /* Project object */; - proxyType = 1; - remoteGlobalIDString = 33CC111A2044C6BA0003C045; - remoteInfo = FLX; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 33CC110E2044A8840003C045 /* Bundle Framework */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Bundle Framework"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = ""; }; - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = ""; }; - 33CC10ED2044A3C60003C045 /* examples.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "examples.app"; sourceTree = BUILT_PRODUCTS_DIR; }; - 33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; - 33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = ""; }; - 33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = ""; }; - 33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = ""; }; - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = ""; }; - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = ""; }; - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = ""; }; - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = ""; }; - 33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = ""; }; - 33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = ""; }; - 33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = ""; }; - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = ""; }; - 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 33CC10EA2044A3C60003C045 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 33BA886A226E78AF003329D5 /* Configs */ = { - isa = PBXGroup; - children = ( - 33E5194F232828860026EE4D /* AppInfo.xcconfig */, - 9740EEB21CF90195004384FC /* Debug.xcconfig */, - 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, - 333000ED22D3DE5D00554162 /* Warnings.xcconfig */, - ); - path = Configs; - sourceTree = ""; - }; - 33CC10E42044A3C60003C045 = { - isa = PBXGroup; - children = ( - 33FAB671232836740065AC1E /* Runner */, - 33CEB47122A05771004F2AC0 /* Flutter */, - 33CC10EE2044A3C60003C045 /* Products */, - D73912EC22F37F3D000D13A0 /* Frameworks */, - ); - sourceTree = ""; - }; - 33CC10EE2044A3C60003C045 /* Products */ = { - isa = PBXGroup; - children = ( - 33CC10ED2044A3C60003C045 /* examples.app */, - ); - name = Products; - sourceTree = ""; - }; - 33CC11242044D66E0003C045 /* Resources */ = { - isa = PBXGroup; - children = ( - 33CC10F22044A3C60003C045 /* Assets.xcassets */, - 33CC10F42044A3C60003C045 /* MainMenu.xib */, - 33CC10F72044A3C60003C045 /* Info.plist */, - ); - name = Resources; - path = ..; - sourceTree = ""; - }; - 33CEB47122A05771004F2AC0 /* Flutter */ = { - isa = PBXGroup; - children = ( - 335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */, - 33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */, - 33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */, - 33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */, - ); - path = Flutter; - sourceTree = ""; - }; - 33FAB671232836740065AC1E /* Runner */ = { - isa = PBXGroup; - children = ( - 33CC10F02044A3C60003C045 /* AppDelegate.swift */, - 33CC11122044BFA00003C045 /* MainFlutterWindow.swift */, - 33E51913231747F40026EE4D /* DebugProfile.entitlements */, - 33E51914231749380026EE4D /* Release.entitlements */, - 33CC11242044D66E0003C045 /* Resources */, - 33BA886A226E78AF003329D5 /* Configs */, - ); - path = Runner; - sourceTree = ""; - }; - D73912EC22F37F3D000D13A0 /* Frameworks */ = { - isa = PBXGroup; - children = ( - ); - name = Frameworks; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXNativeTarget section */ - 33CC10EC2044A3C60003C045 /* Runner */ = { - isa = PBXNativeTarget; - buildConfigurationList = 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */; - buildPhases = ( - 33CC10E92044A3C60003C045 /* Sources */, - 33CC10EA2044A3C60003C045 /* Frameworks */, - 33CC10EB2044A3C60003C045 /* Resources */, - 33CC110E2044A8840003C045 /* Bundle Framework */, - 3399D490228B24CF009A79C7 /* ShellScript */, - ); - buildRules = ( - ); - dependencies = ( - 33CC11202044C79F0003C045 /* PBXTargetDependency */, - ); - name = Runner; - productName = Runner; - productReference = 33CC10ED2044A3C60003C045 /* examples.app */; - productType = "com.apple.product-type.application"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 33CC10E52044A3C60003C045 /* Project object */ = { - isa = PBXProject; - attributes = { - LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0930; - ORGANIZATIONNAME = ""; - TargetAttributes = { - 33CC10EC2044A3C60003C045 = { - CreatedOnToolsVersion = 9.2; - LastSwiftMigration = 1100; - ProvisioningStyle = Automatic; - SystemCapabilities = { - com.apple.Sandbox = { - enabled = 1; - }; - }; - }; - 33CC111A2044C6BA0003C045 = { - CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; - }; - }; - }; - buildConfigurationList = 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */; - compatibilityVersion = "Xcode 9.3"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 33CC10E42044A3C60003C045; - productRefGroup = 33CC10EE2044A3C60003C045 /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 33CC10EC2044A3C60003C045 /* Runner */, - 33CC111A2044C6BA0003C045 /* Flutter Assemble */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 33CC10EB2044A3C60003C045 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC10F32044A3C60003C045 /* Assets.xcassets in Resources */, - 33CC10F62044A3C60003C045 /* MainMenu.xib in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3399D490228B24CF009A79C7 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - ); - outputFileListPaths = ( - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "echo \"$PRODUCT_NAME.app\" > \"$PROJECT_DIR\"/Flutter/ephemeral/.app_filename && \"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh embed\n"; - }; - 33CC111E2044C6BF0003C045 /* ShellScript */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - Flutter/ephemeral/FlutterInputs.xcfilelist, - ); - inputPaths = ( - Flutter/ephemeral/tripwire, - ); - outputFileListPaths = ( - Flutter/ephemeral/FlutterOutputs.xcfilelist, - ); - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"$FLUTTER_ROOT\"/packages/flutter_tools/bin/macos_assemble.sh && touch Flutter/ephemeral/tripwire"; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 33CC10E92044A3C60003C045 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 33CC11132044BFA00003C045 /* MainFlutterWindow.swift in Sources */, - 33CC10F12044A3C60003C045 /* AppDelegate.swift in Sources */, - 335BBD1B22A9A15E00E9071D /* GeneratedPluginRegistrant.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 33CC11202044C79F0003C045 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 33CC111A2044C6BA0003C045 /* Flutter Assemble */; - targetProxy = 33CC111F2044C79F0003C045 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 33CC10F42044A3C60003C045 /* MainMenu.xib */ = { - isa = PBXVariantGroup; - children = ( - 33CC10F52044A3C60003C045 /* Base */, - ); - name = MainMenu.xib; - path = Runner; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - 338D0CE9231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Profile; - }; - 338D0CEA231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Profile; - }; - 338D0CEB231458BD00FA5F75 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Profile; - }; - 33CC10F92044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = dwarf; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = macosx; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - }; - name = Debug; - }; - 33CC10FA2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_NONNULL = YES; - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CODE_SIGN_IDENTITY = "-"; - COPY_PHASE_STRIP = NO; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu11; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.11; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = macosx; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - }; - name = Release; - }; - 33CC10FC2044A3C60003C045 /* Debug */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/DebugProfile.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - 33CC10FD2044A3C60003C045 /* Release */ = { - isa = XCBuildConfiguration; - baseConfigurationReference = 33E5194F232828860026EE4D /* AppInfo.xcconfig */; - buildSettings = { - ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; - CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Release.entitlements; - CODE_SIGN_STYLE = Automatic; - COMBINE_HIDPI_IMAGES = YES; - INFOPLIST_FILE = Runner/Info.plist; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/../Frameworks", - ); - PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - 33CC111C2044C6BA0003C045 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Manual; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 33CC111D2044C6BA0003C045 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_STYLE = Automatic; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 33CC10E82044A3C60003C045 /* Build configuration list for PBXProject "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10F92044A3C60003C045 /* Debug */, - 33CC10FA2044A3C60003C045 /* Release */, - 338D0CE9231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC10FB2044A3C60003C045 /* Build configuration list for PBXNativeTarget "Runner" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC10FC2044A3C60003C045 /* Debug */, - 33CC10FD2044A3C60003C045 /* Release */, - 338D0CEA231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 33CC111B2044C6BA0003C045 /* Build configuration list for PBXAggregateTarget "Flutter Assemble" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 33CC111C2044C6BA0003C045 /* Debug */, - 33CC111D2044C6BA0003C045 /* Release */, - 338D0CEB231458BD00FA5F75 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 33CC10E52044A3C60003C045 /* Project object */; -} diff --git a/examples/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/examples/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/examples/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/examples/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme deleted file mode 100644 index d26641c..0000000 --- a/examples/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ /dev/null @@ -1,89 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/macos/Runner.xcworkspace/contents.xcworkspacedata b/examples/macos/Runner.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 1d526a1..0000000 --- a/examples/macos/Runner.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/examples/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/examples/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/examples/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/examples/macos/Runner/AppDelegate.swift b/examples/macos/Runner/AppDelegate.swift deleted file mode 100644 index d53ef64..0000000 --- a/examples/macos/Runner/AppDelegate.swift +++ /dev/null @@ -1,9 +0,0 @@ -import Cocoa -import FlutterMacOS - -@NSApplicationMain -class AppDelegate: FlutterAppDelegate { - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return true - } -} diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json deleted file mode 100644 index a2ec33f..0000000 --- a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +++ /dev/null @@ -1,68 +0,0 @@ -{ - "images" : [ - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_16.png", - "scale" : "1x" - }, - { - "size" : "16x16", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "2x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_32.png", - "scale" : "1x" - }, - { - "size" : "32x32", - "idiom" : "mac", - "filename" : "app_icon_64.png", - "scale" : "2x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_128.png", - "scale" : "1x" - }, - { - "size" : "128x128", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "2x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_256.png", - "scale" : "1x" - }, - { - "size" : "256x256", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "2x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_512.png", - "scale" : "1x" - }, - { - "size" : "512x512", - "idiom" : "mac", - "filename" : "app_icon_1024.png", - "scale" : "2x" - } - ], - "info" : { - "version" : 1, - "author" : "xcode" - } -} diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png deleted file mode 100644 index 3c4935a..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png and /dev/null differ diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png deleted file mode 100644 index ed4cc16..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png and /dev/null differ diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png deleted file mode 100644 index 483be61..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png and /dev/null differ diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png deleted file mode 100644 index bcbf36d..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png and /dev/null differ diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png deleted file mode 100644 index 9c0a652..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png and /dev/null differ diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png deleted file mode 100644 index e71a726..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png and /dev/null differ diff --git a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png b/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png deleted file mode 100644 index 8a31fe2..0000000 Binary files a/examples/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png and /dev/null differ diff --git a/examples/macos/Runner/Base.lproj/MainMenu.xib b/examples/macos/Runner/Base.lproj/MainMenu.xib deleted file mode 100644 index 537341a..0000000 --- a/examples/macos/Runner/Base.lproj/MainMenu.xib +++ /dev/null @@ -1,339 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/examples/macos/Runner/Configs/AppInfo.xcconfig b/examples/macos/Runner/Configs/AppInfo.xcconfig deleted file mode 100644 index a2bc27f..0000000 --- a/examples/macos/Runner/Configs/AppInfo.xcconfig +++ /dev/null @@ -1,14 +0,0 @@ -// Application-level settings for the Runner target. -// -// This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the -// future. If not, the values below would default to using the project name when this becomes a -// 'flutter create' template. - -// The application's name. By default this is also the title of the Flutter window. -PRODUCT_NAME = examples - -// The application's bundle identifier -PRODUCT_BUNDLE_IDENTIFIER = com.example.examples - -// The copyright displayed in application information -PRODUCT_COPYRIGHT = Copyright © 2021 com.example. All rights reserved. diff --git a/examples/macos/Runner/Configs/Debug.xcconfig b/examples/macos/Runner/Configs/Debug.xcconfig deleted file mode 100644 index 36b0fd9..0000000 --- a/examples/macos/Runner/Configs/Debug.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Debug.xcconfig" -#include "Warnings.xcconfig" diff --git a/examples/macos/Runner/Configs/Release.xcconfig b/examples/macos/Runner/Configs/Release.xcconfig deleted file mode 100644 index dff4f49..0000000 --- a/examples/macos/Runner/Configs/Release.xcconfig +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../Flutter/Flutter-Release.xcconfig" -#include "Warnings.xcconfig" diff --git a/examples/macos/Runner/Configs/Warnings.xcconfig b/examples/macos/Runner/Configs/Warnings.xcconfig deleted file mode 100644 index 42bcbf4..0000000 --- a/examples/macos/Runner/Configs/Warnings.xcconfig +++ /dev/null @@ -1,13 +0,0 @@ -WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings -GCC_WARN_UNDECLARED_SELECTOR = YES -CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES -CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE -CLANG_WARN__DUPLICATE_METHOD_MATCH = YES -CLANG_WARN_PRAGMA_PACK = YES -CLANG_WARN_STRICT_PROTOTYPES = YES -CLANG_WARN_COMMA = YES -GCC_WARN_STRICT_SELECTOR_MATCH = YES -CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES -CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES -GCC_WARN_SHADOW = YES -CLANG_WARN_UNREACHABLE_CODE = YES diff --git a/examples/macos/Runner/DebugProfile.entitlements b/examples/macos/Runner/DebugProfile.entitlements deleted file mode 100644 index 08c3ab1..0000000 --- a/examples/macos/Runner/DebugProfile.entitlements +++ /dev/null @@ -1,14 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.cs.allow-jit - - com.apple.security.network.server - - com.apple.security.network.client - - - diff --git a/examples/macos/Runner/Info.plist b/examples/macos/Runner/Info.plist deleted file mode 100644 index 4789daa..0000000 --- a/examples/macos/Runner/Info.plist +++ /dev/null @@ -1,32 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - $(FLUTTER_BUILD_NAME) - CFBundleVersion - $(FLUTTER_BUILD_NUMBER) - LSMinimumSystemVersion - $(MACOSX_DEPLOYMENT_TARGET) - NSHumanReadableCopyright - $(PRODUCT_COPYRIGHT) - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/examples/macos/Runner/MainFlutterWindow.swift b/examples/macos/Runner/MainFlutterWindow.swift deleted file mode 100644 index 2722837..0000000 --- a/examples/macos/Runner/MainFlutterWindow.swift +++ /dev/null @@ -1,15 +0,0 @@ -import Cocoa -import FlutterMacOS - -class MainFlutterWindow: NSWindow { - override func awakeFromNib() { - let flutterViewController = FlutterViewController.init() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - - RegisterGeneratedPlugins(registry: flutterViewController) - - super.awakeFromNib() - } -} diff --git a/examples/macos/Runner/Release.entitlements b/examples/macos/Runner/Release.entitlements deleted file mode 100644 index ee95ab7..0000000 --- a/examples/macos/Runner/Release.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.security.app-sandbox - - com.apple.security.network.client - - - diff --git a/examples/pubspec.yaml b/examples/pubspec.yaml deleted file mode 100644 index e898104..0000000 --- a/examples/pubspec.yaml +++ /dev/null @@ -1,24 +0,0 @@ -name: examples -description: A new Flutter project. -publish_to: 'none' -version: 1.0.0+1 - -environment: - sdk: ">=2.12.0 <3.0.0" - -dependencies: - flutter: - sdk: flutter - cupertino_icons: ^1.0.2 - flutter_lints: any - flutter_staggered_grid_view: - path: ../ - -dev_dependencies: - flutter_test: - sdk: flutter - -flutter: - assets: - - assets/ - uses-material-design: true \ No newline at end of file diff --git a/examples/web/favicon.png b/examples/web/favicon.png deleted file mode 100644 index 8aaa46a..0000000 Binary files a/examples/web/favicon.png and /dev/null differ diff --git a/examples/web/icons/Icon-192.png b/examples/web/icons/Icon-192.png deleted file mode 100644 index b749bfe..0000000 Binary files a/examples/web/icons/Icon-192.png and /dev/null differ diff --git a/examples/web/icons/Icon-512.png b/examples/web/icons/Icon-512.png deleted file mode 100644 index 88cfd48..0000000 Binary files a/examples/web/icons/Icon-512.png and /dev/null differ diff --git a/examples/web/icons/Icon-maskable-192.png b/examples/web/icons/Icon-maskable-192.png deleted file mode 100644 index eb9b4d7..0000000 Binary files a/examples/web/icons/Icon-maskable-192.png and /dev/null differ diff --git a/examples/web/icons/Icon-maskable-512.png b/examples/web/icons/Icon-maskable-512.png deleted file mode 100644 index d69c566..0000000 Binary files a/examples/web/icons/Icon-maskable-512.png and /dev/null differ diff --git a/examples/web/index.html b/examples/web/index.html deleted file mode 100644 index e55fc68..0000000 --- a/examples/web/index.html +++ /dev/null @@ -1,101 +0,0 @@ - - - - - - - - - - - - - - - - - examples - - - - - - - diff --git a/examples/web/manifest.json b/examples/web/manifest.json deleted file mode 100644 index 666919b..0000000 --- a/examples/web/manifest.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "examples", - "short_name": "examples", - "start_url": ".", - "display": "standalone", - "background_color": "#0175C2", - "theme_color": "#0175C2", - "description": "A new Flutter project.", - "orientation": "portrait-primary", - "prefer_related_applications": false, - "icons": [ - { - "src": "icons/Icon-192.png", - "sizes": "192x192", - "type": "image/png" - }, - { - "src": "icons/Icon-512.png", - "sizes": "512x512", - "type": "image/png" - }, - { - "src": "icons/Icon-maskable-192.png", - "sizes": "192x192", - "type": "image/png", - "purpose": "maskable" - }, - { - "src": "icons/Icon-maskable-512.png", - "sizes": "512x512", - "type": "image/png", - "purpose": "maskable" - } - ] -} diff --git a/lib/flutter_staggered_grid_view.dart b/lib/flutter_staggered_grid_view.dart index 924f0d3..0923f7b 100644 --- a/lib/flutter_staggered_grid_view.dart +++ b/lib/flutter_staggered_grid_view.dart @@ -1,13 +1,8 @@ library flutter_staggered_grid_view; -export 'src/layouts/quilted.dart'; -export 'src/layouts/staired.dart'; -export 'src/layouts/woven.dart'; export 'src/rendering/sliver_masonry_grid.dart'; export 'src/rendering/sliver_simple_grid_delegate.dart'; -export 'src/widgets/aligned_grid_view.dart'; export 'src/widgets/masonry_grid_view.dart'; -export 'src/widgets/sliver_aligned_grid.dart'; export 'src/widgets/sliver_masonry_grid.dart'; export 'src/widgets/staggered_grid.dart'; export 'src/widgets/staggered_grid_tile.dart'; diff --git a/lib/src/layouts/quilted.dart b/lib/src/layouts/quilted.dart deleted file mode 100644 index b3f9cdc..0000000 --- a/lib/src/layouts/quilted.dart +++ /dev/null @@ -1,448 +0,0 @@ -import 'dart:math' as math; - -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter_staggered_grid_view/src/foundation/extensions.dart'; - -/// A tile for [SliverQuiltedGridDelegate]. -@immutable -class QuiltedGridTile { - /// Create a [QuiltedGridTile]. - const QuiltedGridTile( - this.mainAxisCount, - this.crossAxisCount, - ) : assert(mainAxisCount > 0), - assert(crossAxisCount > 0); - - /// The number of cells that tile takes in the main axis. - final int mainAxisCount; - - /// The number of cells that tile takes in the cross axis. - final int crossAxisCount; - - @override - String toString() { - return 'QuiltedGridTile($mainAxisCount, $crossAxisCount)'; - } -} - -/// Controls the layout of a quilted grid. -class SliverQuiltedGridDelegate extends SliverGridDelegate { - /// Creates a [SliverQuiltedGridDelegate]. - SliverQuiltedGridDelegate({ - required this.crossAxisCount, - required List pattern, - this.repeatPattern = QuiltedGridRepeatPattern.same, - this.mainAxisSpacing = 0, - this.crossAxisSpacing = 0, - }) : assert(crossAxisCount > 0), - assert(mainAxisSpacing >= 0), - assert(crossAxisSpacing >= 0), - assert(pattern.isNotEmpty), - _pattern = pattern.toPattern(crossAxisCount, repeatPattern); - - /// {@macro fsgv.global.crossAxisCount} - final int crossAxisCount; - - /// Describes how the pattern is repeating. - /// - /// The default value is [QuiltedGridRepeatPattern.same]. - final QuiltedGridRepeatPattern repeatPattern; - - /// {@macro fsgv.global.mainAxisSpacing} - final double mainAxisSpacing; - - /// {@macro fsgv.global.crossAxisSpacing} - final double crossAxisSpacing; - - final _QuiltedTilePattern _pattern; - - @override - _SliverQuiltedGridLayout getLayout(SliverConstraints constraints) { - final crossAxisExtent = constraints.crossAxisExtent; - final cellExtent = (crossAxisExtent + crossAxisSpacing) / crossAxisCount - - crossAxisSpacing; - return _SliverQuiltedGridLayout( - cellExtent: cellExtent, - crossAxisExtent: crossAxisExtent, - crossAxisSpacing: crossAxisSpacing, - mainAxisSpacing: mainAxisSpacing, - pattern: _pattern, - reverseCrossAxis: axisDirectionIsReversed(constraints.crossAxisDirection), - ); - } - - @override - bool shouldRelayout(SliverQuiltedGridDelegate oldDelegate) { - return oldDelegate.crossAxisCount != crossAxisCount || - oldDelegate.mainAxisSpacing != mainAxisSpacing || - oldDelegate.crossAxisSpacing != crossAxisSpacing; - } -} - -class _QuiltedTilePattern { - const _QuiltedTilePattern({ - required this.tiles, - required this.crossAxisIndexes, - required this.mainAxisIndexes, - required this.maxMainAxisCellCounts, - required this.minTileIndexes, - required this.maxTileIndexes, - required this.mainAxisCellCount, - }) : tileCount = tiles.length; - - final List tiles; - final int tileCount; - final List crossAxisIndexes; - final List mainAxisIndexes; - final List maxMainAxisCellCounts; - final List minTileIndexes; - final List maxTileIndexes; - final int mainAxisCellCount; - - /// Gets the cross axis index of the tile at the given [index]. - int crossAxisIndexOf(int index) { - return crossAxisIndexes[index % tileCount]; - } - - /// Gets the main axis index of the tile at the given [index]. - int mainAxisIndexOf(int index) { - return mainAxisIndexes[index % tileCount]; - } - - /// Gets the number of cells in the main axis to fully displayed all the tiles - /// of this pattern if we want to display [count] tiles. - int maxMainAxisCellCountOf(int count) { - return maxMainAxisCellCounts[count % tileCount]; - } - - int getMinTileIndexForMainAxisIndex(int mainAxisIndex) { - return minTileIndexes[mainAxisIndex % mainAxisCellCount]; - } - - int getMaxTileIndexForMainAxisIndex(int mainAxisIndex) { - return maxTileIndexes[mainAxisIndex % mainAxisCellCount]; - } - - QuiltedGridTile tileOf(int index) { - return tiles[index % tileCount]; - } -} - -/// Layout that looks like the Quilted image list in -/// https://material.io/components/image-lists. -class _SliverQuiltedGridLayout extends SliverGridLayout { - const _SliverQuiltedGridLayout({ - required double cellExtent, - required this.crossAxisExtent, - required this.mainAxisSpacing, - required this.crossAxisSpacing, - required this.pattern, - required this.reverseCrossAxis, - }) : assert(cellExtent > 0), - assert(mainAxisSpacing >= 0), - assert(crossAxisSpacing >= 0), - mainAxisStride = cellExtent + mainAxisSpacing, - crossAxisStride = cellExtent + crossAxisSpacing; - - final double crossAxisExtent; - - /// {@macro fsgv.global.mainAxisSpacing} - final double mainAxisSpacing; - - /// {@macro fsgv.global.crossAxisSpacing} - final double crossAxisSpacing; - - final double mainAxisStride; - - final double crossAxisStride; - - final _QuiltedTilePattern pattern; - - /// Whether the children should be placed in the opposite order of increasing - /// coordinates in the cross axis. - /// - /// For example, if the cross axis is horizontal, the children are placed from - /// left to right when [reverseCrossAxis] is false and from right to left when - /// [reverseCrossAxis] is true. - /// - /// Typically set to the return value of [axisDirectionIsReversed] applied to - /// the [SliverConstraints.crossAxisDirection]. - final bool reverseCrossAxis; - - @override - double computeMaxScrollOffset(int childCount) { - // First we compute the number cells occupied in the main axis by the filled - // patterns. - - if (childCount == 0) { - return 0; - } - - final mainAxisCellCountBeforeLastPattern = - (childCount ~/ pattern.tileCount) * pattern.mainAxisCellCount; - - final remainingChildCount = childCount % pattern.tileCount; - - // Then we get the number of main axis cells in the last pattern. - final remainingMainAxisCellCount = remainingChildCount == 0 - ? 0 - : pattern.maxMainAxisCellCountOf(remainingChildCount - 1); - - // We compute the total number of cells in the main axis. - final nbCellsInMainAxis = - mainAxisCellCountBeforeLastPattern + remainingMainAxisCellCount; - - return nbCellsInMainAxis * mainAxisStride - mainAxisSpacing; - } - - @override - SliverGridGeometry getGeometryForChildIndex(int index) { - // First we compute the number cells occupied in the main axis by the filled - // patterns. - final mainAxisCellCountBeforeLastPattern = - (index ~/ pattern.tileCount) * pattern.mainAxisCellCount; - final mainAxisIndex = - mainAxisCellCountBeforeLastPattern + pattern.mainAxisIndexOf(index); - final crossAxisIndex = pattern.crossAxisIndexOf(index); - final tile = pattern.tileOf(index); - - final crossAxisExtent = - tile.crossAxisCount * crossAxisStride - crossAxisSpacing; - - return SliverGridGeometry( - scrollOffset: mainAxisIndex * mainAxisStride, - crossAxisOffset: _getOffsetFromStartInCrossAxis( - crossAxisIndex * crossAxisStride, - crossAxisExtent, - ), - mainAxisExtent: tile.mainAxisCount * mainAxisStride - mainAxisSpacing, - crossAxisExtent: crossAxisExtent, - ); - } - - double _getOffsetFromStartInCrossAxis( - double crossAxisStart, - double childCrossAxisExtent, - ) { - if (reverseCrossAxis) - return crossAxisExtent - crossAxisStart - childCrossAxisExtent; - return crossAxisStart; - } - - @override - int getMinChildIndexForScrollOffset(double scrollOffset) { - final mainAxisIndex = (scrollOffset ~/ mainAxisStride); - final a = (mainAxisIndex ~/ pattern.mainAxisCellCount) * pattern.tileCount; - final result = a + pattern.getMinTileIndexForMainAxisIndex(mainAxisIndex); - return result; - } - - @override - int getMaxChildIndexForScrollOffset(double scrollOffset) { - final mainAxisIndex = (scrollOffset ~/ mainAxisStride); - final a = (mainAxisIndex ~/ pattern.mainAxisCellCount) * pattern.tileCount; - final result = a + pattern.getMaxTileIndexForMainAxisIndex(mainAxisIndex); - return result; - } -} - -/// Defines how a pattern is repeating. -abstract class QuiltedGridRepeatPattern { - /// Abstract const constructor. This constructor enables subclasses to provide - /// const constructors so that they can be used in const expressions. - const QuiltedGridRepeatPattern(); - - /// The same pattern is repeating over and over. - static const QuiltedGridRepeatPattern same = _QuiltedGridRepeatSamePattern(); - - /// Every two blocks, the pattern is inverted (by central inversion). - /// - /// For example, the following pattern: - /// - /// A A C D - /// A A E E - /// - /// Will be inverted to: - /// - /// E E A A - /// D C A A - static const QuiltedGridRepeatPattern inverted = - _QuiltedGridRepeatInvertedPattern(); - - /// Every two blocks, the pattern is mirrored (by axial symmetry). - /// - /// For example, the following pattern: - /// - /// A A C D - /// A A E E - /// - /// Will be mirrored to: - /// - /// A A E E - /// A A C D - static const QuiltedGridRepeatPattern mirrored = - _QuiltedGridRepeatMirroredPattern(); - - /// Returns the indexes in the repeating pattern order. - List repeatedIndexes(List indexes, int crossAxisCount); - - /// Returns the number of tiles in the repeating pattern. - int repeatedTileCount(int tileCount); -} - -class _QuiltedGridRepeatSamePattern extends QuiltedGridRepeatPattern { - const _QuiltedGridRepeatSamePattern(); - - @override - List repeatedIndexes(List indexes, int crossAxisCount) { - return []; - } - - @override - int repeatedTileCount(int tileCount) => 0; -} - -class _QuiltedGridRepeatInvertedPattern extends QuiltedGridRepeatPattern { - const _QuiltedGridRepeatInvertedPattern(); - - @override - List repeatedIndexes(List indexes, int crossAxisCount) { - // We iterate through the indexes in reverse order to get the index of the - // tiles in inversed order. - final result = []; - final added = {}; - for (int i = indexes.length - 1; i >= 0; i--) { - final index = indexes[i]; - if (index != -1 && !added.contains(index)) { - result.add(index); - added.add(index); - } - } - - return result; - } - - @override - int repeatedTileCount(int tileCount) => tileCount; -} - -class _QuiltedGridRepeatMirroredPattern extends QuiltedGridRepeatPattern { - const _QuiltedGridRepeatMirroredPattern(); - - @override - List repeatedIndexes(List indexes, int crossAxisCount) { - // We iterate through the indexes in reverse order to get the index of the - // tiles in inversed order. - final result = []; - final added = {}; - - final mainAxisCount = indexes.length ~/ crossAxisCount; - - for (int i = mainAxisCount - 1; i >= 0; i--) { - for (int j = 0; j < crossAxisCount; j++) { - final index = indexes[i * crossAxisCount + j]; - if (index != -1 && !added.contains(index)) { - result.add(index); - added.add(index); - } - } - } - - return result; - } - - @override - int repeatedTileCount(int tileCount) => tileCount; -} - -extension on List { - _QuiltedTilePattern toPattern( - int crossAxisCount, - QuiltedGridRepeatPattern repeatPattern, - ) { - final tileCount = length + repeatPattern.repeatedTileCount(length); - final minTileIndexes = []; - final maxTileIndexes = []; - final maxMainAxisCellCounts = List.filled(tileCount, 0); - final mainAxisIndexes = List.filled(tileCount, 0); - final crossAxisIndexes = List.filled(tileCount, 0); - // The index of the tile occupied by each cell. - final indexes = {}; - - final offsets = List.generate(crossAxisCount, (index) => 0); - void position( - List tiles, - Map? indexes, - int start, - ) { - for (int i = 0; i < tiles.length; i++) { - final tile = tiles[i]; - final fullIndex = start + i; - final crossAxisIndex = offsets.findSmallestIndexWithMinimumValue(); - final mainAxisIndex = offsets[crossAxisIndex]; - mainAxisIndexes[fullIndex] = mainAxisIndex; - crossAxisIndexes[fullIndex] = crossAxisIndex; - - // We update the offsets. - final tileCrossAxisCount = tile.crossAxisCount; - final tileMainAxisCount = tile.mainAxisCount; - for (int j = 0; j < tileCrossAxisCount; j++) { - offsets[crossAxisIndex + j] += tileMainAxisCount; - - if (indexes != null) { - for (int k = 0; k < tileMainAxisCount; k++) { - final cellIndex = - (crossAxisIndex + j) + (mainAxisIndex + k) * crossAxisCount; - indexes[cellIndex] = i; - } - } - } - - // We update the min and max tile indexes. - for (int j = 0; j < tileMainAxisCount; j++) { - final index = mainAxisIndex + j; - if (minTileIndexes.length == index) { - minTileIndexes.add(fullIndex); - } else { - minTileIndexes[index] = math.min(minTileIndexes[index], fullIndex); - } - if (maxTileIndexes.length == index) { - maxTileIndexes.add(fullIndex); - } else { - maxTileIndexes[index] = math.max(maxTileIndexes[index], fullIndex); - } - } - - maxMainAxisCellCounts[fullIndex] = offsets.reduce(math.max); - } - } - - position(this, indexes, 0); - final indexList = List.filled(indexes.length, -1); - for (final index in indexes.keys) { - indexList[index] = indexes[index]!; - } - final repeatedIndexes = repeatPattern.repeatedIndexes( - indexList, - crossAxisCount, - ); - final tiles = toList(); - if (repeatedIndexes.isNotEmpty) { - final repeatedTiles = - repeatedIndexes.map((index) => this[index]).toList(); - position(repeatedTiles, null, length); - tiles.addAll(repeatedTiles); - } - - return _QuiltedTilePattern( - tiles: tiles, - mainAxisIndexes: mainAxisIndexes, - crossAxisIndexes: crossAxisIndexes, - maxMainAxisCellCounts: maxMainAxisCellCounts, - minTileIndexes: minTileIndexes, - maxTileIndexes: maxTileIndexes, - mainAxisCellCount: offsets.reduce(math.max), - ); - } -} diff --git a/lib/src/layouts/sliver_patterned_grid_delegate.dart b/lib/src/layouts/sliver_patterned_grid_delegate.dart deleted file mode 100644 index d3a9fd4..0000000 --- a/lib/src/layouts/sliver_patterned_grid_delegate.dart +++ /dev/null @@ -1,223 +0,0 @@ -import 'dart:math' as math; - -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; - -/// Represents the geometries of each tile of a pattern. -@immutable -class SliverPatternGridGeometries { - /// Creates a [SliverPatternGridGeometries]. - const SliverPatternGridGeometries({ - required this.tiles, - required this.bounds, - }) : assert(tiles.length == bounds.length); - - /// The visible geometries of each tile. - final List tiles; - - /// The available space of each tile. - final List bounds; -} - -/// Controls the layout of a grid which layout a pattern over and over. -abstract class SliverPatternGridDelegate extends SliverGridDelegate { - const SliverPatternGridDelegate._({ - required this.pattern, - this.mainAxisSpacing = 0, - this.crossAxisSpacing = 0, - this.crossAxisCount, - this.maxCrossAxisExtent, - }) : assert(mainAxisSpacing >= 0), - assert(crossAxisSpacing >= 0), - assert(crossAxisCount == null || crossAxisCount > 0), - assert(maxCrossAxisExtent == null || maxCrossAxisExtent > 0), - assert(crossAxisCount != null || maxCrossAxisExtent != null), - tileCount = pattern.length; - - /// Creates a [SliverPatternGridDelegate] with a [crossAxisCount]. - const SliverPatternGridDelegate.count({ - required List pattern, - required int crossAxisCount, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - }) : this._( - pattern: pattern, - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - crossAxisCount: crossAxisCount, - ); - - /// Creates a [SliverPatternGridDelegate] with a [maxCrossAxisExtent]. - const SliverPatternGridDelegate.extent({ - required List pattern, - required double maxCrossAxisExtent, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - }) : this._( - pattern: pattern, - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - maxCrossAxisExtent: maxCrossAxisExtent, - ); - - /// {@macro fsgv.global.mainAxisSpacing} - final double mainAxisSpacing; - - /// {@macro fsgv.global.crossAxisSpacing} - final double crossAxisSpacing; - - /// The tiles representing the pattern to be repeated. - final List pattern; - - /// The number of tiles in the pattern. - final int tileCount; - - /// {@macro fsgv.global.crossAxisCount} - final int? crossAxisCount; - - /// {@macro fsgv.global.maxCrossAxisExtent} - final double? maxCrossAxisExtent; - - /// Returns the geometries of each tiles in the pattern. - @protected - SliverPatternGridGeometries getGeometries( - SliverConstraints constraints, - int crossAxisCount, - ); - - @override - _SliverPatternGridLayout getLayout(SliverConstraints constraints) { - final crossAxisCount = this.crossAxisCount ?? - (constraints.crossAxisExtent / (maxCrossAxisExtent! + crossAxisSpacing)) - .ceil(); - final geometries = getGeometries(constraints, crossAxisCount); - return _SliverPatternGridLayout( - mainAxisSpacing: mainAxisSpacing, - crossAxisExtent: constraints.crossAxisExtent, - reverseCrossAxis: axisDirectionIsReversed(constraints.crossAxisDirection), - tiles: geometries.tiles, - bounds: geometries.bounds, - ); - } - - @override - bool shouldRelayout(SliverPatternGridDelegate oldDelegate) { - return oldDelegate.pattern != pattern || - oldDelegate.mainAxisSpacing != mainAxisSpacing || - oldDelegate.crossAxisSpacing != crossAxisSpacing; - } -} - -class _SliverPatternGridLayout extends SliverGridLayout { - _SliverPatternGridLayout({ - required this.mainAxisSpacing, - required this.tiles, - required this.bounds, - required this.crossAxisExtent, - this.reverseCrossAxis = false, - }) : tileCount = tiles.length, - patternMainAxisExtent = - bounds.last.trailingScrollOffset + mainAxisSpacing; - - final double mainAxisSpacing; - final double crossAxisExtent; - final bool reverseCrossAxis; - final List tiles; - final List bounds; - final int tileCount; - final double patternMainAxisExtent; - - @override - double computeMaxScrollOffset(int childCount) { - if (childCount == 0) { - return 0; - } - - final lastFilledPatternTrailingScrollOffset = - (childCount ~/ tileCount) * patternMainAxisExtent; - - if (childCount % tileCount == 0) { - return lastFilledPatternTrailingScrollOffset - mainAxisSpacing; - } - - // We have to get the max scroll offset for the track where the tile with - // index, childCount - 1, is. - // TODO(romain): Can be optimized. - final maxIndex = (childCount - 1) % tileCount; - final maxRemainingScrollOffset = tiles - .take(maxIndex + 1) - .map((x) => x.trailingScrollOffset) - .reduce(math.max); - return lastFilledPatternTrailingScrollOffset + maxRemainingScrollOffset; - } - - @override - SliverGridGeometry getGeometryForChildIndex(int index) { - final startMainAxisOffset = (index ~/ tileCount) * patternMainAxisExtent; - final rect = tileRectAt(index); - final realRect = rect.translate(startMainAxisOffset); - - if (reverseCrossAxis) { - return SliverGridGeometry( - scrollOffset: realRect.scrollOffset, - crossAxisOffset: crossAxisExtent - - realRect.crossAxisOffset - - realRect.crossAxisExtent, - mainAxisExtent: realRect.mainAxisExtent, - crossAxisExtent: realRect.crossAxisExtent, - ); - } - - return realRect; - } - - @override - int getMinChildIndexForScrollOffset(double scrollOffset) { - final patternCount = (scrollOffset ~/ patternMainAxisExtent); - final mainAxisOffset = scrollOffset - patternCount * patternMainAxisExtent; - for (int i = 0; i < tileCount; i++) { - if (_isRectVisibleAtMainAxisOffset(bounds[i], mainAxisOffset)) { - return i + patternCount * tileCount; - } - } - - return 0; - } - - @override - int getMaxChildIndexForScrollOffset(double scrollOffset) { - final patternCount = (scrollOffset ~/ patternMainAxisExtent); - - final mainAxisOffset = scrollOffset - patternCount * patternMainAxisExtent; - for (int i = tileCount - 1; i >= 0; i--) { - if (_isRectVisibleAtMainAxisOffset(bounds[i], mainAxisOffset)) { - return i + patternCount * tileCount; - } - } - - return 0; - } - - bool _isRectVisibleAtMainAxisOffset( - SliverGridGeometry rect, - double mainAxisOffset, - ) { - return rect.scrollOffset <= mainAxisOffset && - rect.trailingScrollOffset >= (mainAxisOffset - mainAxisSpacing); - } - - SliverGridGeometry tileRectAt(int index) { - return tiles[index % tileCount]; - } -} - -extension on SliverGridGeometry { - SliverGridGeometry translate(double translation) { - return SliverGridGeometry( - scrollOffset: scrollOffset + translation, - crossAxisOffset: crossAxisOffset, - mainAxisExtent: mainAxisExtent, - crossAxisExtent: crossAxisExtent, - ); - } -} diff --git a/lib/src/layouts/staired.dart b/lib/src/layouts/staired.dart deleted file mode 100644 index 97f78d6..0000000 --- a/lib/src/layouts/staired.dart +++ /dev/null @@ -1,141 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter_staggered_grid_view/src/foundation/constants.dart'; -import 'package:flutter_staggered_grid_view/src/layouts/sliver_patterned_grid_delegate.dart'; - -/// A tile of a staired pattern. -@immutable -class StairedGridTile { - /// Creates a [StairedGridTile]. - const StairedGridTile( - this.crossAxisRatio, - this.aspectRatio, - ) : assert(crossAxisRatio > 0 && crossAxisRatio <= 1), - assert(aspectRatio > 0); - - /// The amount of extent this tile is taking in the cross axis, according to - /// the usable cross axis extent. - /// For exemple if [crossAxisRatio] is 0.5, and the usable cross axis extent - /// is 100. The the tile will have a cross axis extent of 50. - /// - /// Must be between 0 and 1. - final double crossAxisRatio; - - /// The ratio of the cross-axis to the main-axis extent of the tile. - /// - /// Must be greater than 0. - final double aspectRatio; - - @override - String toString() { - return 'StairedGridTile($crossAxisRatio, $aspectRatio)'; - } -} - -/// Controls the layout of tiles in a staired grid. -class SliverStairedGridDelegate - extends SliverPatternGridDelegate { - /// Creates a [SliverStairedGridDelegate]. - const SliverStairedGridDelegate({ - required List pattern, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - this.tileBottomSpace = 0, - this.startCrossAxisDirectionReversed = false, - }) : assert(tileBottomSpace >= 0), - super.count( - pattern: pattern, - crossAxisCount: 1, - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - ); - - /// {@template fsgv.global.tileBottomSpace} - /// The number of logical pixels of the space below each tile. - /// {@endtemplate} - final double tileBottomSpace; - - /// Indicates whether we should start to place the tile in the reverse cross - /// axis direction. - final bool startCrossAxisDirectionReversed; - - @override - SliverPatternGridGeometries getGeometries( - SliverConstraints constraints, - int crossAxisCount, - ) { - final maxCrossAxisExtent = constraints.crossAxisExtent; - final List geometries = List.filled( - pattern.length, - kZeroGeometry, - ); - int i = 0; - double mainAxisOffset = 0; - double crossAxisOffset = - startCrossAxisDirectionReversed ? maxCrossAxisExtent : 0; - bool reversed = startCrossAxisDirectionReversed; - while (i < tileCount) { - int startIndex = i; - double crossAxisRatioSum = 0; - while (crossAxisRatioSum < 1 && i < tileCount) { - crossAxisRatioSum += pattern[i].crossAxisRatio; - i++; - } - if (crossAxisRatioSum > 1) { - // The last ratio is too high. We remove it from this track. - i--; - } - final tileBottomSpaceSum = tileBottomSpace * (i - startIndex); - final isHorizontal = constraints.axis == Axis.horizontal; - final usableCrossAxisExtent = ((startIndex == 0 - ? maxCrossAxisExtent - : maxCrossAxisExtent - crossAxisSpacing) - - (i - startIndex - 1) * crossAxisSpacing - - (i == tileCount ? crossAxisSpacing : 0) - - (isHorizontal ? tileBottomSpaceSum : 0)) - .clamp(0, maxCrossAxisExtent); - - double targetMainAxisOffset = 0; - for (int j = startIndex; j < i; j++) { - final tile = pattern[j]; - final crossAxisExtent = usableCrossAxisExtent * tile.crossAxisRatio + - (isHorizontal ? tileBottomSpace : 0); - final mainAxisExtent = crossAxisExtent / tile.aspectRatio + - (isHorizontal ? 0 : tileBottomSpace); - crossAxisOffset = - reversed ? crossAxisOffset - crossAxisExtent : crossAxisOffset; - final tileRect = SliverGridGeometry( - scrollOffset: mainAxisOffset, - crossAxisOffset: crossAxisOffset, - mainAxisExtent: mainAxisExtent, - crossAxisExtent: crossAxisExtent, - ); - final endMainAxisOffset = mainAxisOffset + mainAxisExtent; - - crossAxisOffset = reversed - ? crossAxisOffset - crossAxisSpacing - : crossAxisOffset + crossAxisExtent + crossAxisSpacing; - mainAxisOffset += mainAxisSpacing; - geometries[j] = tileRect; - if (endMainAxisOffset > targetMainAxisOffset) { - targetMainAxisOffset = endMainAxisOffset; - } - } - - mainAxisOffset = targetMainAxisOffset + mainAxisSpacing; - reversed = !reversed; - crossAxisOffset = - reversed ? maxCrossAxisExtent - crossAxisSpacing : crossAxisSpacing; - } - - return SliverPatternGridGeometries(tiles: geometries, bounds: geometries); - } - - @override - bool shouldRelayout(SliverStairedGridDelegate oldDelegate) { - return super.shouldRelayout(oldDelegate) || - oldDelegate.tileBottomSpace != tileBottomSpace || - oldDelegate.startCrossAxisDirectionReversed != - startCrossAxisDirectionReversed; - } -} diff --git a/lib/src/layouts/woven.dart b/lib/src/layouts/woven.dart deleted file mode 100644 index b55bc45..0000000 --- a/lib/src/layouts/woven.dart +++ /dev/null @@ -1,142 +0,0 @@ -import 'dart:math' as math; - -import 'package:flutter/rendering.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/src/foundation/constants.dart'; -import 'package:flutter_staggered_grid_view/src/layouts/sliver_patterned_grid_delegate.dart'; - -/// A tile of a woven pattern. -@immutable -class WovenGridTile { - /// Creates a [WovenGridTile]. - const WovenGridTile( - this.aspectRatio, { - this.crossAxisRatio = 1, - this.alignment = AlignmentDirectional.center, - }) : assert(aspectRatio > 0), - assert(crossAxisRatio > 0 && crossAxisRatio <= 1); - - /// The ratio of the cross-axis to the main-axis extent of the tile. - /// - /// Must be greater than 0. - final double aspectRatio; - - /// The ratio taken by this tile in the cross-axis. - /// - /// Must be between 0 (exclusive) and 1 (inclusive). - final double crossAxisRatio; - - /// The alignment of the tile within the available space. - final AlignmentDirectional alignment; - - @override - String toString() { - return 'WovenGridTile($aspectRatio${crossAxisRatio > 1 ? ', $crossAxisRatio' : ''}${alignment != AlignmentDirectional.center ? ', $alignment' : ''})'; - } -} - -/// Controls the layout of tiles in a woven grid. -class SliverWovenGridDelegate extends SliverPatternGridDelegate { - /// Creates a [SliverWovenGridDelegate]. - const SliverWovenGridDelegate.count({ - required List pattern, - required int crossAxisCount, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - this.tileBottomSpace = 0, - }) : assert(pattern.length <= crossAxisCount), - super.count( - pattern: pattern, - crossAxisCount: crossAxisCount, - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - ); - - /// Creates a [SliverWovenGridDelegate]. - const SliverWovenGridDelegate.extent({ - required List pattern, - required double maxCrossAxisExtent, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - this.tileBottomSpace = 0, - }) : super.extent( - pattern: pattern, - maxCrossAxisExtent: maxCrossAxisExtent, - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - ); - - /// {@macro fsgv.global.tileBottomSpace} - final double tileBottomSpace; - - @override - SliverPatternGridGeometries getGeometries( - SliverConstraints constraints, - int crossAxisCount, - ) { - final isHorizontal = constraints.axis == Axis.horizontal; - final usableCrossAxisExtent = isHorizontal - ? constraints.crossAxisExtent - crossAxisCount * tileBottomSpace - : constraints.crossAxisExtent; - final crossAxisExtent = - (usableCrossAxisExtent + crossAxisSpacing) / crossAxisCount - - crossAxisSpacing; - final crossAxisStride = crossAxisExtent + crossAxisSpacing; - final patternCount = pattern.length; - // The minimum aspect ratio give us the main axis extent of a track. - final maxMainAxisExtentRatio = - pattern.map((t) => t.crossAxisRatio / t.aspectRatio).reduce(math.max); - final mainAxisExtent = crossAxisExtent * maxMainAxisExtentRatio + - (isHorizontal ? 0 : tileBottomSpace); - - // We always provide 2 tracks where the layout follow this pattern: - // A B A || A B A B || A B C || A B C A - // B A B || B A B A || C B A || B A C B - - final count = crossAxisCount * 2; - final tiles = List.filled(count, kZeroGeometry); - final bounds = List.filled(count, kZeroGeometry); - for (int i = 0; i < count; i++) { - final startScrollOffset = - i < crossAxisCount ? 0.0 : mainAxisExtent + mainAxisSpacing; - final tilePatternIndex = i < crossAxisCount - ? i % patternCount - : (count - 1 - (i % crossAxisCount)) % patternCount; - final tilePattern = pattern[tilePatternIndex]; - final tileCrossAxisExtent = crossAxisExtent * tilePattern.crossAxisRatio + - (isHorizontal ? tileBottomSpace : 0); - final tileMainAxisExtent = tileCrossAxisExtent / tilePattern.aspectRatio + - (isHorizontal ? 0 : tileBottomSpace); - final effectiveTextDirection = - i < crossAxisCount ? TextDirection.ltr : TextDirection.rtl; - final effectiveAlignment = - tilePattern.alignment.resolve(effectiveTextDirection); - final rect = effectiveAlignment.inscribe( - Size(tileCrossAxisExtent, tileMainAxisExtent), - Rect.fromLTWH(0, 0, crossAxisExtent, mainAxisExtent), - ); - final startCrossAxisOffset = (i % crossAxisCount) * crossAxisStride; - tiles[i] = SliverGridGeometry( - scrollOffset: startScrollOffset + rect.top, - crossAxisOffset: startCrossAxisOffset + rect.left, - mainAxisExtent: tileMainAxisExtent, - crossAxisExtent: tileCrossAxisExtent, - ); - bounds[i] = SliverGridGeometry( - scrollOffset: startScrollOffset, - crossAxisOffset: startCrossAxisOffset, - mainAxisExtent: mainAxisExtent, - crossAxisExtent: crossAxisExtent, - ); - } - - return SliverPatternGridGeometries(tiles: tiles, bounds: bounds); - } - - @override - bool shouldRelayout(SliverWovenGridDelegate oldDelegate) { - return super.shouldRelayout(oldDelegate) || - oldDelegate.tileBottomSpace != tileBottomSpace || - oldDelegate.crossAxisCount != crossAxisCount; - } -} diff --git a/lib/src/rendering/sliver_masonry_grid.dart b/lib/src/rendering/sliver_masonry_grid.dart index 189f0bd..7485f93 100644 --- a/lib/src/rendering/sliver_masonry_grid.dart +++ b/lib/src/rendering/sliver_masonry_grid.dart @@ -367,10 +367,14 @@ class RenderSliverMasonryGrid extends RenderSliverMultiBoxAdaptor { RenderBox? child = firstChild; // If a new child is inserted and does not have a valid crossAxisIndex, we - // have to set it. + // have to set it. If we are on begginig of the list also set scrollOffset to 0. if (child != null && indexOf(child) == 0) { final firstChildParentData = _getParentData(child); firstChildParentData.crossAxisIndex = 0; + final secondChild = childAfter(child); + if (secondChild != null && indexOf(secondChild) == 1) { + scrollOffsets.fillRange(0, crossAxisCount, 0); + } } // We populate our earliestScrollOffsets list. diff --git a/lib/src/widgets/aligned_grid_view.dart b/lib/src/widgets/aligned_grid_view.dart deleted file mode 100644 index 5ad81aa..0000000 --- a/lib/src/widgets/aligned_grid_view.dart +++ /dev/null @@ -1,283 +0,0 @@ -import 'package:flutter/gestures.dart'; -import 'package:flutter/material.dart'; -import 'package:flutter_staggered_grid_view/src/rendering/sliver_simple_grid_delegate.dart'; -import 'package:flutter_staggered_grid_view/src/widgets/sliver_aligned_grid.dart'; - -/// A scrollable, 2D array of widgets placed according to the aligned layout. -/// -/// The main axis direction of a grid is the direction in which it scrolls (the -/// [scrollDirection]). -/// -/// The most commonly used grid layouts are [AlignedGridView.count], which -/// creates a layout with a fixed number of tiles in the cross axis, and -/// [AlignedGridView.extent], which creates a layout with tiles that have a -/// maximum cross-axis extent. A custom [SliverSimpleGridDelegate] can produce -/// an arbitrary 2D arrangement of children. -/// -/// To create a linear array of children, use a [ListView]. -/// -/// To control the initial scroll offset of the scroll view, provide a -/// [controller] with its [ScrollController.initialScrollOffset] property set. -/// -/// ## Transitioning to [CustomScrollView] -/// -/// A [AlignedGridView] is basically a [CustomScrollView] with a single -/// [SliverAlignedGrid] in its [CustomScrollView.slivers] property. -/// -/// If [AlignedGridView] is no longer sufficient, for example because the scroll -/// view is to have both a grid and a list, or because the grid is to be -/// combined with a [SliverAppBar], etc, it is straight-forward to port code -/// from using [AlignedGridView] to using [CustomScrollView] directly. -/// -/// The [key], [scrollDirection], [reverse], [controller], [primary], [physics], -/// and [shrinkWrap] properties on [AlignedGridView] map directly to the -/// identically named properties on [CustomScrollView]. -/// -/// The [CustomScrollView.slivers] property should be a list containing just a -/// [SliverAlignedGrid]. -/// -/// The [AlignedGridView.count] and [AlignedGridView.extent] constructors create -/// custom grid delegates, and have equivalently named constructors on -/// [SliverAlignedGrid] to ease the transition: [SliverAlignedGrid.count] and -/// [SliverAlignedGrid.extent] respectively. -/// -/// The [padding] property corresponds to having a [SliverPadding] in the -/// [CustomScrollView.slivers] property instead of the grid itself, and having -/// the [SliverGrid] instead be a child of the [SliverPadding]. -/// -/// Once code has been ported to use [CustomScrollView], other slivers, such as -/// [SliverList] or [SliverAppBar], can be put in the [CustomScrollView.slivers] -/// list. -/// -/// By default, [AlignedGridView] will automatically pad the limits of the -/// grids's scrollable to avoid partial obstructions indicated by -/// [MediaQuery]'s padding. To avoid this behavior, override with a -/// zero [padding] property. -class AlignedGridView extends BoxScrollView { - /// Creates a scrollable, 2D array of widgets with both a custom - /// [SliverSimpleGridDelegate]. - const AlignedGridView.custom({ - Key? key, - Axis scrollDirection = Axis.vertical, - bool reverse = false, - ScrollController? controller, - bool? primary, - ScrollPhysics? physics, - bool shrinkWrap = false, - EdgeInsetsGeometry? padding, - required this.gridDelegate, - required this.itemBuilder, - this.itemCount, - this.addAutomaticKeepAlives = true, - this.addRepaintBoundaries = true, - this.mainAxisSpacing = 0.0, - this.crossAxisSpacing = 0.0, - double? cacheExtent, - int? semanticChildCount, - DragStartBehavior dragStartBehavior = DragStartBehavior.start, - ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = - ScrollViewKeyboardDismissBehavior.manual, - String? restorationId, - Clip clipBehavior = Clip.hardEdge, - }) : super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount, - dragStartBehavior: dragStartBehavior, - keyboardDismissBehavior: keyboardDismissBehavior, - restorationId: restorationId, - clipBehavior: clipBehavior, - ); - - /// Creates a scrollable, 2D array of widgets with a fixed number of tiles in - /// the cross axis. - /// - /// Uses a [SliverSimpleGridDelegateWithFixedCrossAxisCount] as the - /// [gridDelegate]. - /// - /// The `addAutomaticKeepAlives` argument corresponds to the - /// [SliverChildListDelegate.addAutomaticKeepAlives] property. The - /// `addRepaintBoundaries` argument corresponds to the - /// [SliverChildListDelegate.addRepaintBoundaries] property. - /// - /// See also: - /// - /// * [SliverAlignedGrid.count], the equivalent constructor for - /// [SliverAlignedGrid]. - AlignedGridView.count({ - Key? key, - Axis scrollDirection = Axis.vertical, - bool reverse = false, - ScrollController? controller, - bool? primary, - ScrollPhysics? physics, - bool shrinkWrap = false, - EdgeInsetsGeometry? padding, - required int crossAxisCount, - this.mainAxisSpacing = 0.0, - this.crossAxisSpacing = 0.0, - required this.itemBuilder, - this.itemCount, - this.addAutomaticKeepAlives = true, - this.addRepaintBoundaries = true, - double? cacheExtent, - int? semanticChildCount, - DragStartBehavior dragStartBehavior = DragStartBehavior.start, - ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = - ScrollViewKeyboardDismissBehavior.manual, - String? restorationId, - Clip clipBehavior = Clip.hardEdge, - }) : gridDelegate = SliverSimpleGridDelegateWithFixedCrossAxisCount( - crossAxisCount: crossAxisCount, - ), - super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount ?? itemCount, - dragStartBehavior: dragStartBehavior, - keyboardDismissBehavior: keyboardDismissBehavior, - restorationId: restorationId, - clipBehavior: clipBehavior, - ); - - /// Creates a scrollable, 2D array of widgets with tiles that each have a - /// maximum cross-axis extent. - /// - /// Uses a [SliverSimpleGridDelegateWithMaxCrossAxisExtent] as the - /// [gridDelegate]. - /// - /// The `addAutomaticKeepAlives` argument corresponds to the - /// [SliverChildListDelegate.addAutomaticKeepAlives] property. The - /// `addRepaintBoundaries` argument corresponds to the - /// [SliverChildListDelegate.addRepaintBoundaries] property. - /// - /// See also: - /// - /// * [SliverAlignedGrid.extent], the equivalent constructor for - /// [SliverAlignedGrid]. - AlignedGridView.extent({ - Key? key, - Axis scrollDirection = Axis.vertical, - bool reverse = false, - ScrollController? controller, - bool? primary, - ScrollPhysics? physics, - bool shrinkWrap = false, - EdgeInsetsGeometry? padding, - required double maxCrossAxisExtent, - this.mainAxisSpacing = 0.0, - this.crossAxisSpacing = 0.0, - required this.itemBuilder, - this.itemCount, - this.addAutomaticKeepAlives = true, - this.addRepaintBoundaries = true, - double? cacheExtent, - int? semanticChildCount, - DragStartBehavior dragStartBehavior = DragStartBehavior.start, - ScrollViewKeyboardDismissBehavior keyboardDismissBehavior = - ScrollViewKeyboardDismissBehavior.manual, - String? restorationId, - Clip clipBehavior = Clip.hardEdge, - }) : gridDelegate = SliverSimpleGridDelegateWithMaxCrossAxisExtent( - maxCrossAxisExtent: maxCrossAxisExtent, - ), - super( - key: key, - scrollDirection: scrollDirection, - reverse: reverse, - controller: controller, - primary: primary, - physics: physics, - shrinkWrap: shrinkWrap, - padding: padding, - cacheExtent: cacheExtent, - semanticChildCount: semanticChildCount ?? itemCount, - dragStartBehavior: dragStartBehavior, - keyboardDismissBehavior: keyboardDismissBehavior, - restorationId: restorationId, - clipBehavior: clipBehavior, - ); - - /// A delegate that controls the layout of the children within the - /// [AlignedGridView]. - /// - /// The [AlignedGridView.custom] constructor let you specify this delegate - /// explicitly. The other constructors create a [gridDelegate] implicitly. - final SliverSimpleGridDelegate gridDelegate; - - /// {@macro fsgv.global.mainAxisSpacing} - final double mainAxisSpacing; - - /// {@macro fsgv.global.crossAxisSpacing} - final double crossAxisSpacing; - - /// Called to build children for the sliver. - /// - /// Will be called only for indices greater than or equal to zero and less - /// than [itemCount] (if [itemCount] is non-null). - /// - /// Should return null if asked to build a widget with a greater index than - /// exists. - /// - /// The delegate wraps the children returned by this builder in - /// [RepaintBoundary] widgets. - final NullableIndexedWidgetBuilder itemBuilder; - - /// The total number of children this delegate can provide. - /// - /// If null, the number of children is determined by the least index for which - /// [itemBuilder] returns null. - final int? itemCount; - - /// Whether to wrap each child in an [AutomaticKeepAlive]. - /// - /// Typically, children in lazy list are wrapped in [AutomaticKeepAlive] - /// widgets so that children can use [KeepAliveNotification]s to preserve - /// their state when they would otherwise be garbage collected off-screen. - /// - /// This feature (and [addRepaintBoundaries]) must be disabled if the children - /// are going to manually maintain their [KeepAlive] state. It may also be - /// more efficient to disable this feature if it is known ahead of time that - /// none of the children will ever try to keep themselves alive. - /// - /// Defaults to true. - final bool addAutomaticKeepAlives; - - /// Whether to wrap each child in a [RepaintBoundary]. - /// - /// Typically, children in a scrolling container are wrapped in repaint - /// boundaries so that they do not need to be repainted as the list scrolls. - /// If the children are easy to repaint (e.g., solid color blocks or a short - /// snippet of text), it might be more efficient to not add a repaint boundary - /// and simply repaint the children during scrolling. - /// - /// Defaults to true. - final bool addRepaintBoundaries; - - @override - Widget buildChildLayout(BuildContext context) { - return SliverAlignedGrid( - itemBuilder: itemBuilder, - itemCount: itemCount, - gridDelegate: gridDelegate, - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - addAutomaticKeepAlives: addAutomaticKeepAlives, - addRepaintBoundaries: addRepaintBoundaries, - ); - } -} diff --git a/lib/src/widgets/sliver_aligned_grid.dart b/lib/src/widgets/sliver_aligned_grid.dart deleted file mode 100644 index 10eb18a..0000000 --- a/lib/src/widgets/sliver_aligned_grid.dart +++ /dev/null @@ -1,196 +0,0 @@ -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/src/rendering/sliver_simple_grid_delegate.dart'; -import 'package:flutter_staggered_grid_view/src/widgets/uniform_track.dart'; - -/// A sliver that places multiple box children in a two dimensional arrangement. -/// -/// [SliverAlignedGrid] places its children in a grid where each track has the -/// main axis extent of the widest child. Each child is stretched to match the -/// track main axis extent. -class SliverAlignedGrid extends StatelessWidget { - /// Creates a custom [SliverAlignedGrid]. - const SliverAlignedGrid({ - Key? key, - required this.itemBuilder, - this.itemCount, - required this.gridDelegate, - this.mainAxisSpacing = 0, - this.crossAxisSpacing = 0, - this.addAutomaticKeepAlives = true, - this.addRepaintBoundaries = true, - }) : super(key: key); - - /// Creates a sliver that places multiple box children in an aligned - /// arrangement with a fixed number of tiles in the cross axis. - /// - /// The [crossAxisCount], [mainAxisSpacing] and [crossAxisSpacing] arguments - /// must be greater than zero. - SliverAlignedGrid.count({ - Key? key, - required NullableIndexedWidgetBuilder itemBuilder, - int? itemCount, - required int crossAxisCount, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - bool addAutomaticKeepAlives = true, - bool addRepaintBoundaries = true, - }) : this( - key: key, - itemBuilder: itemBuilder, - itemCount: itemCount, - gridDelegate: SliverSimpleGridDelegateWithFixedCrossAxisCount( - crossAxisCount: crossAxisCount, - ), - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - addAutomaticKeepAlives: addAutomaticKeepAlives, - addRepaintBoundaries: addRepaintBoundaries, - ); - - /// Creates a sliver that places multiple box children in an aligned - /// arrangement with tiles that each have a maximum cross-axis extent. - /// - /// The [maxCrossAxisExtent], [mainAxisSpacing] and [crossAxisSpacing] - /// arguments must be greater than zero. - SliverAlignedGrid.extent({ - Key? key, - required NullableIndexedWidgetBuilder itemBuilder, - int? itemCount, - required double maxCrossAxisExtent, - double mainAxisSpacing = 0, - double crossAxisSpacing = 0, - bool addAutomaticKeepAlives = true, - bool addRepaintBoundaries = true, - }) : this( - key: key, - itemBuilder: itemBuilder, - itemCount: itemCount, - gridDelegate: SliverSimpleGridDelegateWithMaxCrossAxisExtent( - maxCrossAxisExtent: maxCrossAxisExtent, - ), - mainAxisSpacing: mainAxisSpacing, - crossAxisSpacing: crossAxisSpacing, - addAutomaticKeepAlives: addAutomaticKeepAlives, - addRepaintBoundaries: addRepaintBoundaries, - ); - - /// {@macro fsgv.global.mainAxisSpacing} - final double mainAxisSpacing; - - /// {@macro fsgv.global.crossAxisSpacing} - final double crossAxisSpacing; - - /// {@macro fsgv.global.gridDelegate} - final SliverSimpleGridDelegate gridDelegate; - - /// Called to build children for the sliver. - /// - /// Will be called only for indices greater than or equal to zero and less - /// than [itemCount] (if [itemCount] is non-null). - /// - /// Should return null if asked to build a widget with a greater index than - /// exists. - /// - /// The delegate wraps the children returned by this builder in - /// [RepaintBoundary] widgets. - final NullableIndexedWidgetBuilder itemBuilder; - - /// The total number of children this delegate can provide. - /// - /// If null, the number of children is determined by the least index for which - /// [itemBuilder] returns null. - final int? itemCount; - - /// Whether to wrap each child in an [AutomaticKeepAlive]. - /// - /// Typically, children in lazy list are wrapped in [AutomaticKeepAlive] - /// widgets so that children can use [KeepAliveNotification]s to preserve - /// their state when they would otherwise be garbage collected off-screen. - /// - /// This feature (and [addRepaintBoundaries]) must be disabled if the children - /// are going to manually maintain their [KeepAlive] state. It may also be - /// more efficient to disable this feature if it is known ahead of time that - /// none of the children will ever try to keep themselves alive. - /// - /// Defaults to true. - final bool addAutomaticKeepAlives; - - /// Whether to wrap each child in a [RepaintBoundary]. - /// - /// Typically, children in a scrolling container are wrapped in repaint - /// boundaries so that they do not need to be repainted as the list scrolls. - /// If the children are easy to repaint (e.g., solid color blocks or a short - /// snippet of text), it might be more efficient to not add a repaint boundary - /// and simply repaint the children during scrolling. - /// - /// Defaults to true. - final bool addRepaintBoundaries; - - @override - Widget build(BuildContext context) { - final localItemCount = itemCount; - return SliverLayoutBuilder( - builder: (context, constraints) { - final crossAxisCount = gridDelegate.getCrossAxisCount( - constraints, - crossAxisSpacing, - ); - final listItemCount = localItemCount == null - ? null - : ((localItemCount + crossAxisCount - 1) ~/ crossAxisCount) * 2 - 1; - return SliverList( - delegate: SliverChildBuilderDelegate( - (context, index) { - if (index.isOdd) { - return _Gap(mainAxisExtent: mainAxisSpacing); - } - - final startIndex = (index ~/ 2) * crossAxisCount; - final children = [ - for (int i = 0; i < crossAxisCount; i++) - _buildItem(context, startIndex + i, itemCount), - ].whereType(); - - if (children.isEmpty) { - return null; - } - - return UniformTrack( - direction: constraints.crossAxisDirection, - division: crossAxisCount, - spacing: crossAxisSpacing, - children: [...children], - ); - }, - childCount: listItemCount, - ), - ); - }, - ); - } - - Widget? _buildItem(BuildContext context, int index, int? childCount) { - if (index < 0 || (childCount != null && index >= childCount)) { - return null; - } - - return itemBuilder(context, index); - } -} - -class _Gap extends StatelessWidget { - const _Gap({ - Key? key, - required this.mainAxisExtent, - }) : super(key: key); - - final double mainAxisExtent; - - @override - Widget build(BuildContext context) { - final axis = axisDirectionToAxis(Scrollable.of(context).axisDirection); - return axis == Axis.vertical - ? SizedBox(height: mainAxisExtent) - : SizedBox(width: mainAxisExtent); - } -} diff --git a/test/src/layouts/quilted_test.dart b/test/src/layouts/quilted_test.dart deleted file mode 100644 index af02e6d..0000000 --- a/test/src/layouts/quilted_test.dart +++ /dev/null @@ -1,274 +0,0 @@ -import 'package:flutter/rendering.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../../common.dart'; - -void main() { - final binding = TestWidgetsFlutterBinding.ensureInitialized(); - testWidgets('Quilted Grid same control test', (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(800, 800)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverQuiltedGridDelegate( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.same, - pattern: const [ - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 2), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - expect(tester.getTopLeft(find.text('$index')), equals(topLeft)); - } - - const s1 = 197.0; - const s2 = 398.0; - const s3 = 599.0; - _expectSize(0, const Size(s2, s2)); - _expectSize(1, const Size(s1, s1)); - _expectSize(2, const Size(s1, s1)); - _expectSize(3, const Size(s2, s1)); - _expectSize(4, const Size(s2, s2)); - _expectSize(5, const Size(s1, s1)); - _expectSize(6, const Size(s1, s1)); - _expectSize(7, const Size(s2, s1)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(s2 + 4, 0)); - _expectTopLeft(2, const Offset(s3 + 4, 0)); - _expectTopLeft(3, const Offset(s2 + 4, s1 + 4)); - _expectTopLeft(4, const Offset(0, s2 + 4)); - _expectTopLeft(5, const Offset(s2 + 4, s2 + 4)); - _expectTopLeft(6, const Offset(s3 + 4, s2 + 4)); - _expectTopLeft(7, const Offset(s2 + 4, s3 + 4)); - }); - - testWidgets('Quilted Grid inverted control test', - (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(800, 800)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverQuiltedGridDelegate( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.inverted, - pattern: const [ - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 2), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - expect(tester.getTopLeft(find.text('$index')), equals(topLeft)); - } - - const s1 = 197.0; - const s2 = 398.0; - const s3 = 599.0; - _expectSize(0, const Size(s2, s2)); - _expectSize(1, const Size(s1, s1)); - _expectSize(2, const Size(s1, s1)); - _expectSize(3, const Size(s2, s1)); - _expectSize(4, const Size(s2, s1)); - _expectSize(5, const Size(s2, s2)); - _expectSize(6, const Size(s1, s1)); - _expectSize(7, const Size(s1, s1)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(s2 + 4, 0)); - _expectTopLeft(2, const Offset(s3 + 4, 0)); - _expectTopLeft(3, const Offset(s2 + 4, s1 + 4)); - _expectTopLeft(4, const Offset(0, s2 + 4)); - _expectTopLeft(5, const Offset(s2 + 4, s2 + 4)); - _expectTopLeft(6, const Offset(0, s3 + 4)); - _expectTopLeft(7, const Offset(s1 + 4, s3 + 4)); - }); - - testWidgets('Quilted Grid mirrored control test', - (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(800, 800)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverQuiltedGridDelegate( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.mirrored, - pattern: const [ - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 2), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - expect(tester.getTopLeft(find.text('$index')), equals(topLeft)); - } - - const s1 = 197.0; - const s2 = 398.0; - const s3 = 599.0; - _expectSize(0, const Size(s2, s2)); - _expectSize(1, const Size(s1, s1)); - _expectSize(2, const Size(s1, s1)); - _expectSize(3, const Size(s2, s1)); - _expectSize(4, const Size(s2, s2)); - _expectSize(5, const Size(s2, s1)); - _expectSize(6, const Size(s1, s1)); - _expectSize(7, const Size(s1, s1)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(s2 + 4, 0)); - _expectTopLeft(2, const Offset(s3 + 4, 0)); - _expectTopLeft(3, const Offset(s2 + 4, s1 + 4)); - _expectTopLeft(4, const Offset(0, s2 + 4)); - _expectTopLeft(5, const Offset(s2 + 4, s2 + 4)); - _expectTopLeft(6, const Offset(s2 + 4, s3 + 4)); - _expectTopLeft(7, const Offset(s3 + 4, s3 + 4)); - }); - - testWidgets('Quilted Grid different pattern control test', - (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(200, 268)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverQuiltedGridDelegate( - crossAxisCount: 3, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.inverted, - pattern: const [ - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - expect(tester.getTopLeft(find.text('$index')), equals(topLeft)); - } - - const s1 = 64.0; - const s2 = 132.0; - const s3 = 200.0; - _expectSize(0, const Size(s1, s1)); - _expectSize(1, const Size(s1, s1)); - _expectSize(2, const Size(s1, s1)); - _expectSize(3, const Size(s1, s1)); - _expectSize(4, const Size(s2, s2)); - _expectSize(5, const Size(s1, s1)); - _expectSize(6, const Size(s1, s1)); - _expectSize(7, const Size(s1, s1)); - _expectSize(7, const Size(s1, s1)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(s1 + 4, 0)); - _expectTopLeft(2, const Offset(s2 + 4, 0)); - _expectTopLeft(3, const Offset(0, s1 + 4)); - _expectTopLeft(4, const Offset(s1 + 4, s1 + 4)); - _expectTopLeft(5, const Offset(0, s2 + 4)); - _expectTopLeft(6, const Offset(0, s3 + 4)); - _expectTopLeft(7, const Offset(s1 + 4, s3 + 4)); - _expectTopLeft(8, const Offset(s2 + 4, s3 + 4)); - }); - - test('computeMaxScrollOffset should be right', () { - final delegate = SliverQuiltedGridDelegate( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - repeatPattern: QuiltedGridRepeatPattern.same, - pattern: const [ - QuiltedGridTile(2, 2), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 1), - QuiltedGridTile(1, 2), - ], - ); - - final layout = delegate.getLayout( - const SliverConstraints( - axisDirection: AxisDirection.down, - cacheOrigin: 0, - crossAxisDirection: AxisDirection.right, - crossAxisExtent: 412, - growthDirection: GrowthDirection.forward, - scrollOffset: 0, - overlap: 0, - viewportMainAxisExtent: 400, - precedingScrollExtent: 0, - remainingCacheExtent: 400, - remainingPaintExtent: 400, - userScrollDirection: ScrollDirection.idle, - ), - ); - - expect(layout.computeMaxScrollOffset(12), 620); - expect(layout.computeMaxScrollOffset(16), 828); - }); -} diff --git a/test/src/layouts/staired_test.dart b/test/src/layouts/staired_test.dart deleted file mode 100644 index bbd27eb..0000000 --- a/test/src/layouts/staired_test.dart +++ /dev/null @@ -1,59 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/src/layouts/staired.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../../common.dart'; - -void main() { - final binding = TestWidgetsFlutterBinding.ensureInitialized(); - testWidgets('Staired Grid control test', (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(800, 800)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverStairedGridDelegate( - crossAxisSpacing: 48, - mainAxisSpacing: 24, - startCrossAxisDirectionReversed: true, - pattern: const [ - StairedGridTile(0.5, 1), - StairedGridTile(0.5, 3 / 4), - StairedGridTile(1.0, 10 / 4), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - final actualOffset = tester.getTopLeft(find.text('$index')); - expect( - actualOffset.dx, - moreOrLessEquals(topLeft.dx, epsilon: precisionErrorTolerance), - ); - expect( - actualOffset.dy, - moreOrLessEquals(topLeft.dy, epsilon: precisionErrorTolerance), - ); - } - - const s1 = 376.0; - - _expectSize(0, const Size(s1, s1)); - _expectSize(1, const Size(s1, s1 / (3 / 4))); - _expectSize(2, const Size(704, 704 / (10 / 4))); - - _expectTopLeft(0, const Offset(s1 + 48, 0)); - _expectTopLeft(1, const Offset(0, 24)); - _expectTopLeft(2, const Offset(48, s1 / (3 / 4) + 48)); - }); -} diff --git a/test/src/layouts/woven_test.dart b/test/src/layouts/woven_test.dart deleted file mode 100644 index 7aea296..0000000 --- a/test/src/layouts/woven_test.dart +++ /dev/null @@ -1,174 +0,0 @@ -import 'package:flutter/foundation.dart'; -import 'package:flutter/rendering.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/src/layouts/woven.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../../common.dart'; - -void main() { - final binding = TestWidgetsFlutterBinding.ensureInitialized(); - testWidgets('Woven Grid control test', (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(800, 800)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverWovenGridDelegate.count( - crossAxisCount: 2, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - pattern: const [ - WovenGridTile(1), - WovenGridTile( - 5 / 7, - crossAxisRatio: 0.9, - alignment: AlignmentDirectional.centerEnd, - ), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - final actualOffset = tester.getTopLeft(find.text('$index')); - expect( - actualOffset.dx, - moreOrLessEquals(topLeft.dx, epsilon: precisionErrorTolerance), - ); - expect( - actualOffset.dy, - moreOrLessEquals(topLeft.dy, epsilon: precisionErrorTolerance), - ); - } - - const s1 = 396.0; - const s2 = s1 * 0.9; - const s3 = s2 * 7 / 5; - - _expectSize(0, const Size(s1, s1)); - _expectSize(1, const Size(s2, s3)); - _expectSize(2, const Size(s2, s3)); - _expectSize(3, const Size(s1, s1)); - - _expectTopLeft(0, const Offset(0, (s3 - s1) / 2)); - _expectTopLeft(1, const Offset(s1 + 8 + 0.1 * s1, 0)); - _expectTopLeft(2, const Offset(0, s3 + 8)); - _expectTopLeft(3, const Offset(s1 + 8, s3 + 8 + (s3 - s1) / 2)); - }); - - testWidgets('Woven layout should follow an opposite flow', - (WidgetTester tester) async { - await binding.setSurfaceSize(const Size(412, 800)); - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: GridView.custom( - gridDelegate: SliverWovenGridDelegate.count( - crossAxisCount: 4, - mainAxisSpacing: 4, - crossAxisSpacing: 4, - pattern: const [ - WovenGridTile(1), - WovenGridTile( - 6 / 10, - crossAxisRatio: 0.9, - ), - WovenGridTile( - 3 / 4, - crossAxisRatio: 0.9, - ), - ], - ), - childrenDelegate: SliverChildBuilderDelegate( - (context, index) => Tile(index: index), - ), - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - final actualOffset = tester.getTopLeft(find.text('$index')); - expect( - actualOffset.dx, - moreOrLessEquals(topLeft.dx, epsilon: precisionErrorTolerance), - ); - expect( - actualOffset.dy, - moreOrLessEquals(topLeft.dy, epsilon: precisionErrorTolerance), - ); - } - - const s1 = 100.0; - const s2 = s1 * 0.9; - const s3 = s2 * 10 / 6; - const s4 = s2 * 4 / 3; - - _expectSize(0, const Size(s1, s1)); - _expectSize(1, const Size(s2, s3)); - _expectSize(2, const Size(s2, s4)); - _expectSize(3, const Size(s1, s1)); - _expectSize(4, const Size(s2, s3)); - _expectSize(5, const Size(s1, s1)); - _expectSize(6, const Size(s2, s4)); - _expectSize(7, const Size(s2, s3)); - - _expectTopLeft(0, const Offset(0, 25)); - _expectTopLeft(1, const Offset(104 + 5, 0)); - _expectTopLeft(2, const Offset(208 + 5, 15)); - _expectTopLeft(3, const Offset(312, 25)); - _expectTopLeft(4, const Offset(5, 154)); - _expectTopLeft(5, const Offset(104, 154 + 25)); - _expectTopLeft(6, const Offset(208 + 5, 154 + 15)); - _expectTopLeft(7, const Offset(312 + 5, 154)); - }); - - test('computeMaxScrollOffset should be right', () { - final delegate = SliverWovenGridDelegate.count( - crossAxisCount: 3, - mainAxisSpacing: 8, - crossAxisSpacing: 8, - pattern: const [ - WovenGridTile(1), - WovenGridTile( - 5 / 7, - crossAxisRatio: 0.9, - alignment: AlignmentDirectional.centerEnd, - ), - ], - ); - - final layout = delegate.getLayout( - const SliverConstraints( - axisDirection: AxisDirection.down, - cacheOrigin: 0, - crossAxisDirection: AxisDirection.right, - crossAxisExtent: 412, - growthDirection: GrowthDirection.forward, - scrollOffset: 0, - overlap: 0, - viewportMainAxisExtent: 400, - precedingScrollExtent: 0, - remainingCacheExtent: 400, - remainingPaintExtent: 400, - userScrollDirection: ScrollDirection.idle, - ), - ); - - expect(layout.computeMaxScrollOffset(13), 846.4399999999999); - expect(layout.computeMaxScrollOffset(14), 863.5999999999999); - expect(layout.computeMaxScrollOffset(16), 1037.92); - }); -} diff --git a/test/src/widgets/aligned_grid_view_test.dart b/test/src/widgets/aligned_grid_view_test.dart deleted file mode 100644 index 7473214..0000000 --- a/test/src/widgets/aligned_grid_view_test.dart +++ /dev/null @@ -1,189 +0,0 @@ -import 'package:flutter/gestures.dart'; -import 'package:flutter/widgets.dart'; -import 'package:flutter_staggered_grid_view/src/widgets/aligned_grid_view.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import '../../common.dart'; - -void main() { - final binding = TestWidgetsFlutterBinding.ensureInitialized(); - - testWidgets('Empty AlignedGridView', (WidgetTester tester) async { - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: AlignedGridView.count( - dragStartBehavior: DragStartBehavior.down, - crossAxisCount: 4, - itemBuilder: (contex, index) => const SizedBox(), - itemCount: 0, - ), - ), - ); - }); - - testWidgets('Should only layout the number of requested items', - (WidgetTester tester) async { - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: AlignedGridView.count( - dragStartBehavior: DragStartBehavior.down, - crossAxisCount: 4, - itemBuilder: (contex, index) { - return Tile( - index: index, - height: 100, - ); - }, - itemCount: 4, - ), - ), - ); - - expect(find.text('0'), findsOneWidget); - expect(find.text('4'), findsNothing); - - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: AlignedGridView.count( - dragStartBehavior: DragStartBehavior.down, - crossAxisCount: 4, - itemBuilder: (contex, index) { - return Tile( - index: index, - height: 100, - ); - }, - itemCount: 5, - ), - ), - ); - - expect(find.text('0'), findsOneWidget); - expect(find.text('4'), findsOneWidget); - expect(find.text('5'), findsNothing); - }); - - testWidgets('AlignedGridView.count control test', - (WidgetTester tester) async { - // Screen size is 800x600 in the test environment. - final itemCount = 12; - - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: AlignedGridView.count( - cacheExtent: 0, - dragStartBehavior: DragStartBehavior.down, - crossAxisCount: 4, - itemBuilder: (context, index) { - return Tile( - index: index, - height: ((index % 5) + 1) * 100, - ); - }, - itemCount: itemCount, - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - expect(tester.getTopLeft(find.text('$index')), equals(topLeft)); - } - - _expectSize(0, const Size(200, 400)); - _expectSize(1, const Size(200, 400)); - _expectSize(2, const Size(200, 400)); - _expectSize(3, const Size(200, 400)); - _expectSize(4, const Size(200, 500)); - _expectSize(5, const Size(200, 500)); - _expectSize(6, const Size(200, 500)); - _expectSize(7, const Size(200, 500)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(200, 0)); - _expectTopLeft(2, const Offset(400, 0)); - _expectTopLeft(3, const Offset(600, 0)); - _expectTopLeft(4, const Offset(0, 400)); - _expectTopLeft(5, const Offset(200, 400)); - _expectTopLeft(6, const Offset(400, 400)); - _expectTopLeft(7, const Offset(600, 400)); - }); - - testWidgets('AlignedGridView.extent control test', - (WidgetTester tester) async { - // Screen size is 800x600 in the test environment. - final itemCount = 12; - - await tester.pumpWidget( - Directionality( - textDirection: TextDirection.ltr, - child: AlignedGridView.extent( - cacheExtent: 0, - dragStartBehavior: DragStartBehavior.down, - maxCrossAxisExtent: 200, - itemBuilder: (context, index) { - return Tile( - index: index, - height: ((index % 5) + 1) * 100, - ); - }, - itemCount: itemCount, - ), - ), - ); - - void _expectSize(int index, Size size) { - expect(tester.getSize(find.text('$index')), equals(size)); - } - - void _expectTopLeft(int index, Offset topLeft) { - expect(tester.getTopLeft(find.text('$index')), equals(topLeft)); - } - - _expectSize(0, const Size(200, 400)); - _expectSize(1, const Size(200, 400)); - _expectSize(2, const Size(200, 400)); - _expectSize(3, const Size(200, 400)); - _expectSize(4, const Size(200, 500)); - _expectSize(5, const Size(200, 500)); - _expectSize(6, const Size(200, 500)); - _expectSize(7, const Size(200, 500)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(200, 0)); - _expectTopLeft(2, const Offset(400, 0)); - _expectTopLeft(3, const Offset(600, 0)); - _expectTopLeft(4, const Offset(0, 400)); - _expectTopLeft(5, const Offset(200, 400)); - _expectTopLeft(6, const Offset(400, 400)); - _expectTopLeft(7, const Offset(600, 400)); - - // Change orientation to portrait. - await binding.setSurfaceSize(const Size(600, 800)); - await tester.pump(); - - _expectSize(0, const Size(200, 300)); - _expectSize(1, const Size(200, 300)); - _expectSize(2, const Size(200, 300)); - _expectSize(3, const Size(200, 500)); - _expectSize(4, const Size(200, 500)); - _expectSize(5, const Size(200, 500)); - - _expectTopLeft(0, const Offset(0, 0)); - _expectTopLeft(1, const Offset(200, 0)); - _expectTopLeft(2, const Offset(400, 0)); - _expectTopLeft(3, const Offset(0, 300)); - _expectTopLeft(4, const Offset(200, 300)); - _expectTopLeft(5, const Offset(400, 300)); - - expect(find.text('6'), findsNothing); - expect(find.text('7'), findsNothing); - }); -}