提交 6ac9ce0c authored 作者: 史晓晨's avatar 史晓晨

init_temp

上级
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: ['www.paypal.me/jogboms']
---
name: Bug report
about: Create a report to help us improve
---
**Describe the bug**
A clear and concise description of what the bug is.
**SpinKit name**
The name of the loader with which this bug occurred.
**Screenshots**
If applicable, add screenshots to help explain your problem.
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "weekly"
name: Format, Analyze and Test
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
# runs the CI weekly
- cron: "0 0 * * 0"
jobs:
default_run:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: subosito/flutter-action@v2
with:
cache: true
channel: 'stable'
- run: flutter doctor
- run: flutter pub get
- run: dart format --set-exit-if-changed -l 120 lib
- run: flutter analyze lib
- run: flutter test --no-pub --coverage
- name: Upload coverage to codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
.vscode/
# Flutter/Dart/Pub related
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
/pubspec.lock
**/doc/api/
.dart_tool/
.packages
build/
# Custom
.pub/
coverage/
# ChangeLog for Flutter Spinkit
A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit.
## 5.2.2
- Fix `SpinKitWanderingCubes` not working as showcased
## 5.2.1
- Fix `SpinKitCubeGrid` not working as showcased
## 5.2.0
- Fix `SpinKitCircle`, `SpinKitFadingCircle`, `SpinKitDancingSquare` animation
- Fix calling `setState` on unmounted states
- Introduced [SpinKitWaveSpinner]
- Introduced [SpinKitPulsingGrid]
## 5.1.0
- Renamed `SpinKitPouringHourglass` -> `SpinKitPouringHourGlass` for correctness
- Fix `SpinKitFoldingCube` animation
- Fix disposing of non-local animation controllers
- Introduced `strokeWidth` to pouring glass animation
- Introduced `SpinKitPouringHourGlassRefined`
- Introduced `SpinKitSpinningLines`
- Introduced `SpinKitPianoWave`
- Introduced `SpinKitDancingSquare`
- Introduced `SpinKitThreeInOut`
## 5.0.0
- Migrate to null safety
## 4.1.2+1
- Upgrades the example to AndroidX
## 4.1.2
- Introduced new `itemCount` property to `SpinKitWave`
- Fixed broken calculations that made certain animations behave weirdly
## 4.1.1+1
- Include Authors info in README
## 4.1.1
- Utilize native flutter auto-reverse feature for AnimationController
## 4.1.0
- Introduces a new SpinKit [SpinKitSquareCircle]
- Introduces `const` SpinKits
- Improve code quality across all spinners
### Before
```dart
final spinkit = SpinKitSquareCircle(color: Colors.white, size: 50.0);
```
### Now, all SpinKits can be initialized as `const`s
```dart
const spinkit = SpinKitSquareCircle(color: Colors.white, size: 50.0);
```
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/square_circle.gif" width="100px" height="100px">
## 4.0.0
### Feature
- `controller` parameter [5873e7](https://github.com/jogboms/flutter_spinkit/commit/5873e75430aca52d2ec0c483dcd71a02438f3e8b). Closes [#51](https://github.com/jogboms/flutter_spinkit/issues/51)
```dart
final spinkit = SpinKitFadingCircle(
color: Colors.white,
size: 50.0,
controller: AnimationController(vsync: this, duration: const Duration(milliseconds: 1200)),
);
```
- [DualRing] `lineWidth` parameter [9bcfd5](https://github.com/jogboms/flutter_spinkit/commit/9bcfd507459dfabf50d26a27cdb2c11188fce913). Closes [#42](https://github.com/jogboms/flutter_spinkit/issues/42)
## 3.1.0
### Feature
- `duration` parameter [70b113b](https://github.com/jogboms/flutter_spinkit/commit/70b113b384200e344336d521704a1c96d2864909)
### Fixes
- state disposed before ticker [0c9b6e3](https://github.com/jogboms/flutter_spinkit/commit/0c9b6e388c2f714659b945ece7feb3b7480ba0de)
## 3.0.0
### Before
```dart
final spinkit = SpinKitFadingCircle(color: Colors.white, size: 50.0);
```
### Now, there is an itemBuilder alternative
```dart
final spinkit = SpinKitFadingCircle(
itemBuilder: (_, int index) {
return DecoratedBox(
decoration: BoxDecoration(
color: index.isEven ? Colors.red : Colors.green,
),
);
},
);
```
### Which produces
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/itemBuilder.gif" width="100px">
MIT License
Copyright (c) 2018 Jeremiah Ogbomo
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
# ✨ Flutter Spinkit
[![Format, Analyze and Test](https://github.com/jogboms/flutter_spinkit/actions/workflows/main.yml/badge.svg)](https://github.com/jogboms/flutter_spinkit/actions/workflows/main.yml) [![codecov](https://codecov.io/gh/jogboms/flutter_spinkit/branch/master/graph/badge.svg)](https://codecov.io/gh/jogboms/flutter_spinkit) [![pub package](https://img.shields.io/pub/v/flutter_spinkit.svg)](https://pub.dartlang.org/packages/flutter_spinkit)
A collection of loading indicators animated with flutter. Heavily inspired by [@tobiasahlin](https://github.com/tobiasahlin)'s [SpinKit](https://github.com/tobiasahlin/SpinKit).
## 🎖 Installing
```yaml
dependencies:
flutter_spinkit: ^5.2.2
```
### ⚡️ Import
```dart
import 'package:flutter_spinkit/flutter_spinkit.dart';
```
## 🎮 How To Use
```dart
const spinkit = SpinKitRotatingCircle(
color: Colors.white,
size: 50.0,
);
```
```dart
final spinkit = SpinKitFadingCircle(
itemBuilder: (BuildContext context, int index) {
return DecoratedBox(
decoration: BoxDecoration(
color: index.isEven ? Colors.red : Colors.green,
),
);
},
);
```
```dart
final spinkit = SpinKitSquareCircle(
color: Colors.white,
size: 50.0,
controller: AnimationController(vsync: this, duration: const Duration(milliseconds: 1200)),
);
```
For more info, please, refer to the `showcase.dart` in the example.
## 🚀 Showcase
<table>
<tr>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/RotatingPlane.gif" width="100px" height="100px">
<br />
RotatingPlain
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/DoubleBounce.gif" width="100px" height="100px">
<br />
DoubleBounce
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/Wave.gif" width="100px" height="100px">
<br />
Wave
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/WanderingCubes.gif" width="100px" height="100px">
<br />
WanderingCubes
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/FadingFour.gif" width="100px" height="100px">
<br />
FadingFour
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/FadingCube.gif" width="100px" height="100px">
<br />
FadingCube
</td>
</tr>
<tr>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/Pulse.gif" width="100px" height="100px">
<br />
Pulse
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/ChasingDots.gif" width="100px" height="100px">
<br />
ChasingDots
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/ThreeBounce.gif" width="100px" height="100px">
<br />
ThreeBounce
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/Circle.gif" width="100px" height="100px">
<br />
Circle
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/CubeGrid.gif" width="100px" height="100px">
<br />
CubeGrid
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/FadingCircle.gif" width="100px" height="100px">
<br />
FadingCircle
</td>
</tr>
<tr>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/RotatingCircle.gif" width="100px" height="100px">
<br />
RotatingCircle
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/ybq/AndroidSpinKit/master/art/FoldingCube.gif" width="100px" height="100px">
<br />
FoldingCube
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/heart.gif" width="100px" height="100px">
<br />
PumpingHeart
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/hour-glass.gif" width="100px" height="100px">
<br />
HourGlass
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/PouringHourGlass.gif" width="100px" height="100px">
<br />
PouringHourGlass
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/pouring-hour-glass-refined.gif" width="100px" height="100px">
<br />
PouringHourGlassRefined
</td>
</tr>
<tr>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/grid.gif" width="100px" height="100px">
<br />
FadingGrid
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/ring.gif" width="100px" height="100px">
<br />
Ring
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/ripple.gif" width="100px" height="100px">
<br />
Ripple
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/spinning-circle.gif" width="100px" height="100px">
<br />
SpinningCircle
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/spinning-lines.gif" width="100px" height="100px">
<br />
SpinningLines
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/abhishek0706/flutter_spinkit/square_circle/screenshots/square_circle.gif" width="100px" height="100px">
<br />
SquareCircle
</td>
</tr>
<tr>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/dual-ring.gif" width="100px" height="100px">
<br />
DualRing
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/piano-wave.gif" width="100px" height="100px">
<br />
PianoWave
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/dancing-square.gif" width="100px" height="100px">
<br />
DancingSquare
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/three-in-out.gif" width="100px" height="100px">
<br />
ThreeInOut
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/spinkit_wave_spinner.gif" width="100px" height="100px">
<br />
WaveSpinner
</td>
<td align="center">
<img src="https://raw.githubusercontent.com/jogboms/flutter_spinkit/master/screenshots/pulsing-grid.gif" width="100px" height="100px">
<br />
PulsingGrid
</td>
</tr>
</table>
> Some GIF images gotten from [Android Spinkit](https://github.com/ybq/Android-SpinKit).
## 🐛 Bugs/Requests
If you encounter any problems feel free to open an issue. If you feel the library is
missing a feature, please raise a ticket on Github and I'll look into it.
Pull request are also welcome.
### ❗️ Note
For help getting started with Flutter, view our online
[documentation](https://flutter.io/).
For help on editing plugin code, view the [documentation](https://flutter.io/platform-plugins/#edit-code).
## ☀️ Authors
<table>
<tr>
<td align="center">
<a href = "https://jogboms.github.io/"><img src="https://avatars2.githubusercontent.com/u/6208486?s=400&u=01fab3fc9bb3d2ee799e314d3fe23c54d1deeb07&v=4" width="72" alt="Jeremiah Ogbomo" /></a>
<p align="center">
<a href = "https://github.com/jogboms"><img src = "https://www.iconninja.com/files/241/825/211/round-collaboration-social-github-code-circle-network-icon.svg" width="18" height = "18"/></a>
<a href = "https://twitter.com/jogboms"><img src = "https://www.shareicon.net/download/2016/07/06/107115_media.svg" width="18" height="18"/></a>
<a href = "https://www.linkedin.com/in/jogboms/"><img src = "https://www.iconninja.com/files/863/607/751/network-linkedin-social-connection-circular-circle-media-icon.svg" width="18" height="18"/></a>
</p>
</td>
<td align="center">
<a href = "https://ayushagarwal.ml/"><img src="https://avatars2.githubusercontent.com/u/34043023?s=400&u=01fab3fc9bb3d2ee799e314d3fe23c54d1deeb07&v=4" width="72" alt="Ayush Agarwal" /></a>
<p align="center">
<a href = "https://github.com/aagarwal1012"><img src = "https://www.iconninja.com/files/241/825/211/round-collaboration-social-github-code-circle-network-icon.svg" width="18" height = "18"/></a>
<a href = "https://twitter.com/aagarwal1012"><img src = "https://www.shareicon.net/download/2016/07/06/107115_media.svg" width="18" height="18"/></a>
<a href = "https://www.linkedin.com/in/aagarwal1012/"><img src = "https://www.iconninja.com/files/863/607/751/network-linkedin-social-connection-circular-circle-media-icon.svg" width="18" height="18"/></a>
</p>
</td>
</tr>
</table>
## ⭐️ License
MIT License
include: package:flutter_lints/flutter.yaml
analyzer:
errors:
missing_required_param: error
missing_return: error
unused_import: error
unused_local_variable: error
dead_code: error
todo: ignore
linter:
rules:
# All rules from pedantic, already enabled rules are left out
# https://github.com/google/pedantic/blob/master/lib/analysis_options.1.11.0.yaml
- always_declare_return_types
- prefer_single_quotes
- unawaited_futures
# Additional rules from https://github.com/flutter/flutter/blob/master/analysis_options.yaml
# Not all rules are included
- always_put_control_body_on_new_line
- avoid_slow_async_io
- cast_nullable_to_non_nullable
- prefer_final_in_for_each
- prefer_final_locals
- prefer_foreach
- prefer_if_elements_to_conditional_expressions
- sort_constructors_first
- sort_unnamed_constructors_first
- test_types_in_equals
- tighten_type_of_initializing_formals
- unnecessary_await_in_return
- unnecessary_null_aware_assignments
- unnecessary_null_checks
- unnecessary_nullable_for_final_variable_declarations
- unnecessary_statements
- use_late_for_private_fields_and_variables
- use_named_constants
- use_raw_strings
- use_super_parameters
- require_trailing_commas
# 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
# 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: cf4400006550b70f28e4b4af815151d1e74846c6
channel: stable
project_type: app
# 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.
# 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:
- require_trailing_commas
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
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
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 flutter.compileSdkVersion
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.example"
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<application
android:label="example"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
package com.example.example
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
}
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="?android:colorBackground" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<!-- Modify this file to customize your launch splash screen -->
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<!-- You can insert your own image assets here -->
<!-- <item>
<bitmap
android:gravity="center"
android:src="@mipmap/launch_image" />
</item> -->
</layer-list>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is on -->
<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Black.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- Theme applied to the Android Window while the process is starting when the OS's Dark Mode setting is off -->
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<!-- Show a splash screen on the activity. Automatically removed when
Flutter draws its first frame -->
<item name="android:windowBackground">@drawable/launch_background</item>
</style>
<!-- Theme applied to the Android Window as soon as the process has started.
This theme determines the color of the Android Window while your
Flutter UI initializes, as well as behind your Flutter UI while its
running.
This Theme is only used starting with V2 of Flutter's Android embedding. -->
<style name="NormalTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowBackground">?android:colorBackground</item>
</style>
</resources>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.example">
<!-- Flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
</manifest>
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}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
#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
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"
**/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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIdentifier</key>
<string>io.flutter.flutter.app</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>App</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
</dict>
</plist>
#include "Generated.xcconfig"
#include "Generated.xcconfig"
// !$*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 = "<group>"; };
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
97C146EB1CF9000F007C117D /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
9740EEB11CF90186004384FC /* Flutter */ = {
isa = PBXGroup;
children = (
3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
9740EEB21CF90195004384FC /* Debug.xcconfig */,
7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
9740EEB31CF90195004384FC /* Generated.xcconfig */,
);
name = Flutter;
sourceTree = "<group>";
};
97C146E51CF9000F007C117D = {
isa = PBXGroup;
children = (
9740EEB11CF90186004384FC /* Flutter */,
97C146F01CF9000F007C117D /* Runner */,
97C146EF1CF9000F007C117D /* Products */,
);
sourceTree = "<group>";
};
97C146EF1CF9000F007C117D /* Products */ = {
isa = PBXGroup;
children = (
97C146EE1CF9000F007C117D /* Runner.app */,
);
name = Products;
sourceTree = "<group>";
};
97C146F01CF9000F007C117D /* Runner */ = {
isa = PBXGroup;
children = (
97C146FA1CF9000F007C117D /* Main.storyboard */,
97C146FD1CF9000F007C117D /* Assets.xcassets */,
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
97C147021CF9000F007C117D /* Info.plist */,
1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
);
path = Runner;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
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 = 1430;
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 = "<group>";
};
97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
97C147001CF9000F007C117D /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
249021D3217E4FDB00AE95B9 /* Profile */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
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)";
DEVELOPMENT_TEAM = ADC6P6TT9U;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
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_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
TARGETED_DEVICE_FAMILY = "1,2";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
97C147061CF9000F007C117D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ADC6P6TT9U;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
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)";
DEVELOPMENT_TEAM = ADC6P6TT9U;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = com.example.example;
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 */;
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "97C146ED1CF9000F007C117D"
BuildableName = "Runner.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreviewsEnabled</key>
<false/>
</dict>
</plist>
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)
}
}
{
"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"
}
}
{
"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"
}
}
# 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
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G29" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="12089"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Ydg-fD-yQy"/>
<viewControllerLayoutGuide type="bottom" id="xbc-2k-c8Z"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" image="LaunchImage" translatesAutoresizingMaskIntoConstraints="NO" id="YRO-k0-Ey4">
</imageView>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerX" secondItem="Ze5-6b-2t3" secondAttribute="centerX" id="1a2-6s-vTC"/>
<constraint firstItem="YRO-k0-Ey4" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="centerY" id="4X2-HB-R7a"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="LaunchImage" width="168" height="185"/>
</resources>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<scenes>
<!--Flutter View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="FlutterViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>Example</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>example</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
<key>CADisableMinimumFrameDurationOnPhone</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
#import "GeneratedPluginRegistrant.h"
import 'package:flutter/material.dart';
import './showcase.dart';
import './workspace.dart';
void main() => runApp(const App());
class App extends StatelessWidget {
const App({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'SpinKit Demo',
debugShowCheckedModeBanner: false,
theme: ThemeData(brightness: Brightness.dark),
home: Scaffold(
body: SafeArea(
child: Stack(
children: <Widget>[
Align(
alignment: Alignment.bottomCenter,
child: Builder(
builder: (context) => IconButton(
icon: const Icon(Icons.play_circle_filled),
iconSize: 50.0,
onPressed: () => Navigator.of(context).push(
MaterialPageRoute<void>(
builder: (_) => const ShowCase(),
fullscreenDialog: true,
),
),
),
),
),
const Positioned.fill(child: Center(child: WorkSpace())),
],
),
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class ShowCase extends StatelessWidget {
const ShowCase({Key? key}) : super(key: key);
static const kits = <Widget>[
SpinKitRotatingCircle(color: Colors.white),
SpinKitRotatingPlain(color: Colors.white),
SpinKitChasingDots(color: Colors.white),
SpinKitPumpingHeart(color: Colors.white),
SpinKitPulse(color: Colors.white),
SpinKitDoubleBounce(color: Colors.white),
SpinKitWave(color: Colors.white, type: SpinKitWaveType.start),
SpinKitWave(color: Colors.white, type: SpinKitWaveType.center),
SpinKitWave(color: Colors.white, type: SpinKitWaveType.end),
SpinKitPianoWave(color: Colors.white, type: SpinKitPianoWaveType.start),
SpinKitPianoWave(color: Colors.white, type: SpinKitPianoWaveType.center),
SpinKitPianoWave(color: Colors.white, type: SpinKitPianoWaveType.end),
SpinKitThreeBounce(color: Colors.white),
SpinKitThreeInOut(color: Colors.white),
SpinKitWanderingCubes(color: Colors.white),
SpinKitWanderingCubes(color: Colors.white, shape: BoxShape.circle),
SpinKitCircle(color: Colors.white),
SpinKitFadingFour(color: Colors.white),
SpinKitFadingFour(color: Colors.white, shape: BoxShape.rectangle),
SpinKitFadingCube(color: Colors.white),
SpinKitCubeGrid(size: 51.0, color: Colors.white),
SpinKitFoldingCube(color: Colors.white),
SpinKitRing(color: Colors.white),
SpinKitDualRing(color: Colors.white),
SpinKitSpinningLines(color: Colors.white),
SpinKitFadingGrid(color: Colors.white),
SpinKitFadingGrid(color: Colors.white, shape: BoxShape.rectangle),
SpinKitSquareCircle(color: Colors.white),
SpinKitSpinningCircle(color: Colors.white),
SpinKitSpinningCircle(color: Colors.white, shape: BoxShape.rectangle),
SpinKitFadingCircle(color: Colors.white),
SpinKitPulsingGrid(color: Colors.white),
SpinKitPulsingGrid(color: Colors.white, boxShape: BoxShape.rectangle),
SpinKitHourGlass(color: Colors.white),
SpinKitPouringHourGlass(color: Colors.white),
SpinKitPouringHourGlassRefined(color: Colors.white),
SpinKitRipple(color: Colors.white),
SpinKitDancingSquare(color: Colors.white),
SpinKitWaveSpinner(color: Colors.white),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
elevation: 0.0,
backgroundColor: Colors.transparent,
title: const Text('SpinKit', style: TextStyle(fontSize: 24.0)),
),
body: GridView.builder(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: context.adaptiveCrossAxisCount,
mainAxisSpacing: 46,
childAspectRatio: 2,
),
padding: const EdgeInsets.only(top: 32, bottom: 64),
itemCount: kits.length,
itemBuilder: (context, index) => kits[index],
),
);
}
}
extension on BuildContext {
int get adaptiveCrossAxisCount {
final width = MediaQuery.of(this).size.width;
if (width > 1024) {
return 8;
} else if (width > 720 && width < 1024) {
return 6;
} else if (width > 480) {
return 4;
} else if (width > 320) {
return 3;
}
return 1;
}
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
class WorkSpace extends StatelessWidget {
const WorkSpace({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Container(
color: Colors.white,
width: 300.0,
height: 300.0,
child: SpinKitFadingCircle(
itemBuilder: (_, int index) {
return DecoratedBox(
decoration: BoxDecoration(
color: index.isEven ? Colors.red : Colors.green,
),
);
},
size: 120.0,
),
);
}
}
# Flutter-related
**/Flutter/ephemeral/
**/Pods/
# Xcode-related
**/dgph
**/xcuserdata/
#include "ephemeral/Flutter-Generated.xcconfig"
#include "ephemeral/Flutter-Generated.xcconfig"
//
// Generated file. Do not edit.
//
import FlutterMacOS
import Foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
}
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 54;
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 = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "example.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
33CC10F72044A3C60003C045 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = Info.plist; path = Runner/Info.plist; sourceTree = "<group>"; };
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MainFlutterWindow.swift; sourceTree = "<group>"; };
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Debug.xcconfig"; sourceTree = "<group>"; };
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = "Flutter-Release.xcconfig"; sourceTree = "<group>"; };
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "Flutter-Generated.xcconfig"; path = "ephemeral/Flutter-Generated.xcconfig"; sourceTree = "<group>"; };
33E51913231747F40026EE4D /* DebugProfile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = DebugProfile.entitlements; sourceTree = "<group>"; };
33E51914231749380026EE4D /* Release.entitlements */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.entitlements; path = Release.entitlements; sourceTree = "<group>"; };
33E5194F232828860026EE4D /* AppInfo.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = AppInfo.xcconfig; sourceTree = "<group>"; };
7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Release.xcconfig; sourceTree = "<group>"; };
9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Debug.xcconfig; sourceTree = "<group>"; };
/* 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 = "<group>";
};
33CC10E42044A3C60003C045 = {
isa = PBXGroup;
children = (
33FAB671232836740065AC1E /* Runner */,
33CEB47122A05771004F2AC0 /* Flutter */,
33CC10EE2044A3C60003C045 /* Products */,
D73912EC22F37F3D000D13A0 /* Frameworks */,
);
sourceTree = "<group>";
};
33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* example.app */,
);
name = Products;
sourceTree = "<group>";
};
33CC11242044D66E0003C045 /* Resources */ = {
isa = PBXGroup;
children = (
33CC10F22044A3C60003C045 /* Assets.xcassets */,
33CC10F42044A3C60003C045 /* MainMenu.xib */,
33CC10F72044A3C60003C045 /* Info.plist */,
);
name = Resources;
path = ..;
sourceTree = "<group>";
};
33CEB47122A05771004F2AC0 /* Flutter */ = {
isa = PBXGroup;
children = (
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */,
33CEB47222A05771004F2AC0 /* Flutter-Debug.xcconfig */,
33CEB47422A05771004F2AC0 /* Flutter-Release.xcconfig */,
33CEB47722A0578A004F2AC0 /* Flutter-Generated.xcconfig */,
);
path = Flutter;
sourceTree = "<group>";
};
33FAB671232836740065AC1E /* Runner */ = {
isa = PBXGroup;
children = (
33CC10F02044A3C60003C045 /* AppDelegate.swift */,
33CC11122044BFA00003C045 /* MainFlutterWindow.swift */,
33E51913231747F40026EE4D /* DebugProfile.entitlements */,
33E51914231749380026EE4D /* Release.entitlements */,
33CC11242044D66E0003C045 /* Resources */,
33BA886A226E78AF003329D5 /* Configs */,
);
path = Runner;
sourceTree = "<group>";
};
D73912EC22F37F3D000D13A0 /* Frameworks */ = {
isa = PBXGroup;
children = (
);
name = Frameworks;
sourceTree = "<group>";
};
/* 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 /* example.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
33CC10E52044A3C60003C045 /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 1510;
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;
alwaysOutOfDate = 1;
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 = "<group>";
};
/* 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.14;
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.14;
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.14;
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 */;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</MacroExpansion>
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Profile"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "example.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:Runner.xcodeproj">
</FileRef>
</Workspace>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
import Cocoa
import FlutterMacOS
@main
class AppDelegate: FlutterAppDelegate {
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
return true
}
override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
return true
}
}
{
"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"
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
<connections>
<outlet property="delegate" destination="Voe-Tx-rLC" id="GzC-gU-4Uq"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Runner" customModuleProvider="target">
<connections>
<outlet property="applicationMenu" destination="uQy-DD-JDr" id="XBo-yE-nKs"/>
<outlet property="mainFlutterWindow" destination="QvC-M9-y7g" id="gIp-Ho-8D9"/>
</connections>
</customObject>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="APP_NAME" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="APP_NAME" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About APP_NAME" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide APP_NAME" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit APP_NAME" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Edit" id="5QF-Oa-p0T">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Edit" id="W48-6f-4Dl">
<items>
<menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
<connections>
<action selector="undo:" target="-1" id="M6e-cu-g7V"/>
</connections>
</menuItem>
<menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
<connections>
<action selector="redo:" target="-1" id="oIA-Rs-6OD"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
<menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
<connections>
<action selector="cut:" target="-1" id="YJe-68-I9s"/>
</connections>
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
<connections>
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
<connections>
<action selector="paste:" target="-1" id="UvS-8e-Qdg"/>
</connections>
</menuItem>
<menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="pasteAsPlainText:" target="-1" id="cEh-KX-wJQ"/>
</connections>
</menuItem>
<menuItem title="Delete" id="pa3-QI-u2k">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="delete:" target="-1" id="0Mk-Ml-PaM"/>
</connections>
</menuItem>
<menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
<connections>
<action selector="selectAll:" target="-1" id="VNm-Mi-diN"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
<menuItem title="Find" id="4EN-yA-p0u">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Find" id="1b7-l0-nxx">
<items>
<menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
<connections>
<action selector="performFindPanelAction:" target="-1" id="cD7-Qs-BN4"/>
</connections>
</menuItem>
<menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="performFindPanelAction:" target="-1" id="WD3-Gg-5AJ"/>
</connections>
</menuItem>
<menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
<connections>
<action selector="performFindPanelAction:" target="-1" id="NDo-RZ-v9R"/>
</connections>
</menuItem>
<menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
<connections>
<action selector="performFindPanelAction:" target="-1" id="HOh-sY-3ay"/>
</connections>
</menuItem>
<menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
<connections>
<action selector="performFindPanelAction:" target="-1" id="U76-nv-p5D"/>
</connections>
</menuItem>
<menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
<connections>
<action selector="centerSelectionInVisibleArea:" target="-1" id="IOG-6D-g5B"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
<items>
<menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
<connections>
<action selector="showGuessPanel:" target="-1" id="vFj-Ks-hy3"/>
</connections>
</menuItem>
<menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
<connections>
<action selector="checkSpelling:" target="-1" id="fz7-VC-reM"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
<menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleContinuousSpellChecking:" target="-1" id="7w6-Qz-0kB"/>
</connections>
</menuItem>
<menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleGrammarChecking:" target="-1" id="muD-Qn-j4w"/>
</connections>
</menuItem>
<menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticSpellingCorrection:" target="-1" id="2lM-Qi-WAP"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Substitutions" id="9ic-FL-obx">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
<items>
<menuItem title="Show Substitutions" id="z6F-FW-3nz">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontSubstitutionsPanel:" target="-1" id="oku-mr-iSq"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
<menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleSmartInsertDelete:" target="-1" id="3IJ-Se-DZD"/>
</connections>
</menuItem>
<menuItem title="Smart Quotes" id="hQb-2v-fYv">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticQuoteSubstitution:" target="-1" id="ptq-xd-QOA"/>
</connections>
</menuItem>
<menuItem title="Smart Dashes" id="rgM-f4-ycn">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDashSubstitution:" target="-1" id="oCt-pO-9gS"/>
</connections>
</menuItem>
<menuItem title="Smart Links" id="cwL-P1-jid">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticLinkDetection:" target="-1" id="Gip-E3-Fov"/>
</connections>
</menuItem>
<menuItem title="Data Detectors" id="tRr-pd-1PS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticDataDetection:" target="-1" id="R1I-Nq-Kbl"/>
</connections>
</menuItem>
<menuItem title="Text Replacement" id="HFQ-gK-NFA">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="toggleAutomaticTextReplacement:" target="-1" id="DvP-Fe-Py6"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Transformations" id="2oI-Rn-ZJC">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Transformations" id="c8a-y6-VQd">
<items>
<menuItem title="Make Upper Case" id="vmV-6d-7jI">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="uppercaseWord:" target="-1" id="sPh-Tk-edu"/>
</connections>
</menuItem>
<menuItem title="Make Lower Case" id="d9M-CD-aMd">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="lowercaseWord:" target="-1" id="iUZ-b5-hil"/>
</connections>
</menuItem>
<menuItem title="Capitalize" id="UEZ-Bs-lqG">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="capitalizeWord:" target="-1" id="26H-TL-nsh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Speech" id="xrE-MZ-jX0">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Speech" id="3rS-ZA-NoH">
<items>
<menuItem title="Start Speaking" id="Ynk-f8-cLZ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="startSpeaking:" target="-1" id="654-Ng-kyl"/>
</connections>
</menuItem>
<menuItem title="Stop Speaking" id="Oyz-dy-DGm">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="stopSpeaking:" target="-1" id="dX8-6p-jy9"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="View" id="H8h-7b-M4v">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="View" id="HyV-fh-RgO">
<items>
<menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
<modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
<connections>
<action selector="toggleFullScreen:" target="-1" id="dU3-MA-1Rq"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Window" id="aUF-d1-5bR">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
<items>
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
<connections>
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="arrangeInFront:" target="-1" id="DRN-fu-gQh"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
<point key="canvasLocation" x="142" y="-258"/>
</menu>
<window title="APP_NAME" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g" customClass="MainFlutterWindow" customModule="Runner" customModuleProvider="target">
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
<rect key="contentRect" x="335" y="390" width="800" height="600"/>
<rect key="screenRect" x="0.0" y="0.0" width="2560" height="1577"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="800" height="600"/>
<autoresizingMask key="autoresizingMask"/>
</view>
</window>
</objects>
</document>
// 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 = example
// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.example.example
// The copyright displayed in application information
PRODUCT_COPYRIGHT = Copyright © 2022 com.example. All rights reserved.
#include "../../Flutter/Flutter-Debug.xcconfig"
#include "Warnings.xcconfig"
#include "../../Flutter/Flutter-Release.xcconfig"
#include "Warnings.xcconfig"
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
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.network.server</key>
<true/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(FLUTTER_BUILD_NAME)</string>
<key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSMinimumSystemVersion</key>
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
<key>NSHumanReadableCopyright</key>
<string>$(PRODUCT_COPYRIGHT)</string>
<key>NSMainNibFile</key>
<string>MainMenu</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
</dict>
</plist>
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()
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
</dict>
</plist>
# Generated by pub
# See https://dart.dev/tools/pub/glossary#lockfile
packages:
async:
dependency: transitive
description:
name: async
sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb"
url: "https://pub.dev"
source: hosted
version: "2.13.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
characters:
dependency: transitive
description:
name: characters
sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803
url: "https://pub.dev"
source: hosted
version: "1.4.0"
clock:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
url: "https://pub.dev"
source: hosted
version: "1.1.2"
collection:
dependency: transitive
description:
name: collection
sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76"
url: "https://pub.dev"
source: hosted
version: "1.19.1"
fake_async:
dependency: transitive
description:
name: fake_async
sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44"
url: "https://pub.dev"
source: hosted
version: "1.3.3"
flutter:
dependency: "direct main"
description: flutter
source: sdk
version: "0.0.0"
flutter_lints:
dependency: "direct dev"
description:
name: flutter_lints
sha256: "3105dc8492f6183fb076ccf1f351ac3d60564bff92e20bfc4af9cc1651f4e7e1"
url: "https://pub.dev"
source: hosted
version: "6.0.0"
flutter_spinkit:
dependency: "direct dev"
description:
path: ".."
relative: true
source: path
version: "5.2.2"
flutter_test:
dependency: "direct dev"
description: flutter
source: sdk
version: "0.0.0"
leak_tracker:
dependency: transitive
description:
name: leak_tracker
sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0"
url: "https://pub.dev"
source: hosted
version: "10.0.9"
leak_tracker_flutter_testing:
dependency: transitive
description:
name: leak_tracker_flutter_testing
sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573
url: "https://pub.dev"
source: hosted
version: "3.0.9"
leak_tracker_testing:
dependency: transitive
description:
name: leak_tracker_testing
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
url: "https://pub.dev"
source: hosted
version: "3.0.1"
lints:
dependency: transitive
description:
name: lints
sha256: a5e2b223cb7c9c8efdc663ef484fdd95bb243bff242ef5b13e26883547fce9a0
url: "https://pub.dev"
source: hosted
version: "6.0.0"
matcher:
dependency: transitive
description:
name: matcher
sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2
url: "https://pub.dev"
source: hosted
version: "0.12.17"
material_color_utilities:
dependency: transitive
description:
name: material_color_utilities
sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec
url: "https://pub.dev"
source: hosted
version: "0.11.1"
meta:
dependency: transitive
description:
name: meta
sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c
url: "https://pub.dev"
source: hosted
version: "1.16.0"
path:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
sky_engine:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
source_span:
dependency: transitive
description:
name: source_span
sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c"
url: "https://pub.dev"
source: hosted
version: "1.10.1"
stack_trace:
dependency: transitive
description:
name: stack_trace
sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1"
url: "https://pub.dev"
source: hosted
version: "1.12.1"
stream_channel:
dependency: transitive
description:
name: stream_channel
sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
string_scanner:
dependency: transitive
description:
name: string_scanner
sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43"
url: "https://pub.dev"
source: hosted
version: "1.4.1"
term_glyph:
dependency: transitive
description:
name: term_glyph
sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e"
url: "https://pub.dev"
source: hosted
version: "1.2.2"
test_api:
dependency: transitive
description:
name: test_api
sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd
url: "https://pub.dev"
source: hosted
version: "0.7.4"
vector_math:
dependency: transitive
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
vm_service:
dependency: transitive
description:
name: vm_service
sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02
url: "https://pub.dev"
source: hosted
version: "15.0.0"
sdks:
dart: ">=3.8.0 <4.0.0"
flutter: ">=3.18.0-18.0.pre.54"
name: example
description: A new Flutter project.
publish_to: 'none'
environment:
sdk: ">=2.15.0 <4.0.0"
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
flutter_spinkit:
path: ../
flutter_lints: ^6.0.0
flutter:
uses-material-design: true
<!DOCTYPE html>
<html>
<head>
<!--
If you are serving your web app in a path other than the root, change the
href value below to reflect the base path you are serving from.
The path provided below has to start and end with a slash "/" in order for
it to work correctly.
For more details:
* https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base
This is a placeholder for base href that will be replaced by the value of
the `--base-href` argument provided to `flutter build`.
-->
<base href="$FLUTTER_BASE_HREF">
<meta charset="UTF-8">
<meta content="IE=Edge" http-equiv="X-UA-Compatible">
<meta name="description" content="A new Flutter project.">
<!-- iOS meta tags & icons -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="example">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>example</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
<!-- This script installs service_worker.js to provide PWA functionality to
application. For more information, see:
https://developers.google.com/web/fundamentals/primers/service-workers -->
<script>
var serviceWorkerVersion = null;
var scriptLoaded = false;
function loadMainDartJs() {
if (scriptLoaded) {
return;
}
scriptLoaded = true;
var scriptTag = document.createElement('script');
scriptTag.src = 'main.dart.js';
scriptTag.type = 'application/javascript';
document.body.append(scriptTag);
}
if ('serviceWorker' in navigator) {
// Service workers are supported. Use them.
window.addEventListener('load', function () {
// Wait for registration to finish before dropping the <script> tag.
// Otherwise, the browser will load the script multiple times,
// potentially different versions.
var serviceWorkerUrl = 'flutter_service_worker.js?v=' + serviceWorkerVersion;
navigator.serviceWorker.register(serviceWorkerUrl)
.then((reg) => {
function waitForActivation(serviceWorker) {
serviceWorker.addEventListener('statechange', () => {
if (serviceWorker.state == 'activated') {
console.log('Installed new service worker.');
loadMainDartJs();
}
});
}
if (!reg.active && (reg.installing || reg.waiting)) {
// No active web worker and we have installed or are installing
// one for the first time. Simply wait for it to activate.
waitForActivation(reg.installing || reg.waiting);
} else if (!reg.active.scriptURL.endsWith(serviceWorkerVersion)) {
// When the app updates the serviceWorkerVersion changes, so we
// need to ask the service worker to update.
console.log('New service worker available.');
reg.update();
waitForActivation(reg.installing);
} else {
// Existing service worker is still good.
console.log('Loading app from service worker.');
loadMainDartJs();
}
});
// If service worker doesn't succeed in a reasonable amount of time,
// fallback to plaint <script> tag.
setTimeout(() => {
if (!scriptLoaded) {
console.warn(
'Failed to load app from service worker. Falling back to plain <script> tag.',
);
loadMainDartJs();
}
}, 4000);
});
} else {
// Service workers not supported. Just drop the <script> tag.
loadMainDartJs();
}
</script>
</body>
</html>
{
"name": "example",
"short_name": "example",
"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"
}
]
}
library flutter_spinkit;
export 'src/chasing_dots.dart';
export 'src/circle.dart';
export 'src/cube_grid.dart';
export 'src/dancing_square.dart';
export 'src/double_bounce.dart';
export 'src/dual_ring.dart';
export 'src/fading_circle.dart';
export 'src/fading_cube.dart';
export 'src/fading_four.dart';
export 'src/fading_grid.dart';
export 'src/folding_cube.dart';
export 'src/hour_glass.dart';
export 'src/piano_wave.dart';
export 'src/pouring_hour_glass.dart';
export 'src/pouring_hour_glass_refined.dart';
export 'src/pulse.dart';
export 'src/pulsing_grid.dart';
export 'src/pumping_heart.dart';
export 'src/ring.dart';
export 'src/ripple.dart';
export 'src/rotating_circle.dart';
export 'src/rotating_plain.dart';
export 'src/spinning_circle.dart';
export 'src/spinning_lines.dart';
export 'src/square_circle.dart';
export 'src/three_bounce.dart';
export 'src/three_in_out.dart';
export 'src/wandering_cubes.dart';
export 'src/wave.dart';
export 'src/wave_spinner.dart';
import 'package:flutter/widgets.dart';
class SpinKitChasingDots extends StatefulWidget {
const SpinKitChasingDots({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 2000),
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
@override
State<SpinKitChasingDots> createState() => _SpinKitChasingDotsState();
}
class _SpinKitChasingDotsState extends State<SpinKitChasingDots> with TickerProviderStateMixin {
late AnimationController _scaleCtrl;
late AnimationController _rotateCtrl;
late Animation<double> _scale;
late Animation<double> _rotate;
@override
void initState() {
super.initState();
_scaleCtrl = AnimationController(vsync: this, duration: widget.duration)
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat(reverse: true);
_scale = Tween(begin: -1.0, end: 1.0).animate(
CurvedAnimation(parent: _scaleCtrl, curve: Curves.easeInOut),
);
_rotateCtrl = AnimationController(vsync: this, duration: widget.duration)
..addListener(() => setState(() {}))
..repeat();
_rotate = Tween(begin: 0.0, end: 360.0).animate(
CurvedAnimation(parent: _rotateCtrl, curve: Curves.linear),
);
}
@override
void dispose() {
_scaleCtrl.dispose();
_rotateCtrl.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Transform.rotate(
angle: _rotate.value * 0.0174533,
child: Stack(
children: <Widget>[
Positioned(top: 0.0, child: _circle(1.0 - _scale.value.abs(), 0)),
Positioned(bottom: 0.0, child: _circle(_scale.value.abs(), 1)),
],
),
),
),
);
}
Widget _circle(double scale, int index) {
return Transform.scale(
scale: scale,
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.6),
child: widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.color,
),
),
),
);
}
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
class SpinKitCircle extends StatefulWidget {
const SpinKitCircle({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitCircle> createState() => _SpinKitCircleState();
}
class _SpinKitCircleState extends State<SpinKitCircle> with SingleTickerProviderStateMixin {
static const _itemCount = 12;
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Stack(
children: List.generate(_itemCount, (index) {
final position = widget.size * .5;
return Positioned.fill(
left: position,
top: position,
child: Transform(
transform: Matrix4.rotationZ(30.0 * index * 0.0174533),
child: Align(
alignment: Alignment.center,
child: ScaleTransition(
scale: DelayTween(
begin: 0.0,
end: 1.0,
delay: index / _itemCount,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.15),
child: _itemBuilder(index),
),
),
),
),
);
}),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: BoxShape.circle,
),
);
}
import 'package:flutter/widgets.dart';
import 'dart:math' as math;
class SpinKitCubeGrid extends StatefulWidget {
const SpinKitCubeGrid({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitCubeGrid> createState() => _SpinKitCubeGridState();
}
class _SpinKitCubeGridState extends State<SpinKitCubeGrid> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _anim1;
late Animation<double> _anim2;
late Animation<double> _anim3;
late Animation<double> _anim4;
late Animation<double> _anim5;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..repeat(reverse: true);
_anim1 = Tween(begin: 1.0, end: 0.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.1, 0.6, curve: Curves.easeIn),
),
);
_anim2 = Tween(begin: 1.0, end: 0.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.2, 0.7, curve: Curves.easeIn),
),
);
_anim3 = Tween(begin: 1.0, end: 0.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.3, 0.8, curve: Curves.easeIn),
),
);
_anim4 = Tween(begin: 1.0, end: 0.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.4, 0.9, curve: Curves.easeIn),
),
);
_anim5 = Tween(begin: 1.0, end: 0.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.5, 1.0, curve: Curves.easeIn),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
builder: (BuildContext context, Widget? child) {
final double angle = _controller.status == AnimationStatus.forward ? 0 : math.pi;
// Just rotate it 180 degrees to display it as showcased
return Transform.rotate(
angle: angle,
child: child,
);
},
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_square(_anim3, 0),
_square(_anim4, 1),
_square(_anim5, 2),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_square(_anim2, 3),
_square(_anim3, 4),
_square(_anim4, 5),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_square(_anim1, 6),
_square(_anim2, 7),
_square(_anim3, 8),
],
),
],
),
),
);
}
Widget _square(Animation<double> animation, int index) {
return ScaleTransition(
scale: animation,
child: SizedBox.fromSize(
size: Size.square(widget.size / 3),
child: _itemBuilder(index),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(decoration: BoxDecoration(color: widget.color));
}
import 'package:flutter/widgets.dart';
import 'tweens/delay_tween.dart';
class SpinKitDancingSquare extends StatefulWidget {
const SpinKitDancingSquare({
Key? key,
this.color,
this.size = 60.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitDancingSquare> createState() => _SpinKitDancingSquareState();
}
class _SpinKitDancingSquareState extends State<SpinKitDancingSquare> with SingleTickerProviderStateMixin {
static const _itemCount = 12;
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Stack(
children: List.generate(_itemCount, (index) {
final position = widget.size * .5;
final delay = index / _itemCount;
return Stack(
children: [
Positioned.fill(
left: position,
top: position,
child: Transform(
transform: Matrix4.rotationX(30.0 * index * 0.0174533),
child: Align(
alignment: Alignment.center,
child: ScaleTransition(
scale: DelayTween(
begin: 0.0,
end: 1.0,
delay: delay,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.15),
child: _itemBuilder(index),
),
),
),
),
),
Positioned.fill(
left: position,
top: -1 * position,
child: Transform(
transform: Matrix4.rotationY(30.0 * index * 0.0174533),
child: Align(
alignment: Alignment.center,
child: ScaleTransition(
scale: DelayTween(
begin: 0.0,
end: 1.0,
delay: delay,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.15),
child: _itemBuilder(index),
),
),
),
),
),
Positioned.fill(
left: -1 * position,
top: position,
child: Transform(
transform: Matrix4.rotationX(30.0 * index * 0.0174533),
child: Align(
alignment: Alignment.center,
child: ScaleTransition(
scale: DelayTween(
begin: 0.0,
end: 1.0,
delay: delay,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.15),
child: _itemBuilder(index),
),
),
),
),
),
Positioned.fill(
left: position,
top: position,
child: Transform(
transform: Matrix4.rotationY(30.0 * index * 0.0174533),
child: Align(
alignment: Alignment.center,
child: ScaleTransition(
scale: DelayTween(
begin: 0.0,
end: 1.0,
delay: delay,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.15),
child: _itemBuilder(index),
),
),
),
),
),
],
);
}),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: BoxShape.rectangle,
),
);
}
import 'package:flutter/widgets.dart';
class SpinKitDoubleBounce extends StatefulWidget {
const SpinKitDoubleBounce({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 2000),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitDoubleBounce> createState() => _SpinKitDoubleBounceState();
}
class _SpinKitDoubleBounceState extends State<SpinKitDoubleBounce> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat(reverse: true);
_animation = Tween(begin: -1.0, end: 1.0).animate(
CurvedAnimation(parent: _controller, curve: Curves.easeInOut),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Stack(
children: List.generate(2, (i) {
return Transform.scale(
scale: (1.0 - i - _animation.value.abs()).abs(),
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: _itemBuilder(i),
),
);
}),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.color!.withOpacity(0.6),
),
);
}
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
class SpinKitDualRing extends StatefulWidget {
const SpinKitDualRing({
Key? key,
required this.color,
this.lineWidth = 7.0,
this.size = 50.0,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : super(key: key);
final Color color;
final double lineWidth;
final double size;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitDualRing> createState() => _SpinKitDualRingState();
}
class _SpinKitDualRingState extends State<SpinKitDualRing> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation = Tween(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 1.0, curve: Curves.linear),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Transform(
transform: Matrix4.identity()..rotateZ((_animation.value) * math.pi * 2),
alignment: FractionalOffset.center,
child: CustomPaint(
painter: _DualRingPainter(
angle: 90,
paintWidth: widget.lineWidth,
color: widget.color,
),
child: SizedBox.fromSize(size: Size.square(widget.size)),
),
),
);
}
}
class _DualRingPainter extends CustomPainter {
_DualRingPainter({
required this.angle,
required double paintWidth,
required Color color,
}) : ringPaint = Paint()
..color = color
..strokeWidth = paintWidth
..style = PaintingStyle.stroke;
final Paint ringPaint;
final double angle;
@override
void paint(Canvas canvas, Size size) {
final rect = Rect.fromPoints(Offset.zero, Offset(size.width, size.height));
canvas.drawArc(rect, 0.0, getRadian(angle), false, ringPaint);
canvas.drawArc(rect, getRadian(180.0), getRadian(angle), false, ringPaint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => true;
double getRadian(double angle) => math.pi / 180 * angle;
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
class SpinKitFadingCircle extends StatefulWidget {
const SpinKitFadingCircle({
Key? key,
this.color,
this.size = 50.0,
this.itemSize,
this.itemCount,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final double? itemSize;
final int? itemCount;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitFadingCircle> createState() => _SpinKitFadingCircleState();
}
class _SpinKitFadingCircleState extends State<SpinKitFadingCircle> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
final itemSize = widget.itemSize ?? widget.size * 0.15;
final itemCount = widget.itemCount ?? 12;
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Stack(
children: List.generate(itemCount, (i) {
final position = widget.size * .5;
return Positioned.fill(
left: position,
top: position,
child: Transform(
transform: Matrix4.rotationZ((360 / itemCount) * i * 0.0174533),
child: Align(
alignment: Alignment.center,
child: FadeTransition(
opacity: DelayTween(
begin: 0.0,
end: 1.0,
delay: i / itemCount,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(itemSize),
child: _itemBuilder(i),
),
),
),
),
);
}),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: BoxShape.circle,
),
);
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
class SpinKitFadingCube extends StatefulWidget {
const SpinKitFadingCube({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 2400),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitFadingCube> createState() => _SpinKitFadingCubeState();
}
class _SpinKitFadingCubeState extends State<SpinKitFadingCube> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Center(
child: Transform.rotate(
angle: -45.0 * 0.0174533,
child: Stack(
children: List.generate(4, (i) {
final size = widget.size * 0.5, position = widget.size * .5;
return Positioned.fill(
top: position,
left: position,
child: Transform.scale(
scale: 1.1,
origin: Offset(-size * .5, -size * .5),
child: Transform(
transform: Matrix4.rotationZ(90.0 * i * 0.0174533),
child: Align(
alignment: Alignment.center,
child: FadeTransition(
opacity: DelayTween(
begin: 0.0,
end: 1.0,
delay: 0.3 * i,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(size),
child: _itemBuilder(i),
),
),
),
),
),
);
}),
),
),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(decoration: BoxDecoration(color: widget.color));
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
class SpinKitFadingFour extends StatefulWidget {
const SpinKitFadingFour({
Key? key,
this.color,
this.shape = BoxShape.circle,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final BoxShape shape;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitFadingFour> createState() => _SpinKitFadingFourState();
}
class _SpinKitFadingFourState extends State<SpinKitFadingFour> with SingleTickerProviderStateMixin {
static const List<double> _delays = [.0, -0.9, -0.6, -0.3];
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Stack(
children: List.generate(4, (i) {
final position = widget.size * .5;
return Positioned.fill(
left: position,
top: position,
child: Transform(
transform: Matrix4.rotationZ(30.0 * (i * 3) * 0.0174533),
child: Align(
alignment: Alignment.center,
child: FadeTransition(
opacity: DelayTween(
begin: 0.0,
end: 1.0,
delay: _delays[i],
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.25),
child: _itemBuilder(i),
),
),
),
),
);
}),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(color: widget.color, shape: widget.shape),
);
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
class SpinKitFadingGrid extends StatefulWidget {
const SpinKitFadingGrid({
Key? key,
this.color,
this.shape = BoxShape.circle,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final BoxShape shape;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitFadingGrid> createState() => _SpinKitFadingGridState();
}
class _SpinKitFadingGridState extends State<SpinKitFadingGrid> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return SizedBox.fromSize(
size: Size.square(widget.size),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_circle(0, 1),
SizedBox(width: widget.size / 8),
_circle(1, 1),
SizedBox(width: widget.size / 8),
_circle(2, 2),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: widget.size / 8, width: widget.size),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_circle(3, 4),
SizedBox(width: widget.size / 8),
_circle(4, 1),
SizedBox(width: widget.size / 8),
_circle(5, 2),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
SizedBox(height: widget.size / 8, width: widget.size),
],
),
Row(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
_circle(6, 4),
SizedBox(width: widget.size / 8),
_circle(7, 3),
SizedBox(width: widget.size / 8),
_circle(8, 3),
],
),
],
),
);
}
Widget _circle(int index, int i) {
return FadeTransition(
opacity: DelayTween(
begin: 0.4,
end: 0.9,
delay: 0.3 * (i - 1),
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size / 4),
child: _itemBuilder(index),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(color: widget.color, shape: widget.shape),
);
}
import 'dart:async';
import 'package:flutter/widgets.dart';
class SpinKitFoldingCube extends StatefulWidget {
const SpinKitFoldingCube({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 2400),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitFoldingCube> createState() => _SpinKitFoldingCubeState();
}
class _SpinKitFoldingCubeState extends State<SpinKitFoldingCube> with TickerProviderStateMixin {
late final int _delay;
late AnimationController _controller1;
late AnimationController _controller2;
late AnimationController _controller3;
late AnimationController _controller4;
late Animation<double> _rotate1;
late Animation<double> _rotate2;
late Animation<double> _rotate3;
late Animation<double> _rotate4;
late Timer _timer2;
late Timer _timer3;
late Timer _timer4;
@override
void initState() {
super.initState();
_delay = widget.duration.inMilliseconds ~/ 8;
_controller1 = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
});
_controller2 = widget.controller ?? AnimationController(vsync: this, duration: widget.duration);
_controller3 = widget.controller ?? AnimationController(vsync: this, duration: widget.duration);
_controller4 = widget.controller ?? AnimationController(vsync: this, duration: widget.duration);
final tweenSequence = TweenSequence<double>([
TweenSequenceItem(
tween: ConstantTween<double>(-180.0).chain(
CurveTween(curve: Curves.easeIn),
),
weight: 10.0,
),
TweenSequenceItem(
tween: Tween<double>(begin: -180.0, end: 0.0),
weight: 15.0,
),
TweenSequenceItem(tween: ConstantTween<double>(0.0), weight: 50.0),
TweenSequenceItem(
tween: Tween<double>(begin: 0.0, end: 180.0).chain(
CurveTween(curve: Curves.easeIn),
),
weight: 15.0,
),
TweenSequenceItem(tween: ConstantTween(180.0), weight: 10),
]);
_rotate1 = tweenSequence.animate(_controller1)
..addStatusListener((status) {
if (status == AnimationStatus.completed) {
startAnimation();
}
});
_rotate2 = tweenSequence.animate(_controller2);
_rotate3 = tweenSequence.animate(_controller3);
_rotate4 = tweenSequence.animate(_controller4);
startAnimation();
}
void startAnimation() {
if (mounted) {
_controller1.forward(from: 0.0);
}
_timer2 = Timer(Duration(milliseconds: _delay), () {
if (mounted) {
_controller2.forward(from: 0.0);
}
});
_timer3 = Timer(Duration(milliseconds: _delay * 2), () {
if (mounted) {
_controller3.forward(from: 0.0);
}
});
_timer4 = Timer(Duration(milliseconds: _delay * 3), () {
if (mounted) {
_controller4.forward(from: 0.0);
}
});
}
@override
void dispose() {
_timer2.cancel();
_timer3.cancel();
_timer4.cancel();
if (widget.controller == null) {
_controller1.dispose();
_controller2.dispose();
_controller3.dispose();
_controller4.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Center(
child: Transform.rotate(
angle: -45.0 * 0.0174533,
child: Stack(
children: <Widget>[
_cube(1, animation: _rotate2),
_cube(2, animation: _rotate3),
_cube(3, animation: _rotate4),
_cube(4, animation: _rotate1),
],
),
),
),
),
);
}
Widget _cube(int i, {required Animation<double> animation}) {
final size = widget.size * 0.5, position = widget.size * .5;
final Matrix4 tRotate = Matrix4.identity();
if (animation.value <= 0) {
tRotate.rotateX(animation.value * 0.0174533);
} else {
tRotate.rotateY(animation.value * 0.0174533);
}
return Positioned.fill(
top: position,
left: position,
child: Transform(
transform: Matrix4.rotationZ(90.0 * (i - 1) * 0.0174533),
child: Align(
alignment: Alignment.center,
child: Transform(
transform: tRotate,
alignment: animation.value <= 0 ? Alignment.topCenter : Alignment.centerLeft,
child: Opacity(
opacity: 1.0 - (animation.value.abs() / 180.0),
child: SizedBox.fromSize(
size: Size.square(size),
child: _itemBuilder(i - 1),
),
),
),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(decoration: BoxDecoration(color: widget.color));
}
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
class SpinKitHourGlass extends StatefulWidget {
const SpinKitHourGlass({
Key? key,
required this.color,
this.size = 50.0,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : super(key: key);
final Color color;
final double size;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitHourGlass> createState() => _SpinKitHourGlassState();
}
class _SpinKitHourGlassState extends State<SpinKitHourGlass> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation = Tween(begin: 0.0, end: 8.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 1.0, curve: Curves.easeOut),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Transform(
transform: Matrix4.identity()..rotateZ((_animation.value) * math.pi),
alignment: FractionalOffset.center,
child: CustomPaint(
painter: _HourGlassPainter(weight: 90, color: widget.color),
child: SizedBox.fromSize(size: Size.square(widget.size)),
),
),
);
}
}
class _HourGlassPainter extends CustomPainter {
_HourGlassPainter({required this.weight, required Color color})
: _paint = Paint()
..color = color
..strokeWidth = 1.0;
final Paint _paint;
final double weight;
@override
void paint(Canvas canvas, Size size) {
final rect = Rect.fromPoints(Offset.zero, Offset(size.width, size.height));
canvas.drawArc(rect, 0.0, getRadian(weight), true, _paint);
canvas.drawArc(rect, getRadian(180.0), getRadian(weight), true, _paint);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => true;
double getRadian(double angle) => math.pi / 180 * angle;
}
import 'package:flutter/widgets.dart';
import 'tweens/delay_tween.dart';
enum SpinKitPianoWaveType { start, end, center }
class SpinKitPianoWave extends StatefulWidget {
const SpinKitPianoWave({
Key? key,
this.color,
this.type = SpinKitPianoWaveType.start,
this.size = 50.0,
this.itemBuilder,
this.itemCount = 5,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
assert(itemCount >= 2, 'itemCount Cant be less then 2 '),
super(key: key);
final Color? color;
final int itemCount;
final double size;
final SpinKitPianoWaveType type;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitPianoWave> createState() => _SpinKitPianoWaveState();
}
class _SpinKitPianoWaveState extends State<SpinKitPianoWave> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
final List<double> bars = getAnimationDelay(widget.itemCount);
return Center(
child: SizedBox.fromSize(
size: Size(widget.size * 1.25, widget.size),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(bars.length, (i) {
return DottedScaleXWidget(
scaleX: DelayTween(
begin: .4,
end: 1.0,
delay: bars[i],
).animate(_controller),
child: SizedBox.fromSize(
size: Size(widget.size / widget.itemCount, widget.size),
child: _itemBuilder(i),
),
);
}),
),
),
);
}
List<double> getAnimationDelay(int itemCount) {
switch (widget.type) {
case SpinKitPianoWaveType.start:
return _startAnimationDelay(itemCount);
case SpinKitPianoWaveType.end:
return _endAnimationDelay(itemCount);
case SpinKitPianoWaveType.center:
default:
return _centerAnimationDelay(itemCount);
}
}
List<double> _startAnimationDelay(int count) {
return <double>[
...List<double>.generate(
count ~/ 2,
(index) => -1.0 - (index * 0.1) - 0.1,
).reversed,
if (count.isOdd) -1.0,
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.1) + (count.isOdd ? 0.1 : 0.0),
),
];
}
List<double> _endAnimationDelay(int count) {
return <double>[
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.1) + 0.1,
).reversed,
if (count.isOdd) -1.0,
...List<double>.generate(
count ~/ 2,
(index) => -1.0 - (index * 0.1) - (count.isOdd ? 0.1 : 0.0),
),
];
}
List<double> _centerAnimationDelay(int count) {
return <double>[
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.2) + 0.2,
).reversed,
if (count.isOdd) -1.0,
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.2) + 0.2,
),
];
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(decoration: BoxDecoration(color: widget.color));
}
class DottedScaleXWidget extends AnimatedWidget {
const DottedScaleXWidget({
Key? key,
required Animation<double> scaleX,
required this.child,
this.alignment = Alignment.center,
}) : super(key: key, listenable: scaleX);
final Widget child;
final Alignment alignment;
Animation<double> get scale => listenable as Animation<double>;
@override
Widget build(BuildContext context) {
return Transform(
transform: Matrix4.identity()..scale(scale.value * 0.8, 1.0, 1.0),
alignment: alignment,
child: child,
);
}
}
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
class SpinKitPouringHourGlass extends StatefulWidget {
const SpinKitPouringHourGlass({
Key? key,
required this.color,
this.size = 50.0,
this.duration = const Duration(milliseconds: 2400),
this.strokeWidth,
this.controller,
}) : super(key: key);
final double size;
final Color color;
final Duration duration;
final double? strokeWidth;
final AnimationController? controller;
@override
State<SpinKitPouringHourGlass> createState() => _SpinKitPouringHourGlassState();
}
class _SpinKitPouringHourGlassState extends State<SpinKitPouringHourGlass> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _pouringAnimation;
late Animation<double> _rotationAnimation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_pouringAnimation = CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.9),
)..addListener(() => setState(() {}));
_rotationAnimation = Tween(begin: 0.0, end: 0.5).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.9, 1.0, curve: Curves.fastOutSlowIn),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: RotationTransition(
turns: _rotationAnimation,
child: SizedBox.fromSize(
size: Size.square(widget.size * math.sqrt1_2),
child: CustomPaint(
painter: _HourGlassPaint(
poured: _pouringAnimation.value,
color: widget.color,
strokeWidth: widget.strokeWidth,
),
),
),
),
);
}
}
class _HourGlassPaint extends CustomPainter {
_HourGlassPaint({this.strokeWidth, this.poured, required Color color})
: _paint = Paint()
..style = PaintingStyle.stroke
..color = color,
_powderPaint = Paint()
..style = PaintingStyle.fill
..color = color;
final double? strokeWidth;
final double? poured;
final Paint _paint;
final Paint _powderPaint;
@override
void paint(Canvas canvas, Size size) {
final centerX = size.width / 2;
final halfHeight = size.height / 2;
final hourglassWidth = math.min(centerX * 0.8, halfHeight);
final gapWidth = math.max(3.0, hourglassWidth * 0.05);
final yPadding = gapWidth / 2;
final top = yPadding;
final bottom = size.height - yPadding;
_paint.strokeWidth = strokeWidth ?? gapWidth;
final hourglassPath = Path()
..moveTo(centerX - hourglassWidth, top)
..lineTo(centerX + hourglassWidth, top)
..lineTo(centerX + gapWidth, halfHeight)
..lineTo(centerX + hourglassWidth, bottom)
..lineTo(centerX - hourglassWidth, bottom)
..lineTo(centerX - gapWidth, halfHeight)
..close();
canvas.drawPath(hourglassPath, _paint);
final upperPart = Path()
..moveTo(0.0, top)
..addRect(
Rect.fromLTRB(0.0, halfHeight * poured!, size.width, halfHeight),
);
canvas.drawPath(
Path.combine(PathOperation.intersect, hourglassPath, upperPart),
_powderPaint,
);
final lowerPartPath = Path()
..moveTo(centerX, bottom)
..relativeLineTo(hourglassWidth * poured!, 0.0)
..lineTo(centerX, bottom - poured! * halfHeight - gapWidth)
..lineTo(centerX - hourglassWidth * poured!, bottom)
..close();
final lowerPart = Path.combine(
PathOperation.intersect,
lowerPartPath,
Path()..addRect(Rect.fromLTRB(0.0, halfHeight, size.width, size.height)),
);
canvas.drawPath(lowerPart, _powderPaint);
canvas.drawLine(
Offset(centerX, halfHeight),
Offset(centerX, bottom),
_paint,
);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => true;
}
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
class SpinKitPouringHourGlassRefined extends StatefulWidget {
const SpinKitPouringHourGlassRefined({
Key? key,
required this.color,
this.size = 50.0,
this.duration = const Duration(milliseconds: 2400),
this.strokeWidth,
this.controller,
}) : super(key: key);
final double size;
final Color color;
final Duration duration;
final double? strokeWidth;
final AnimationController? controller;
@override
State<SpinKitPouringHourGlassRefined> createState() => _SpinKitPouringHourGlassRefinedState();
}
class _SpinKitPouringHourGlassRefinedState extends State<SpinKitPouringHourGlassRefined>
with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _pouringAnimation;
late Animation<double> _rotationAnimation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_pouringAnimation = CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.9),
)..addListener(() => setState(() {}));
_rotationAnimation = Tween(begin: 0.0, end: 0.5).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.9, 1.0, curve: Curves.fastOutSlowIn),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: RotationTransition(
turns: _rotationAnimation,
child: SizedBox.fromSize(
size: Size.square(widget.size * math.sqrt1_2),
child: CustomPaint(
painter: _HourGlassPaint(
poured: _pouringAnimation.value,
color: widget.color,
strokeWidth: widget.strokeWidth,
),
),
),
),
);
}
}
class _HourGlassPaint extends CustomPainter {
_HourGlassPaint({this.strokeWidth, this.poured, required Color color})
: _paint = Paint()
..style = PaintingStyle.stroke
..color = color,
_powderPaint = Paint()
..style = PaintingStyle.fill
..color = color;
final double? strokeWidth;
final double? poured;
final Paint _paint;
final Paint _powderPaint;
@override
void paint(Canvas canvas, Size size) {
final centerX = size.width / 2;
final halfHeight = size.height / 2;
final hourglassWidth = math.min(centerX * 0.8, halfHeight);
final gapWidth = math.max(3.0, hourglassWidth * 0.05);
final yPadding = gapWidth / 2;
final top = yPadding;
final bottom = size.height - yPadding;
_paint.strokeWidth = strokeWidth ?? gapWidth;
final hourglassPath = Path()
..moveTo(centerX - hourglassWidth + 2, top)
..lineTo(centerX + hourglassWidth, top)
..arcToPoint(
Offset(centerX + hourglassWidth, top + 7),
radius: const Radius.circular(4),
clockwise: true,
)
..lineTo(centerX + hourglassWidth - 2, top + 8)
..quadraticBezierTo(
centerX + hourglassWidth - 2,
(top + halfHeight) / 2 + 2,
centerX + gapWidth,
halfHeight,
)
..quadraticBezierTo(
centerX + hourglassWidth - 2,
(bottom + halfHeight) / 2,
centerX + hourglassWidth - 2,
bottom - 7,
)
..arcToPoint(
Offset(centerX + hourglassWidth, bottom),
radius: const Radius.circular(4),
clockwise: true,
)
..lineTo(centerX - hourglassWidth, bottom)
..arcToPoint(
Offset(centerX - hourglassWidth, bottom - 7),
radius: const Radius.circular(4),
clockwise: true,
)
..lineTo(centerX - hourglassWidth + 2, bottom - 7)
..quadraticBezierTo(
centerX - hourglassWidth + 2,
(bottom + halfHeight) / 2,
centerX - gapWidth,
halfHeight,
)
..quadraticBezierTo(
centerX - hourglassWidth + 2,
(top + halfHeight) / 2 + 2,
centerX - hourglassWidth + 2,
top + 7,
)
..arcToPoint(
Offset(centerX - hourglassWidth, top),
radius: const Radius.circular(4),
clockwise: true,
)
..close();
canvas.drawPath(hourglassPath, _paint);
final upperPart = Path()
..moveTo(0.0, top)
..addRect(
Rect.fromLTRB(0.0, halfHeight * poured!, size.width, halfHeight),
);
canvas.drawPath(
Path.combine(PathOperation.intersect, hourglassPath, upperPart),
_powderPaint,
);
final lowerPartPath = Path()
..moveTo(centerX, bottom)
..relativeLineTo(hourglassWidth * poured!, 0.0)
..lineTo(centerX, bottom - poured! * halfHeight - gapWidth)
..lineTo(centerX - hourglassWidth * poured!, bottom)
..close();
final lowerPart = Path.combine(
PathOperation.intersect,
lowerPartPath,
Path()..addRect(Rect.fromLTRB(0.0, halfHeight, size.width, size.height)),
);
canvas.drawPath(lowerPart, _powderPaint);
canvas.drawLine(
Offset(centerX, halfHeight),
Offset(centerX, bottom),
_paint,
);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => true;
}
import 'package:flutter/widgets.dart';
class SpinKitPulse extends StatefulWidget {
const SpinKitPulse({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(seconds: 1),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitPulse> createState() => _SpinKitPulseState();
}
class _SpinKitPulseState extends State<SpinKitPulse> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation = CurveTween(curve: Curves.easeInOut).animate(_controller);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Opacity(
opacity: 1.0 - _animation.value,
child: Transform.scale(
scale: _animation.value,
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: _itemBuilder(0),
),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
color: widget.color,
),
);
}
import 'package:flutter/widgets.dart';
import 'tweens/delay_tween.dart';
class SpinKitPulsingGrid extends StatefulWidget {
const SpinKitPulsingGrid({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1500),
this.boxShape,
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final BoxShape? boxShape;
final AnimationController? controller;
@override
State<SpinKitPulsingGrid> createState() => _SpinKitPulsingGridState();
}
class _SpinKitPulsingGridState extends State<SpinKitPulsingGrid> with SingleTickerProviderStateMixin {
static const _gridCount = 3;
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Stack(
children: List.generate(_gridCount * _gridCount, (i) {
final row = (i / _gridCount).floor();
final column = i % _gridCount;
final mid = i == (_gridCount * _gridCount - 1) / 2;
final position = widget.size * .7;
final delay = mid
? .25
: i.isOdd
? .5
: .75;
return Positioned.fill(
left: position * (-1 + column),
top: position * (-1 + row),
child: Align(
alignment: Alignment.center,
child: ScaleTransition(
scale: CurvedAnimation(
parent: DelayTween(
begin: 0.0,
end: 1.0,
delay: delay,
).animate(_controller),
curve: Curves.easeOut,
),
child: SizedBox.fromSize(
size: Size.square(widget.size / 4),
child: _itemBuilder(i),
),
),
),
);
}),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: widget.boxShape ?? BoxShape.circle,
),
);
}
import 'dart:math' as math show pow;
import 'package:flutter/material.dart' show Icons;
import 'package:flutter/widgets.dart';
class SpinKitPumpingHeart extends StatefulWidget {
const SpinKitPumpingHeart({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 2400),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitPumpingHeart> createState() => _SpinKitPumpingHeartState();
}
class _SpinKitPumpingHeartState extends State<SpinKitPumpingHeart> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
_animation = Tween(begin: 1.0, end: 1.25).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 1.0, curve: SpinKitPumpCurve()),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return ScaleTransition(scale: _animation, child: _itemBuilder(0));
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: Icon(Icons.favorite, color: widget.color, size: widget.size);
}
class SpinKitPumpCurve extends Curve {
const SpinKitPumpCurve();
static const magicNumber = 4.54545454;
@override
double transform(double t) {
if (t >= 0.0 && t < 0.22) {
return math.pow(t, 1.0) * magicNumber;
} else if (t >= 0.22 && t < 0.44) {
return 1.0 - (math.pow(t - 0.22, 1.0) * magicNumber);
} else if (t >= 0.44 && t < 0.5) {
return 0.0;
} else if (t >= 0.5 && t < 0.72) {
return math.pow(t - 0.5, 1.0) * (magicNumber / 2);
} else if (t >= 0.72 && t < 0.94) {
return 0.5 - (math.pow(t - 0.72, 1.0) * (magicNumber / 2));
}
return 0.0;
}
}
import 'dart:math';
import 'package:flutter/widgets.dart';
class SpinKitRing extends StatefulWidget {
const SpinKitRing({
Key? key,
required this.color,
this.lineWidth = 7.0,
this.size = 50.0,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : super(key: key);
final Color color;
final double size;
final double lineWidth;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitRing> createState() => _SpinKitRingState();
}
class _SpinKitRingState extends State<SpinKitRing> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation1;
late Animation<double> _animation2;
late Animation<double> _animation3;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation1 = Tween(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 1.0, curve: Curves.linear),
),
);
_animation2 = Tween(begin: -2 / 3, end: 1 / 2).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.5, 1.0, curve: Curves.linear),
),
);
_animation3 = Tween(begin: 0.25, end: 5 / 6).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 1.0, curve: SpinKitRingCurve()),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Transform(
transform: Matrix4.identity()..rotateZ((_animation1.value) * 5 * pi / 6),
alignment: FractionalOffset.center,
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: CustomPaint(
foregroundPainter: RingPainter(
paintWidth: widget.lineWidth,
trackColor: widget.color,
progressPercent: _animation3.value,
startAngle: pi * _animation2.value,
),
),
),
),
);
}
}
class RingPainter extends CustomPainter {
RingPainter({
required this.paintWidth,
this.progressPercent,
this.startAngle,
required this.trackColor,
}) : trackPaint = Paint()
..color = trackColor
..style = PaintingStyle.stroke
..strokeWidth = paintWidth
..strokeCap = StrokeCap.square;
final double paintWidth;
final Paint trackPaint;
final Color trackColor;
final double? progressPercent;
final double? startAngle;
@override
void paint(Canvas canvas, Size size) {
final center = Offset(size.width / 2, size.height / 2);
final radius = (min(size.width, size.height) - paintWidth) / 2;
canvas.drawArc(
Rect.fromCircle(center: center, radius: radius),
startAngle!,
2 * pi * progressPercent!,
false,
trackPaint,
);
}
@override
bool shouldRepaint(CustomPainter oldDelegate) => true;
}
class SpinKitRingCurve extends Curve {
const SpinKitRingCurve();
@override
double transform(double t) => (t <= 0.5) ? 2 * t : 2 * (1 - t);
}
import 'package:flutter/widgets.dart';
class SpinKitRipple extends StatefulWidget {
const SpinKitRipple({
Key? key,
this.color,
this.size = 50.0,
this.borderWidth = 6.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1800),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final double borderWidth;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitRipple> createState() => _SpinKitRippleState();
}
class _SpinKitRippleState extends State<SpinKitRipple> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation1;
late Animation<double> _animation2;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation1 = Tween(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.75, curve: Curves.linear),
),
);
_animation2 = Tween(begin: 0.0, end: 1.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.25, 1.0, curve: Curves.linear),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Stack(
children: <Widget>[
Opacity(
opacity: 1.0 - _animation1.value,
child: Transform.scale(
scale: _animation1.value,
child: _itemBuilder(0),
),
),
Opacity(
opacity: 1.0 - _animation2.value,
child: Transform.scale(
scale: _animation2.value,
child: _itemBuilder(1),
),
),
],
),
);
}
Widget _itemBuilder(int index) {
return SizedBox.fromSize(
size: Size.square(widget.size),
child: widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(
color: widget.color!,
width: widget.borderWidth,
),
),
),
);
}
}
import 'package:flutter/widgets.dart';
class SpinKitRotatingCircle extends StatefulWidget {
const SpinKitRotatingCircle({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitRotatingCircle> createState() => _SpinKitRotatingCircleState();
}
class _SpinKitRotatingCircleState extends State<SpinKitRotatingCircle> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation1;
late Animation<double> _animation2;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation1 = Tween(begin: 0.0, end: 180.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.5, curve: Curves.easeIn),
),
);
_animation2 = Tween(begin: 0.0, end: 180.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.5, 1.0, curve: Curves.easeOut),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Transform(
transform: Matrix4.identity()
..rotateX((0 - _animation1.value) * 0.0174533)
..rotateY((0 - _animation2.value) * 0.0174533),
alignment: FractionalOffset.center,
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: _itemBuilder(0),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: BoxShape.circle,
),
);
}
import 'package:flutter/widgets.dart';
class SpinKitRotatingPlain extends StatefulWidget {
const SpinKitRotatingPlain({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitRotatingPlain> createState() => _SpinKitRotatingPlainState();
}
class _SpinKitRotatingPlainState extends State<SpinKitRotatingPlain> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation1;
late Animation<double> _animation2;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation1 = Tween(begin: 0.0, end: 180.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.5, curve: Curves.easeIn),
),
);
_animation2 = Tween(begin: 0.0, end: 180.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.5, 1.0, curve: Curves.easeOut),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Transform(
transform: Matrix4.identity()
..rotateX((0 - _animation1.value) * 0.0174533)
..rotateY((0 - _animation2.value) * 0.0174533),
alignment: FractionalOffset.center,
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: _itemBuilder(0),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(decoration: BoxDecoration(color: widget.color));
}
import 'dart:math';
import 'package:flutter/widgets.dart';
class SpinKitSpinningCircle extends StatefulWidget {
const SpinKitSpinningCircle({
Key? key,
this.color,
this.shape = BoxShape.circle,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final BoxShape shape;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitSpinningCircle> createState() => _SpinKitSpinningCircleState();
}
class _SpinKitSpinningCircleState extends State<SpinKitSpinningCircle> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation = Tween(begin: 0.0, end: 7.0).animate(
CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 1.0, curve: Curves.easeOut),
),
);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: Transform(
transform: Matrix4.identity()..rotateY((0 - _animation.value) * pi),
alignment: FractionalOffset.center,
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: _itemBuilder(0),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(color: widget.color, shape: widget.shape),
);
}
import 'dart:math' as math;
import 'dart:math';
import 'package:flutter/widgets.dart';
class SpinKitSpinningLines extends StatefulWidget {
const SpinKitSpinningLines({
Key? key,
required this.color,
this.size = 70,
this.lineWidth = 2.0,
this.itemCount = 5,
this.duration = const Duration(milliseconds: 3000),
this.controller,
}) : super(key: key);
final Color color;
final double size;
final double lineWidth;
final int itemCount;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitSpinningLines> createState() => _SpinKitSpinningLinesState();
}
class _SpinKitSpinningLinesState extends State<SpinKitSpinningLines> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animation;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
_animation = Tween(begin: 0.0, end: 1.0).animate(_controller);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: AnimatedBuilder(
builder: (BuildContext context, Widget? child) {
return CustomPaint(
painter: SpinningLinesPainter(
_animation.value,
lineWidth: widget.lineWidth,
color: widget.color,
itemCount: widget.itemCount,
),
child: SizedBox.fromSize(size: Size.square(widget.size)),
);
},
animation: _animation,
),
);
}
}
class SpinningLinesPainter extends CustomPainter {
SpinningLinesPainter(
this.rotateValue, {
required Color color,
required this.lineWidth,
required this.itemCount,
}) : _linePaint = Paint()
..color = color
..strokeWidth = 1
..style = PaintingStyle.fill;
final double rotateValue;
final double lineWidth;
final int itemCount;
final Paint _linePaint;
@override
void paint(Canvas canvas, Size size) {
for (var i = 1; i <= itemCount; i++) {
_drawSpin(canvas, size, _linePaint, i);
}
}
void _drawSpin(Canvas canvas, Size size, Paint paint, int scale) {
final scaledSize = size * (scale / itemCount);
final spinnerSize = Size.square(scaledSize.longestSide);
final startX = spinnerSize.width / 2;
final startY = spinnerSize.topCenter(Offset.zero).dy;
final radius = spinnerSize.width / 4;
final endX = startX;
final endY = spinnerSize.bottomCenter(Offset.zero).dy;
final borderWith = lineWidth;
final scaleFactor = -(scale - (itemCount + 1));
final path = Path();
path.moveTo(startX, startY);
path.arcToPoint(
Offset(endX, endY),
radius: Radius.circular(radius),
clockwise: false,
);
path.arcToPoint(
Offset(startX, startY + borderWith),
radius: Radius.circular(radius),
);
path.lineTo(startX, startY);
canvas.save();
_translateCanvas(canvas, size, spinnerSize);
_rotateCanvas(
canvas,
spinnerSize,
_getRadian(rotateValue * 360 * scaleFactor),
);
canvas.drawPath(path, paint);
canvas.restore();
}
void _translateCanvas(Canvas canvas, Size size, Size spinnerSize) {
final offset = (size - spinnerSize as Offset) / 2;
canvas.translate(offset.dx, offset.dy);
}
/// I use the following resource to calculate rotation of the canvas
/// https://stackoverflow.com/a/54336099/9689717
void _rotateCanvas(Canvas canvas, Size size, double angle) {
final double r = sqrt(size.width * size.width + size.height * size.height) / 2;
final alpha = atan(size.height / size.width);
final beta = alpha + angle;
final shiftY = r * sin(beta);
final shiftX = r * cos(beta);
final translateX = size.width / 2 - shiftX;
final translateY = size.height / 2 - shiftY;
canvas.translate(translateX, translateY);
canvas.rotate(angle);
}
double _getRadian(double angle) => math.pi / 180 * angle;
@override
bool shouldRepaint(SpinningLinesPainter oldDelegate) {
return oldDelegate.rotateValue != rotateValue ||
oldDelegate.lineWidth != lineWidth ||
oldDelegate.itemCount != itemCount ||
oldDelegate._linePaint != _linePaint;
}
}
import 'dart:math' as math;
import 'package:flutter/widgets.dart';
class SpinKitSquareCircle extends StatefulWidget {
const SpinKitSquareCircle({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 500),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitSquareCircle> createState() => _SpinKitSquareCircleState();
}
class _SpinKitSquareCircleState extends State<SpinKitSquareCircle> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _animationCurve;
late Animation<double> _animationSize;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat(reverse: true);
final animation = CurvedAnimation(
parent: _controller,
curve: Curves.easeInOutCubic,
);
_animationCurve = Tween(begin: 1.0, end: 0.0).animate(animation);
_animationSize = Tween(begin: 0.5, end: 1.0).animate(animation);
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
final sizeValue = widget.size * _animationSize.value;
return Center(
child: Transform(
transform: Matrix4.identity()..rotateZ(_animationCurve.value * math.pi),
alignment: FractionalOffset.center,
child: SizedBox.fromSize(
size: Size.square(sizeValue),
child: _itemBuilder(0, 0.5 * sizeValue * _animationCurve.value),
),
),
);
}
Widget _itemBuilder(int index, double curveValue) {
return widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
borderRadius: BorderRadius.all(Radius.circular(curveValue)),
),
);
}
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
class SpinKitThreeBounce extends StatefulWidget {
const SpinKitThreeBounce({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1400),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitThreeBounce> createState() => _SpinKitThreeBounceState();
}
class _SpinKitThreeBounceState extends State<SpinKitThreeBounce> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size(widget.size * 2, widget.size),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: List.generate(3, (i) {
return ScaleTransition(
scale: DelayTween(
begin: 0.0,
end: 1.0,
delay: i * .2,
).animate(_controller),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.5),
child: _itemBuilder(i),
),
);
}),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: BoxShape.circle,
),
);
}
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
class SpinKitThreeInOut extends StatefulWidget {
const SpinKitThreeInOut({
Key? key,
this.color,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 500),
this.delay = const Duration(milliseconds: 50),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
super(key: key);
final Color? color;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final Duration delay;
final AnimationController? controller;
@override
State<SpinKitThreeInOut> createState() => _SpinKitThreeInOutState();
}
class _SpinKitThreeInOutState extends State<SpinKitThreeInOut> with SingleTickerProviderStateMixin {
late AnimationController? _controller;
late List<Widget> _widgets;
Timer? _forwardTimer;
double _lastAnim = 0;
@override
void initState() {
super.initState();
// Create a extra element which is used for the show/hide animation.
_widgets = List.generate(
4,
(i) => SizedBox.fromSize(
size: Size.square(widget.size * 0.5),
child: _itemBuilder(i),
),
);
_controller = widget.controller ?? AnimationController(vsync: this, duration: widget.duration);
_controller!.forward();
_controller!.addListener(() {
if (_lastAnim > _controller!.value) {
if (mounted) {
setState(() => _widgets.insert(0, _widgets.removeLast()));
}
}
_lastAnim = _controller!.value;
if (_controller!.isCompleted) {
_forwardTimer = Timer(
widget.delay,
() => _controller?.forward(from: 0),
);
}
});
}
@override
void dispose() {
if (widget.controller == null) {
_controller?.dispose();
_controller = null;
}
_forwardTimer?.cancel();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size(widget.size * 2, widget.size),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: _widgets
.asMap()
.map((index, value) {
Widget innerWidget = value;
if (index == 0) {
innerWidget = _wrapInAnimatedBuilder(innerWidget);
} else if (index == 3) {
innerWidget = _wrapInAnimatedBuilder(
innerWidget,
inverse: true,
);
}
return MapEntry<int, Widget>(index, innerWidget);
})
.values
.toList(),
),
),
);
}
AnimatedBuilder _wrapInAnimatedBuilder(
Widget innerWidget, {
bool inverse = false,
}) {
return AnimatedBuilder(
animation: _controller!,
child: innerWidget,
builder: (context, inn) {
final value = inverse ? 1 - _controller!.value : _controller!.value;
return SizedBox.fromSize(
size: Size.square(widget.size * 0.5 * value),
child: Opacity(opacity: value, child: inn),
);
},
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(
color: widget.color,
shape: BoxShape.circle,
),
);
}
import 'dart:math' as math show sin, pi;
import 'package:flutter/animation.dart';
class DelayTween extends Tween<double> {
DelayTween({
double? begin,
double? end,
required this.delay,
}) : super(begin: begin, end: end);
final double delay;
@override
double lerp(double t) {
return super.lerp((math.sin((t - delay) * 2 * math.pi) + 1) / 2);
}
@override
double evaluate(Animation<double> animation) => lerp(animation.value);
}
import 'package:flutter/widgets.dart';
class SpinKitWanderingCubes extends StatefulWidget {
const SpinKitWanderingCubes({
Key? key,
this.color,
this.shape = BoxShape.rectangle,
this.size = 50.0,
this.itemBuilder,
this.duration = const Duration(milliseconds: 1800),
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
offset = size * 0.75,
super(key: key);
final Color? color;
final BoxShape shape;
final double offset;
final double size;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
@override
State<SpinKitWanderingCubes> createState() => _SpinKitWanderingCubesState();
}
class _SpinKitWanderingCubesState extends State<SpinKitWanderingCubes> with SingleTickerProviderStateMixin {
late AnimationController _controller;
late Animation<double> _scale1;
late Animation<double> _scale2;
late Animation<double> _scale3;
late Animation<double> _scale4;
late Animation<double> _rotate;
late Animation<double> _translate1;
late Animation<double> _translate2;
late Animation<double> _translate3;
late Animation<double> _translate4;
@override
void initState() {
super.initState();
_controller = AnimationController(vsync: this, duration: widget.duration)
..addListener(() {
if (mounted) {
setState(() {});
}
})
..repeat();
final animation1 = CurvedAnimation(
parent: _controller,
curve: const Interval(0.0, 0.25, curve: Curves.easeInOut),
);
_translate1 = Tween(begin: 0.0, end: widget.offset).animate(animation1);
_scale1 = Tween(begin: 1.0, end: 0.5).animate(animation1);
final animation2 = CurvedAnimation(
parent: _controller,
curve: const Interval(0.25, 0.5, curve: Curves.easeInOut),
);
_translate2 = Tween(begin: 0.0, end: widget.offset).animate(animation2);
_scale2 = Tween(begin: 1.0, end: 2.0).animate(animation2);
final animation3 = CurvedAnimation(
parent: _controller,
curve: const Interval(0.5, 0.75, curve: Curves.easeInOut),
);
_translate3 = Tween(begin: 0.0, end: -widget.offset).animate(animation3);
_scale3 = Tween(begin: 1.0, end: 0.5).animate(animation3);
final animation4 = CurvedAnimation(
parent: _controller,
curve: const Interval(0.75, 1.0, curve: Curves.easeInOut),
);
_translate4 = Tween(begin: 0.0, end: -widget.offset).animate(animation4);
_scale4 = Tween(begin: 1.0, end: 2.0).animate(animation4);
_rotate = Tween(begin: 0.0, end: 360.0).animate(
CurvedAnimation(parent: _controller, curve: Curves.linear),
);
}
@override
void dispose() {
_controller.dispose();
super.dispose();
}
@override
Widget build(BuildContext context) {
return Center(
child: SizedBox.fromSize(
size: Size.square(widget.size),
child: Stack(
children: <Widget>[
_cube(0),
_cube(1, true),
],
),
),
);
}
Widget _cube(int index, [bool offset = false]) {
Matrix4 tTranslate;
if (offset == true) {
tTranslate = Matrix4.identity()
// The negative value reverses the animation direction for the second cube,
// creating a mirrored movement effect compared to the first cube.
..translate(0.0, -_translate1.value)
..translate(_translate2.value, 0.0)
// The negative value for _translate3.value reverses the direction of movement
// to create the wandering effect for the second cube. This ensures the animation
// path mirrors the first cube's movement, resulting in the desired visual behavior.
..translate(0.0, -_translate3.value)
..translate(_translate4.value, 0.0);
} else {
tTranslate = Matrix4.identity()
..translate(0.0, _translate1.value)
..translate(-_translate2.value, 0.0)
..translate(0.0, _translate3.value)
..translate(-_translate4.value, 0.0);
}
return Positioned(
top: offset == true ? widget.offset : 0.0,
left: offset == true ? 0.0 : widget.offset,
child: Transform(
transform: tTranslate,
child: Transform.rotate(
angle: _rotate.value * 0.0174533,
child: Transform(
transform: Matrix4.identity()
..scale(_scale2.value)
..scale(_scale3.value)
..scale(_scale4.value)
..scale(_scale1.value),
child: SizedBox.fromSize(
size: Size.square(widget.size * 0.25),
child: _itemBuilder(index),
),
),
),
),
);
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(
decoration: BoxDecoration(color: widget.color, shape: widget.shape),
);
}
import 'package:flutter/widgets.dart';
import 'package:flutter_spinkit/src/tweens/delay_tween.dart';
enum SpinKitWaveType { start, end, center }
class SpinKitWave extends StatefulWidget {
const SpinKitWave({
Key? key,
this.color,
this.type = SpinKitWaveType.start,
this.size = 50.0,
this.itemBuilder,
this.itemCount = 5,
this.duration = const Duration(milliseconds: 1200),
this.controller,
}) : assert(
!(itemBuilder is IndexedWidgetBuilder && color is Color) && !(itemBuilder == null && color == null),
'You should specify either a itemBuilder or a color',
),
assert(itemCount >= 2, 'itemCount Cant be less then 2 '),
super(key: key);
final Color? color;
final int itemCount;
final double size;
final SpinKitWaveType type;
final IndexedWidgetBuilder? itemBuilder;
final Duration duration;
final AnimationController? controller;
@override
State<SpinKitWave> createState() => _SpinKitWaveState();
}
class _SpinKitWaveState extends State<SpinKitWave> with SingleTickerProviderStateMixin {
late AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(vsync: this, duration: widget.duration))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
final List<double> bars = getAnimationDelay(widget.itemCount);
return Center(
child: SizedBox.fromSize(
size: Size(widget.size * 1.25, widget.size),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: List.generate(bars.length, (i) {
return ScaleYWidget(
scaleY: DelayTween(
begin: .4,
end: 1.0,
delay: bars[i],
).animate(_controller),
child: SizedBox.fromSize(
size: Size(widget.size / widget.itemCount, widget.size),
child: _itemBuilder(i),
),
);
}),
),
),
);
}
List<double> getAnimationDelay(int itemCount) {
switch (widget.type) {
case SpinKitWaveType.start:
return _startAnimationDelay(itemCount);
case SpinKitWaveType.end:
return _endAnimationDelay(itemCount);
case SpinKitWaveType.center:
default:
return _centerAnimationDelay(itemCount);
}
}
List<double> _startAnimationDelay(int count) {
return <double>[
...List<double>.generate(
count ~/ 2,
(index) => -1.0 - (index * 0.1) - 0.1,
).reversed,
if (count.isOdd) -1.0,
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.1) + (count.isOdd ? 0.1 : 0.0),
),
];
}
List<double> _endAnimationDelay(int count) {
return <double>[
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.1) + 0.1,
).reversed,
if (count.isOdd) -1.0,
...List<double>.generate(
count ~/ 2,
(index) => -1.0 - (index * 0.1) - (count.isOdd ? 0.1 : 0.0),
),
];
}
List<double> _centerAnimationDelay(int count) {
return <double>[
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.2) + 0.2,
).reversed,
if (count.isOdd) -1.0,
...List<double>.generate(
count ~/ 2,
(index) => -1.0 + (index * 0.2) + 0.2,
),
];
}
Widget _itemBuilder(int index) => widget.itemBuilder != null
? widget.itemBuilder!(context, index)
: DecoratedBox(decoration: BoxDecoration(color: widget.color));
}
class ScaleYWidget extends AnimatedWidget {
const ScaleYWidget({
Key? key,
required Animation<double> scaleY,
required this.child,
this.alignment = Alignment.center,
}) : super(key: key, listenable: scaleY);
final Widget child;
final Alignment alignment;
Animation<double> get scale => listenable as Animation<double>;
@override
Widget build(BuildContext context) {
return Transform(
transform: Matrix4.identity()..scale(1.0, scale.value, 1.0),
alignment: alignment,
child: child,
);
}
}
import 'dart:math' as math;
import 'package:flutter/material.dart';
class SpinKitWaveSpinner extends StatefulWidget {
const SpinKitWaveSpinner({
Key? key,
required this.color,
this.trackColor = const Color(0x68757575),
this.waveColor = const Color(0x68757575),
this.size = 50,
this.duration = const Duration(milliseconds: 3000),
this.curve = Curves.decelerate,
this.child,
this.controller,
}) : super(key: key);
final Color color;
final Color trackColor;
final Color waveColor;
final double size;
final Duration duration;
final Curve curve;
final Widget? child;
final AnimationController? controller;
@override
State<SpinKitWaveSpinner> createState() => _SpinKitWaveSpinnerState();
}
class _SpinKitWaveSpinnerState extends State<SpinKitWaveSpinner> with SingleTickerProviderStateMixin {
late final AnimationController _controller;
@override
void initState() {
super.initState();
_controller = (widget.controller ?? AnimationController(duration: widget.duration, vsync: this))..repeat();
}
@override
void dispose() {
if (widget.controller == null) {
_controller.dispose();
}
super.dispose();
}
@override
Widget build(BuildContext context) {
return LayoutBuilder(
builder: (context, constraints) {
final size = Size.square(
math.min(
math.min(constraints.maxWidth, constraints.maxHeight),
widget.size,
),
);
final childMaxSize = Size.square(widget.size * 0.7);
return SizedBox.fromSize(
size: size,
child: Stack(
alignment: Alignment.center,
children: [
CustomPaint(
size: size,
painter: SpinkitWaveCustomPaint(
size: size,
color: widget.color,
trackColor: widget.trackColor,
waveColor: widget.waveColor,
curve: widget.curve,
hasChild: widget.child != null,
controller: _controller,
),
),
if (widget.child != null)
Center(
child: ConstrainedBox(
constraints: BoxConstraints.tight(childMaxSize),
child: widget.child,
),
),
],
),
);
},
);
}
}
class SpinkitWaveCustomPaint extends CustomPainter {
SpinkitWaveCustomPaint({
required this.color,
required this.trackColor,
required this.waveColor,
required AnimationController controller,
required bool hasChild,
required Curve curve,
required Size size,
}) : super(repaint: controller) {
_waveMaxRadius = _lineRadius(size.width, 10);
_spinnerAnimation = Tween<double>(begin: 0, end: math.pi * 2).animate(
CurvedAnimation(curve: curve, parent: controller),
);
_waveVerticalShiftAnimation = Tween<double>(
begin: _waveMaxRadius,
end: -_waveMaxRadius,
).animate(
CurvedAnimation(curve: curve, parent: controller),
);
_waveAmplitudeAnimation = !hasChild
? Tween<double>(begin: 0, end: -4).animate(
CurvedAnimation(curve: curve, parent: controller),
)
: null;
}
final Color color;
final Color trackColor;
final Color waveColor;
late final double _waveMaxRadius;
late final Animation<double> _spinnerAnimation;
late final Animation<double> _waveVerticalShiftAnimation;
late final Animation<double>? _waveAmplitudeAnimation;
@override
void paint(Canvas canvas, Size size) {
final spinnerMaxWidth = math.max(6.0, size.width * 0.045);
_drawArc(
size,
canvas,
color: trackColor,
lineRadiusMultiplier: 4,
startAngle: math.pi,
sweepAngle: 2 * math.pi,
strokeWidth: spinnerMaxWidth,
);
_drawArc(
size,
canvas,
color: color,
lineRadiusMultiplier: 4,
startAngle: _spinnerAnimation.value,
sweepAngle: math.pi,
strokeWidth: spinnerMaxWidth,
);
if (_waveAmplitudeAnimation != null) {
_drawWave(size, canvas);
}
}
void _drawArc(
Size size,
Canvas canvas, {
required Color color,
required double lineRadiusMultiplier,
required double startAngle,
required double sweepAngle,
double strokeWidth = 4,
PaintingStyle paintingStyle = PaintingStyle.stroke,
}) {
final lineRadius = _lineRadius(size.width, lineRadiusMultiplier) * 2;
final centerOffset = Offset(size.width / 2, size.width / 2);
canvas.drawArc(
Rect.fromCenter(
center: centerOffset,
width: lineRadius,
height: lineRadius,
),
startAngle,
sweepAngle,
false,
Paint()
..color = color
..strokeWidth = strokeWidth
..style = paintingStyle,
);
}
void _drawWave(Size size, Canvas canvas) {
final bounds = Rect.fromCenter(
center: Offset(size.width / 2, size.height / 2),
width: Size.fromRadius(_waveMaxRadius).width,
height: Size.fromRadius(_waveMaxRadius).width,
);
canvas.save();
canvas.clipRRect(
RRect.fromRectAndRadius(bounds, Radius.circular(_waveMaxRadius)),
);
canvas.translate(size.width / 2, size.height / 2);
final path = Path()..moveTo(-_waveMaxRadius, _waveMaxRadius);
for (int i = -_waveMaxRadius.toInt(); i < _waveMaxRadius.toInt(); i++) {
path.lineTo(
i.toDouble(),
_verticalPoint(
waveLength: _waveMaxRadius * 3.5,
verticalShift: _waveVerticalShiftAnimation.value,
amplitude: size.width * 0.05 * (_waveAmplitudeAnimation?.value ?? 0),
phaseShift: size.width * 0.15,
value: i.toDouble(),
),
);
}
path.lineTo(_waveMaxRadius, _waveMaxRadius);
canvas.drawPath(path, Paint()..color = waveColor);
canvas.restore();
}
double _lineRadius(double width, double multiplier) {
return (width - (multiplier * math.max(2.5, width * 0.015))) / 2;
}
@override
bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
double _verticalPoint({
required double value,
required double verticalShift,
required double amplitude,
required double phaseShift,
required double waveLength,
}) {
final period = 2 * math.pi / waveLength;
return amplitude * math.sin(period * (value + phaseShift)) + verticalShift;
}
test_coverage:
flutter test --no-pub --coverage
build_coverage:
make test_coverage && genhtml -o coverage coverage/lcov.info
open_coverage:
make build_coverage && open coverage/index.html
\ No newline at end of file
name: flutter_spinkit
description: A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit.
version: 5.2.2
homepage: https://github.com/jogboms/flutter_spinkit
environment:
sdk: '>=2.12.0 <4.0.0'
flutter: ">=2.0.0"
dependencies:
flutter:
sdk: flutter
dev_dependencies:
flutter_test:
sdk: flutter
flutter_lints: ^6.0.0
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('ChasingDots', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitChasingDots(), throwsAssertionError);
expect(
() => SpinKitChasingDots(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitChasingDots(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitChasingDots(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitChasingDots(color: Colors.white)),
);
expect(find.byType(SpinKitChasingDots), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitChasingDots(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitChasingDots), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitChasingDots(color: Colors.white)),
);
expect(find.byType(SpinKitChasingDots), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('Circle', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitCircle(), throwsAssertionError);
expect(
() => SpinKitCircle(color: Colors.white, itemBuilder: fakeBoxBuilder),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitCircle(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(() => SpinKitCircle(itemBuilder: null), throwsAssertionError);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitCircle(color: Colors.white)),
);
expect(find.byType(SpinKitCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitCircle(itemBuilder: fakeBoxBuilder)),
);
expect(find.byType(SpinKitCircle), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitCircle(color: Colors.white)),
);
expect(find.byType(SpinKitCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('CubeGrid', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitCubeGrid(), throwsAssertionError);
expect(
() =>
SpinKitCubeGrid(color: Colors.white, itemBuilder: fakeBoxBuilder),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitCubeGrid(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(() => SpinKitCubeGrid(itemBuilder: null), throwsAssertionError);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitCubeGrid(color: Colors.white)),
);
expect(find.byType(SpinKitCubeGrid), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitCubeGrid(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitCubeGrid), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitCubeGrid(color: Colors.white)),
);
expect(find.byType(SpinKitCubeGrid), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('DancingSquare', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitDancingSquare(), throwsAssertionError);
expect(
() => SpinKitDancingSquare(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitDancingSquare(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitDancingSquare(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitDancingSquare(color: Colors.white)),
);
expect(find.byType(SpinKitDancingSquare), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitDancingSquare(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitDancingSquare), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitDancingSquare(color: Colors.white)),
);
expect(find.byType(SpinKitDancingSquare), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('DoubleBounce', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitDoubleBounce(), throwsAssertionError);
expect(
() => SpinKitDoubleBounce(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitDoubleBounce(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitDoubleBounce(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitDoubleBounce(color: Colors.white)),
);
expect(find.byType(SpinKitDoubleBounce), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitDoubleBounce(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitDoubleBounce), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitDoubleBounce(color: Colors.white)),
);
expect(find.byType(SpinKitDoubleBounce), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('DualRing', () {
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitDualRing(color: Colors.white)),
);
expect(find.byType(SpinKitDualRing), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitDualRing(color: Colors.white)),
);
expect(find.byType(SpinKitDualRing), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('FadingCircle', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitFadingCircle(), throwsAssertionError);
expect(
() => SpinKitFadingCircle(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitFadingCircle(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitFadingCircle(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitFadingCircle(color: Colors.white)),
);
expect(find.byType(SpinKitFadingCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitFadingCircle(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitFadingCircle), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitFadingCircle(color: Colors.white)),
);
expect(find.byType(SpinKitFadingCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('FadingCube', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitFadingCube(), throwsAssertionError);
expect(
() => SpinKitFadingCube(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitFadingCube(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitFadingCube(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitFadingCube(color: Colors.white)),
);
expect(find.byType(SpinKitFadingCube), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitFadingCube(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitFadingCube), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitFadingCube(color: Colors.white)),
);
expect(find.byType(SpinKitFadingCube), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('FadingFour', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitFadingFour(), throwsAssertionError);
expect(
() => SpinKitFadingFour(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitFadingFour(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitFadingFour(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitFadingFour(color: Colors.white)),
);
expect(find.byType(SpinKitFadingFour), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitFadingFour(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitFadingFour), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitFadingFour(color: Colors.white)),
);
expect(find.byType(SpinKitFadingFour), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('FadingGrid', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitFadingGrid(), throwsAssertionError);
expect(
() => SpinKitFadingGrid(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitFadingGrid(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitFadingGrid(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitFadingGrid(color: Colors.white)),
);
expect(find.byType(SpinKitFadingGrid), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitFadingGrid(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitFadingGrid), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitFadingGrid(color: Colors.white)),
);
expect(find.byType(SpinKitFadingGrid), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('FoldingCube', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitFoldingCube(), throwsAssertionError);
expect(
() => SpinKitFoldingCube(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitFoldingCube(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitFoldingCube(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitFoldingCube(color: Colors.white)),
);
expect(find.byType(SpinKitFoldingCube), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitFoldingCube(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitFoldingCube), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitFoldingCube(color: Colors.white)),
);
expect(find.byType(SpinKitFoldingCube), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
class FakeBox extends SizedBox {
const FakeBox({Key? key}) : super(key: key);
}
Widget fakeBoxBuilder(BuildContext _, int index) => const FakeBox();
Widget createWidgetsApp(Widget widget) {
return WidgetsApp(
color: Colors.grey[900]!,
home: Center(child: widget),
pageRouteBuilder: <T>(settings, builder) => MaterialPageRoute<T>(
settings: settings,
builder: builder,
),
);
}
Widget createMaterialApp(Widget widget) {
return MaterialApp(theme: ThemeData.dark(), home: Center(child: widget));
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('HourGlass', () {
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitHourGlass(color: Colors.white)),
);
expect(find.byType(SpinKitHourGlass), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitHourGlass(color: Colors.white)),
);
expect(find.byType(SpinKitHourGlass), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('PianoWave', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitPianoWave(), throwsAssertionError);
expect(
() => SpinKitPianoWave(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitPianoWave(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(() => SpinKitPianoWave(itemBuilder: null), throwsAssertionError);
},
);
group('works with types', () {
testWidgets('works with types', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPianoWave(
color: Colors.white,
type: SpinKitPianoWaveType.start,
),
),
);
expect(find.byType(SpinKitPianoWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with types', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPianoWave(
color: Colors.white,
type: SpinKitPianoWaveType.center,
),
),
);
expect(find.byType(SpinKitPianoWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with types', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPianoWave(
color: Colors.white,
type: SpinKitPianoWaveType.end,
),
),
);
expect(find.byType(SpinKitPianoWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitPianoWave(color: Colors.white)),
);
expect(find.byType(SpinKitPianoWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPianoWave(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitPianoWave), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitPianoWave(color: Colors.white)),
);
expect(find.byType(SpinKitPianoWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('PouringHourGlassRefined', () {
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPouringHourGlassRefined(color: Colors.white),
),
);
expect(find.byType(SpinKitPouringHourGlassRefined), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(
const SpinKitPouringHourGlassRefined(color: Colors.white),
),
);
expect(find.byType(SpinKitPouringHourGlassRefined), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('PouringHourglass', () {
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPouringHourGlass(color: Colors.white),
),
);
expect(find.byType(SpinKitPouringHourGlass), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitPouringHourGlass(color: Colors.white)),
);
expect(find.byType(SpinKitPouringHourGlass), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('Pulse', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitPulse(), throwsAssertionError);
expect(
() => SpinKitPulse(color: Colors.white, itemBuilder: fakeBoxBuilder),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitPulse(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(() => SpinKitPulse(itemBuilder: null), throwsAssertionError);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitPulse(color: Colors.white)),
);
expect(find.byType(SpinKitPulse), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitPulse(itemBuilder: fakeBoxBuilder)),
);
expect(find.byType(SpinKitPulse), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitPulse(color: Colors.white)),
);
expect(find.byType(SpinKitPulse), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('PulsingGrid', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitPulsingGrid(), throwsAssertionError);
expect(
() => SpinKitPulsingGrid(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitPulsingGrid(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitPulsingGrid(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitPulsingGrid(color: Colors.white)),
);
expect(find.byType(SpinKitPulsingGrid), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPulsingGrid(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitPulsingGrid), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitPulsingGrid(color: Colors.white)),
);
expect(find.byType(SpinKitPulsingGrid), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('PumpingHeart', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitPumpingHeart(), throwsAssertionError);
expect(
() => SpinKitPumpingHeart(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitPumpingHeart(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitPumpingHeart(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitPumpingHeart(color: Colors.white)),
);
expect(find.byType(SpinKitPumpingHeart), findsOneWidget);
expect(find.byType(Icon), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitPumpingHeart(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitPumpingHeart), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitPumpingHeart(color: Colors.white)),
);
expect(find.byType(SpinKitPumpingHeart), findsOneWidget);
expect(find.byType(Icon), findsWidgets);
tester.verifyTickersWereDisposed();
});
test('on curve', () {
// I really don't know how else to test this. Too many magic numbers
const anotherMagicNumber = .8636363638;
const curve = SpinKitPumpCurve();
expect(curve.transform(0), 0);
expect(
curve.transform(.25),
closeTo(anotherMagicNumber, precisionErrorTolerance),
);
expect(curve.transform(.5), 0);
expect(
curve.transform(.75),
closeTo(anotherMagicNumber / 2, precisionErrorTolerance),
);
expect(curve.transform(1), 0);
});
});
}
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('Ring', () {
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitRing(color: Colors.white)),
);
expect(find.byType(SpinKitRing), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitRing(color: Colors.white)),
);
expect(find.byType(SpinKitRing), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
test('on curve', () {
const curve = SpinKitRingCurve();
expect(curve.transform(1), 0);
expect(curve.transform(.9), closeTo(.2, precisionErrorTolerance));
expect(curve.transform(.5), 1);
expect(curve.transform(.1), closeTo(.2, precisionErrorTolerance));
expect(curve.transform(0), 0);
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('Ripple', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitRipple(), throwsAssertionError);
expect(
() => SpinKitRipple(color: Colors.white, itemBuilder: fakeBoxBuilder),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitRipple(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(() => SpinKitRipple(itemBuilder: null), throwsAssertionError);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitRipple(color: Colors.white)),
);
expect(find.byType(SpinKitRipple), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitRipple(itemBuilder: fakeBoxBuilder)),
);
expect(find.byType(SpinKitRipple), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitRipple(color: Colors.white)),
);
expect(find.byType(SpinKitRipple), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('RotatingCircle', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitRotatingCircle(), throwsAssertionError);
expect(
() => SpinKitRotatingCircle(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitRotatingCircle(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitRotatingCircle(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitRotatingCircle(color: Colors.white)),
);
expect(find.byType(SpinKitRotatingCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitRotatingCircle(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitRotatingCircle), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitRotatingCircle(color: Colors.white)),
);
expect(find.byType(SpinKitRotatingCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('RotatingPlain', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitRotatingPlain(), throwsAssertionError);
expect(
() => SpinKitRotatingPlain(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitRotatingPlain(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitRotatingPlain(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitRotatingPlain(color: Colors.white)),
);
expect(find.byType(SpinKitRotatingPlain), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitRotatingPlain(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitRotatingPlain), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitRotatingPlain(color: Colors.white)),
);
expect(find.byType(SpinKitRotatingPlain), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('Smoke test', (WidgetTester tester) async {
await tester.pumpWidget(
MaterialApp(
theme: ThemeData.dark(),
home: const SingleChildScrollView(
child: Column(
children: [
SpinKitChasingDots(color: Colors.white),
SpinKitCircle(color: Colors.white),
SpinKitSquareCircle(color: Colors.white),
SpinKitDoubleBounce(color: Colors.white),
SpinKitCubeGrid(color: Colors.white),
SpinKitDoubleBounce(color: Colors.white),
SpinKitDualRing(color: Colors.white),
SpinKitFadingCircle(color: Colors.white),
SpinKitFadingCube(color: Colors.white),
SpinKitFadingFour(color: Colors.white),
SpinKitFadingGrid(color: Colors.white),
SpinKitFoldingCube(color: Colors.white),
SpinKitHourGlass(color: Colors.white),
SpinKitPouringHourGlass(color: Colors.white),
SpinKitPouringHourGlassRefined(color: Colors.white),
SpinKitPulse(color: Colors.white),
SpinKitPulsingGrid(color: Colors.white),
SpinKitPumpingHeart(color: Colors.white),
SpinKitRing(color: Colors.white),
SpinKitRipple(color: Colors.white),
SpinKitRotatingCircle(color: Colors.white),
SpinKitRotatingPlain(color: Colors.white),
SpinKitSpinningCircle(color: Colors.white),
SpinKitSpinningLines(color: Colors.white),
SpinKitThreeBounce(color: Colors.white),
SpinKitThreeInOut(color: Colors.white),
SpinKitWanderingCubes(color: Colors.white),
SpinKitWave(color: Colors.white),
SpinKitPianoWave(color: Colors.white),
SpinKitDancingSquare(color: Colors.white),
],
),
),
),
);
await tester.pump();
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('SpinningCircle', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitSpinningCircle(), throwsAssertionError);
expect(
() => SpinKitSpinningCircle(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitSpinningCircle(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitSpinningCircle(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitSpinningCircle(color: Colors.white)),
);
expect(find.byType(SpinKitSpinningCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitSpinningCircle(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitSpinningCircle), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitSpinningCircle(color: Colors.white)),
);
expect(find.byType(SpinKitSpinningCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('SpinningLines', () {
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitSpinningLines(color: Colors.white)),
);
expect(find.byType(SpinKitSpinningLines), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitSpinningLines(color: Colors.white)),
);
expect(find.byType(SpinKitSpinningLines), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('SquareCircle', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitSquareCircle(), throwsAssertionError);
expect(
() => SpinKitSquareCircle(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitSquareCircle(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitSquareCircle(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitSquareCircle(color: Colors.white)),
);
expect(find.byType(SpinKitSquareCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitSquareCircle(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitSquareCircle), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitSquareCircle(color: Colors.white)),
);
expect(find.byType(SpinKitSquareCircle), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('ThreeBounce', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitThreeBounce(), throwsAssertionError);
expect(
() => SpinKitThreeBounce(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitThreeBounce(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitThreeBounce(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitThreeBounce(color: Colors.white)),
);
expect(find.byType(SpinKitThreeBounce), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitThreeBounce(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitThreeBounce), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitThreeBounce(color: Colors.white)),
);
expect(find.byType(SpinKitThreeBounce), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('ThreeInOut', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitThreeInOut(), throwsAssertionError);
expect(
() => SpinKitThreeInOut(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitThreeInOut(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitThreeInOut(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitThreeInOut(color: Colors.white)),
);
expect(find.byType(SpinKitThreeInOut), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitThreeInOut(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitThreeInOut), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitThreeInOut(color: Colors.white)),
);
expect(find.byType(SpinKitThreeInOut), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('WanderingCubes', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitWanderingCubes(), throwsAssertionError);
expect(
() => SpinKitWanderingCubes(
color: Colors.white,
itemBuilder: fakeBoxBuilder,
),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitWanderingCubes(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(
() => SpinKitWanderingCubes(itemBuilder: null),
throwsAssertionError,
);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitWanderingCubes(color: Colors.white)),
);
expect(find.byType(SpinKitWanderingCubes), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitWanderingCubes(itemBuilder: fakeBoxBuilder),
),
);
expect(find.byType(SpinKitWanderingCubes), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitWanderingCubes(color: Colors.white)),
);
expect(find.byType(SpinKitWanderingCubes), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('Test SpinKitWaveSpinner', () {
testWidgets(
'Ensure widget works without Material',
(WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitWaveSpinner(color: Colors.white)),
);
expect(find.byType(SpinKitWaveSpinner), findsOneWidget);
expect(find.byType(CustomPaint), findsWidgets);
tester.verifyTickersWereDisposed();
},
);
testWidgets(
'Ensure Icon is found when SpinKinWaveSpinner has a child of Icon',
(WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(
const SpinKitWaveSpinner(
color: Colors.white,
child: Icon(Icons.flutter_dash, size: 18),
),
),
);
expect(find.byType(Icon), findsOneWidget);
tester.verifyTickersWereDisposed();
},
);
testWidgets(
'Ensure that CustomPaint with SpinkitWaveCustomPaint painter exist',
(WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitWaveSpinner(color: Colors.white)),
);
expect(_findPainter(tester), isA<SpinkitWaveCustomPaint>());
tester.verifyTickersWereDisposed();
},
);
group('Test painter entities', () {
testWidgets(
'Ensure that default paint entities are set correctly',
(WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitWaveSpinner(color: Colors.white)),
);
tester.verifyTickersWereDisposed();
},
);
testWidgets(
'Ensure that entities are set correctly',
(WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(
const SpinKitWaveSpinner(
waveColor: Colors.red,
trackColor: Colors.lightBlue,
color: Colors.pink,
size: 50,
duration: Duration(seconds: 1),
curve: Curves.bounceIn,
),
),
);
final painter = _findPainter(tester);
expect(painter.waveColor, Colors.red);
expect(painter.trackColor, Colors.lightBlue);
expect(painter.color, Colors.pink);
tester.verifyTickersWereDisposed();
},
);
});
});
}
SpinkitWaveCustomPaint _findPainter(WidgetTester tester) {
return (tester.firstWidget(
find.byWidgetPredicate(
(widget) =>
(widget is CustomPaint) && widget.painter is SpinkitWaveCustomPaint,
),
) as CustomPaint)
.painter! as SpinkitWaveCustomPaint;
}
import 'package:flutter/material.dart';
import 'package:flutter_spinkit/flutter_spinkit.dart';
import 'package:flutter_test/flutter_test.dart';
import 'helpers.dart';
void main() {
group('Wave', () {
testWidgets(
'needs either color or itemBuilder',
(WidgetTester tester) async {
expect(() => SpinKitWave(), throwsAssertionError);
expect(
() => SpinKitWave(color: Colors.white, itemBuilder: fakeBoxBuilder),
throwsAssertionError,
);
},
);
testWidgets('needs color to be non-null', (WidgetTester tester) async {
expect(() => SpinKitWave(color: null), throwsAssertionError);
});
testWidgets(
'needs itemBuilder to be non-null',
(WidgetTester tester) async {
expect(() => SpinKitWave(itemBuilder: null), throwsAssertionError);
},
);
testWidgets('works with color', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitWave(color: Colors.white)),
);
expect(find.byType(SpinKitWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('works with itemBuilder', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(const SpinKitWave(itemBuilder: fakeBoxBuilder)),
);
expect(find.byType(SpinKitWave), findsOneWidget);
expect(find.byType(FakeBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
group('works with types', () {
testWidgets('on center', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitWave(
color: Colors.white,
type: SpinKitWaveType.center,
),
),
);
expect(find.byType(SpinKitWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('on start', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitWave(
color: Colors.white,
type: SpinKitWaveType.start,
),
),
);
expect(find.byType(SpinKitWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
testWidgets('on end', (WidgetTester tester) async {
await tester.pumpWidget(
createMaterialApp(
const SpinKitWave(color: Colors.white, type: SpinKitWaveType.end),
),
);
expect(find.byType(SpinKitWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
testWidgets('works without Material', (WidgetTester tester) async {
await tester.pumpWidget(
createWidgetsApp(const SpinKitWave(color: Colors.white)),
);
expect(find.byType(SpinKitWave), findsOneWidget);
expect(find.byType(DecoratedBox), findsWidgets);
tester.verifyTickersWereDisposed();
});
});
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论