├── example
├── ios
│ ├── Flutter
│ │ ├── .last_build_id
│ │ ├── Debug.xcconfig
│ │ ├── Release.xcconfig
│ │ └── AppFrameworkInfo.plist
│ ├── Runner
│ │ ├── Runner-Bridging-Header.h
│ │ ├── Assets.xcassets
│ │ │ ├── LaunchImage.imageset
│ │ │ │ ├── LaunchImage.png
│ │ │ │ ├── LaunchImage@2x.png
│ │ │ │ ├── LaunchImage@3x.png
│ │ │ │ ├── README.md
│ │ │ │ └── Contents.json
│ │ │ └── AppIcon.appiconset
│ │ │ │ ├── Icon-App-20x20@1x.png
│ │ │ │ ├── Icon-App-20x20@2x.png
│ │ │ │ ├── Icon-App-20x20@3x.png
│ │ │ │ ├── Icon-App-29x29@1x.png
│ │ │ │ ├── Icon-App-29x29@2x.png
│ │ │ │ ├── Icon-App-29x29@3x.png
│ │ │ │ ├── Icon-App-40x40@1x.png
│ │ │ │ ├── Icon-App-40x40@2x.png
│ │ │ │ ├── Icon-App-40x40@3x.png
│ │ │ │ ├── Icon-App-60x60@2x.png
│ │ │ │ ├── Icon-App-60x60@3x.png
│ │ │ │ ├── Icon-App-76x76@1x.png
│ │ │ │ ├── Icon-App-76x76@2x.png
│ │ │ │ ├── Icon-App-1024x1024@1x.png
│ │ │ │ ├── Icon-App-83.5x83.5@2x.png
│ │ │ │ └── Contents.json
│ │ ├── AppDelegate.swift
│ │ ├── Base.lproj
│ │ │ ├── Main.storyboard
│ │ │ └── LaunchScreen.storyboard
│ │ └── Info.plist
│ ├── Runner.xcodeproj
│ │ ├── project.xcworkspace
│ │ │ └── contents.xcworkspacedata
│ │ ├── xcshareddata
│ │ │ └── xcschemes
│ │ │ │ └── Runner.xcscheme
│ │ └── project.pbxproj
│ ├── Runner.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── .gitignore
├── android
│ ├── gradle.properties
│ ├── .gitignore
│ ├── app
│ │ ├── src
│ │ │ ├── main
│ │ │ │ ├── res
│ │ │ │ │ ├── mipmap-hdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-mdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── mipmap-xxxhdpi
│ │ │ │ │ │ └── ic_launcher.png
│ │ │ │ │ ├── values
│ │ │ │ │ │ └── styles.xml
│ │ │ │ │ └── drawable
│ │ │ │ │ │ └── launch_background.xml
│ │ │ │ ├── kotlin
│ │ │ │ │ └── com
│ │ │ │ │ │ └── example
│ │ │ │ │ │ └── example_app
│ │ │ │ │ │ └── MainActivity.kt
│ │ │ │ └── AndroidManifest.xml
│ │ │ ├── debug
│ │ │ │ └── AndroidManifest.xml
│ │ │ └── profile
│ │ │ │ └── AndroidManifest.xml
│ │ └── build.gradle
│ ├── gradle
│ │ └── wrapper
│ │ │ └── gradle-wrapper.properties
│ ├── settings.gradle
│ └── build.gradle
├── .metadata
├── .gitignore
├── test
│ └── widget_test.dart
├── README.md
├── pubspec.yaml
├── lib
│ └── main.dart
└── pubspec.lock
├── screenshots
└── loading-button.gif
├── .vscode
└── settings.json
├── analysis_options.yaml
├── .metadata
├── .github
└── workflows
│ ├── publish.yml
│ └── dart.yml
├── LICENSE
├── pubspec.yaml
├── .gitignore
├── README.md
├── CHANGELOG.md
├── pubspec.lock
├── test
└── rounded_loading_button_test.dart
└── lib
└── rounded_loading_button.dart
/example/ios/Flutter/.last_build_id:
--------------------------------------------------------------------------------
1 | 0c48c17867e3f4960b5694f73e7df845
--------------------------------------------------------------------------------
/example/ios/Flutter/Debug.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Flutter/Release.xcconfig:
--------------------------------------------------------------------------------
1 | #include "Generated.xcconfig"
2 |
--------------------------------------------------------------------------------
/example/ios/Runner/Runner-Bridging-Header.h:
--------------------------------------------------------------------------------
1 | #import "GeneratedPluginRegistrant.h"
2 |
--------------------------------------------------------------------------------
/screenshots/loading-button.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/screenshots/loading-button.gif
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "dart.lineLength": 80,
3 | "[dart]": {
4 | "editor.rulers": [80],
5 | "editor.tabSize": 4
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/example/android/gradle.properties:
--------------------------------------------------------------------------------
1 | org.gradle.jvmargs=-Xmx1024M
2 | android.enableR8=true
3 | android.useAndroidX=true
4 | android.enableJetifier=true
5 |
--------------------------------------------------------------------------------
/example/android/.gitignore:
--------------------------------------------------------------------------------
1 | gradle-wrapper.jar
2 | /.gradle
3 | /captures/
4 | /gradlew
5 | /gradlew.bat
6 | /local.properties
7 | GeneratedPluginRegistrant.java
8 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/analysis_options.yaml:
--------------------------------------------------------------------------------
1 | include: package:effective_dart/analysis_options.yaml
2 |
3 | analyzer:
4 | exclude:
5 | # workaround for https://github.com/dart-lang/sdk/issues/42910
6 | - 'example/**'
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/chrisedg87/flutter_rounded_loading_button/HEAD/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png
--------------------------------------------------------------------------------
/example/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Jun 23 08:50:38 CEST 2017
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
7 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: f34bb03d89347a27f317925852b153de715d604c
8 | channel: master
9 |
10 | project_type: package
11 |
--------------------------------------------------------------------------------
/example/.metadata:
--------------------------------------------------------------------------------
1 | # This file tracks properties of this Flutter project.
2 | # Used by Flutter tool to assess capabilities and perform upgrades etc.
3 | #
4 | # This file should be version controlled and should not be manually edited.
5 |
6 | version:
7 | revision: f34bb03d89347a27f317925852b153de715d604c
8 | channel: master
9 |
10 | project_type: app
11 |
--------------------------------------------------------------------------------
/example/android/app/src/debug/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/android/app/src/profile/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md:
--------------------------------------------------------------------------------
1 | # Launch Screen Assets
2 |
3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory.
4 |
5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images.
--------------------------------------------------------------------------------
/example/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
8 |
9 |
--------------------------------------------------------------------------------
/example/ios/Runner/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | import UIKit
2 | import Flutter
3 |
4 | @UIApplicationMain
5 | @objc class AppDelegate: FlutterAppDelegate {
6 | override func application(
7 | _ application: UIApplication,
8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
9 | ) -> Bool {
10 | GeneratedPluginRegistrant.register(with: self)
11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions)
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/example/android/app/src/main/kotlin/com/example/example_app/MainActivity.kt:
--------------------------------------------------------------------------------
1 | package com.example.example_app
2 |
3 | import androidx.annotation.NonNull;
4 | import io.flutter.embedding.android.FlutterActivity
5 | import io.flutter.embedding.engine.FlutterEngine
6 | import io.flutter.plugins.GeneratedPluginRegistrant
7 |
8 | class MainActivity: FlutterActivity() {
9 | override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
10 | GeneratedPluginRegistrant.registerWith(flutterEngine);
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/example/android/app/src/main/res/drawable/launch_background.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
12 |
13 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "LaunchImage.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "filename" : "LaunchImage@2x.png",
11 | "scale" : "2x"
12 | },
13 | {
14 | "idiom" : "universal",
15 | "filename" : "LaunchImage@3x.png",
16 | "scale" : "3x"
17 | }
18 | ],
19 | "info" : {
20 | "version" : 1,
21 | "author" : "xcode"
22 | }
23 | }
24 |
--------------------------------------------------------------------------------
/.github/workflows/publish.yml:
--------------------------------------------------------------------------------
1 | # .github/workflows/publish.yml
2 | name: Publish to pub.dev
3 |
4 | on:
5 | push:
6 | tags:
7 | - '[0-9]+.[0-9]+.[0-9]+'
8 |
9 | jobs:
10 | publish:
11 | permissions:
12 | id-token: write
13 | runs-on: ubuntu-latest
14 | steps:
15 | - uses: actions/checkout@v3
16 | - uses: subosito/flutter-action@v1
17 | with:
18 | channel: 'stable'
19 | - name: Install dependencies
20 | run: flutter pub get
21 | - name: Publish
22 | run: flutter pub publish --force
--------------------------------------------------------------------------------
/example/android/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app'
2 |
3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()
4 |
5 | def plugins = new Properties()
6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
7 | if (pluginsFile.exists()) {
8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
9 | }
10 |
11 | plugins.each { name, path ->
12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
13 | include ":$name"
14 | project(":$name").projectDir = pluginDirectory
15 | }
16 |
--------------------------------------------------------------------------------
/.github/workflows/dart.yml:
--------------------------------------------------------------------------------
1 | name: build
2 |
3 | on: [push, pull_request]
4 |
5 | jobs:
6 | build-and-test:
7 | runs-on: ubuntu-latest
8 | steps:
9 | - uses: actions/checkout@v1
10 | - uses: actions/setup-java@v1
11 | with:
12 | java-version: '12.x'
13 | - uses: subosito/flutter-action@v1
14 | with:
15 | channel: 'stable'
16 | - run: flutter pub get
17 | - run: flutter analyze
18 | - run: flutter test --coverage
19 | - uses: codecov/codecov-action@v1.0.15
20 | with:
21 | token: ${{secrets.CODECOV_TOKEN}}
22 | file: ./coverage/lcov.info
23 |
--------------------------------------------------------------------------------
/example/ios/.gitignore:
--------------------------------------------------------------------------------
1 | *.mode1v3
2 | *.mode2v3
3 | *.moved-aside
4 | *.pbxuser
5 | *.perspectivev3
6 | **/*sync/
7 | .sconsign.dblite
8 | .tags*
9 | **/.vagrant/
10 | **/DerivedData/
11 | Icon?
12 | **/Pods/
13 | **/.symlinks/
14 | profile
15 | xcuserdata
16 | **/.generated/
17 | Flutter/App.framework
18 | Flutter/Flutter.framework
19 | Flutter/Flutter.podspec
20 | Flutter/Generated.xcconfig
21 | Flutter/app.flx
22 | Flutter/app.zip
23 | Flutter/flutter_assets/
24 | Flutter/flutter_export_environment.sh
25 | ServiceDefinitions.json
26 | Runner/GeneratedPluginRegistrant.*
27 |
28 | # Exceptions to above rules.
29 | !default.mode1v3
30 | !default.mode2v3
31 | !default.pbxuser
32 | !default.perspectivev3
33 |
--------------------------------------------------------------------------------
/example/android/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | ext.kotlin_version = '1.3.50'
3 | repositories {
4 | google()
5 | jcenter()
6 | }
7 |
8 | dependencies {
9 | classpath 'com.android.tools.build:gradle:3.5.0'
10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11 | }
12 | }
13 |
14 | allprojects {
15 | repositories {
16 | google()
17 | jcenter()
18 | }
19 | }
20 |
21 | rootProject.buildDir = '../build'
22 | subprojects {
23 | project.buildDir = "${rootProject.buildDir}/${project.name}"
24 | }
25 | subprojects {
26 | project.evaluationDependsOn(':app')
27 | }
28 |
29 | task clean(type: Delete) {
30 | delete rootProject.buildDir
31 | }
32 |
--------------------------------------------------------------------------------
/example/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | /build/
32 |
33 | # Web related
34 | lib/generated_plugin_registrant.dart
35 |
36 | # Exceptions to above rules.
37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
38 |
--------------------------------------------------------------------------------
/example/ios/Flutter/AppFrameworkInfo.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | App
9 | CFBundleIdentifier
10 | io.flutter.flutter.app
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | App
15 | CFBundlePackageType
16 | FMWK
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1.0
23 | MinimumOSVersion
24 | 9.0
25 |
26 |
27 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Chris Edgington
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/example/test/widget_test.dart:
--------------------------------------------------------------------------------
1 | // This is a basic Flutter widget test.
2 | //
3 | // To perform an interaction with a widget in your test, use the WidgetTester
4 | // utility that Flutter provides. For example, you can send tap and scroll
5 | // gestures. You can also use WidgetTester to find child widgets in the widget
6 | // tree, read text, and verify that the values of widget properties are correct.
7 |
8 | // import 'package:flutter/material.dart';
9 | // import 'package:flutter_test/flutter_test.dart';
10 |
11 | // import 'package:example_app/main.dart';
12 |
13 | void main() {
14 | // testWidgets('Counter increments smoke test', (WidgetTester tester) async {
15 | // // Build our app and trigger a frame.
16 | // await tester.pumpWidget(MyApp());
17 |
18 | // // Verify that our counter starts at 0.
19 | // expect(find.text('0'), findsOneWidget);
20 | // expect(find.text('1'), findsNothing);
21 |
22 | // // Tap the '+' icon and trigger a frame.
23 | // await tester.tap(find.byIcon(Icons.add));
24 | // await tester.pump();
25 |
26 | // // Verify that our counter has incremented.
27 | // expect(find.text('0'), findsNothing);
28 | // expect(find.text('1'), findsOneWidget);
29 | // });
30 | }
31 |
--------------------------------------------------------------------------------
/example/README.md:
--------------------------------------------------------------------------------
1 | # example_app
2 |
3 | class _MyHomePageState extends State {
4 |
5 | final RoundedLoadingButtonController _btnController = new RoundedLoadingButtonController();
6 |
7 | void _doSomething() async {
8 | Timer(Duration(seconds: 3), () {
9 | _btnController.success();
10 | });
11 | }
12 |
13 | @override
14 | Widget build(BuildContext context) {
15 |
16 | return Scaffold(
17 | appBar: AppBar(
18 |
19 | title: Text(widget.title),
20 | ),
21 | body: Center(
22 | child: Column(
23 |
24 | mainAxisAlignment: MainAxisAlignment.center,
25 | children: [
26 | RoundedLoadingButton(
27 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
28 | controller: _btnController,
29 | onPressed: _doSomething,
30 | )
31 | ],
32 | ),
33 | )
34 | );
35 | }
36 | }
37 |
38 | ## Getting Started
39 |
40 | This project is a starting point for a Flutter application.
41 |
42 | A few resources to get you started if this is your first Flutter project:
43 |
44 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab)
45 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook)
46 |
47 | For help getting started with Flutter, view our
48 | [online documentation](https://flutter.dev/docs), which offers tutorials,
49 | samples, guidance on mobile development, and a full API reference.
50 |
--------------------------------------------------------------------------------
/example/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
3 |
8 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
26 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/example/ios/Runner/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | example_app
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | $(FLUTTER_BUILD_NAME)
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | $(FLUTTER_BUILD_NUMBER)
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIMainStoryboardFile
28 | Main
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UIViewControllerBasedStatusBarAppearance
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: rounded_loading_button
2 | description: A simple implementation of an animated loading button widget for Flutter
3 | version: 2.1.1
4 | homepage: https://github.com/chrisedg87/flutter_rounded_loading_button
5 |
6 | environment:
7 | sdk: '>=2.15.0 <3.0.0'
8 |
9 | dependencies:
10 | flutter:
11 | sdk: flutter
12 |
13 | rxdart: '>=0.26.0 <0.28.0'
14 |
15 | dev_dependencies:
16 | flutter_test:
17 | sdk: flutter
18 | effective_dart: ^1.3.1
19 |
20 | # For information on the generic Dart part of this file, see the
21 | # following page: https://dart.dev/tools/pub/pubspec
22 |
23 | # The following section is specific to Flutter.
24 | flutter:
25 |
26 | # To add assets to your package, add an assets section, like this:
27 | # assets:
28 | # - images/a_dot_burr.jpeg
29 | # - images/a_dot_ham.jpeg
30 | #
31 | # For details regarding assets in packages, see
32 | # https://flutter.dev/assets-and-images/#from-packages
33 | #
34 | # An image asset can refer to one or more resolution-specific "variants", see
35 | # https://flutter.dev/assets-and-images/#resolution-aware.
36 |
37 | # To add custom fonts to your package, add a fonts section here,
38 | # in this "flutter" section. Each entry in this list should have a
39 | # "family" key with the font family name, and a "fonts" key with a
40 | # list giving the asset and other descriptors for the font. For
41 | # example:
42 | # fonts:
43 | # - family: Schyler
44 | # fonts:
45 | # - asset: fonts/Schyler-Regular.ttf
46 | # - asset: fonts/Schyler-Italic.ttf
47 | # style: italic
48 | # - family: Trajan Pro
49 | # fonts:
50 | # - asset: fonts/TrajanPro.ttf
51 | # - asset: fonts/TrajanPro_Bold.ttf
52 | # weight: 700
53 | #
54 | # For details regarding fonts in packages, see
55 | # https://flutter.dev/custom-fonts/#from-packages
56 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Miscellaneous
2 | *.class
3 | *.log
4 | *.pyc
5 | *.swp
6 | .DS_Store
7 | .atom/
8 | .buildlog/
9 | .history
10 | .svn/
11 |
12 | # IntelliJ related
13 | *.iml
14 | *.ipr
15 | *.iws
16 | .idea/
17 |
18 | # The .vscode folder contains launch configuration and tasks you configure in
19 | # VS Code which you may wish to be included in version control, so this line
20 | # is commented out by default.
21 | #.vscode/
22 |
23 | # Flutter/Dart/Pub related
24 | **/doc/api/
25 | .dart_tool/
26 | .flutter-plugins
27 | .flutter-plugins-dependencies
28 | .packages
29 | .pub-cache/
30 | .pub/
31 | build/
32 |
33 | # Android related
34 | **/android/**/gradle-wrapper.jar
35 | **/android/.gradle
36 | **/android/captures/
37 | **/android/gradlew
38 | **/android/gradlew.bat
39 | **/android/local.properties
40 | **/android/**/GeneratedPluginRegistrant.java
41 |
42 | # iOS/XCode related
43 | **/ios/**/*.mode1v3
44 | **/ios/**/*.mode2v3
45 | **/ios/**/*.moved-aside
46 | **/ios/**/*.pbxuser
47 | **/ios/**/*.perspectivev3
48 | **/ios/**/*sync/
49 | **/ios/**/.sconsign.dblite
50 | **/ios/**/.tags*
51 | **/ios/**/.vagrant/
52 | **/ios/**/DerivedData/
53 | **/ios/**/Icon?
54 | **/ios/**/Pods/
55 | **/ios/**/.symlinks/
56 | **/ios/**/profile
57 | **/ios/**/xcuserdata
58 | **/ios/.generated/
59 | **/ios/Flutter/App.framework
60 | **/ios/Flutter/Flutter.framework
61 | **/ios/Flutter/Flutter.podspec
62 | **/ios/Flutter/Generated.xcconfig
63 | **/ios/Flutter/app.flx
64 | **/ios/Flutter/app.zip
65 | **/ios/Flutter/flutter_assets/
66 | **/ios/Flutter/flutter_export_environment.sh
67 | **/ios/ServiceDefinitions.json
68 | **/ios/Runner/GeneratedPluginRegistrant.*
69 |
70 | # Exceptions to above rules.
71 | !**/ios/**/default.mode1v3
72 | !**/ios/**/default.mode2v3
73 | !**/ios/**/default.pbxuser
74 | !**/ios/**/default.perspectivev3
75 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
76 |
77 | # Coverage
78 | coverage/
--------------------------------------------------------------------------------
/example/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | def localProperties = new Properties()
2 | def localPropertiesFile = rootProject.file('local.properties')
3 | if (localPropertiesFile.exists()) {
4 | localPropertiesFile.withReader('UTF-8') { reader ->
5 | localProperties.load(reader)
6 | }
7 | }
8 |
9 | def flutterRoot = localProperties.getProperty('flutter.sdk')
10 | if (flutterRoot == null) {
11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12 | }
13 |
14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15 | if (flutterVersionCode == null) {
16 | flutterVersionCode = '1'
17 | }
18 |
19 | def flutterVersionName = localProperties.getProperty('flutter.versionName')
20 | if (flutterVersionName == null) {
21 | flutterVersionName = '1.0'
22 | }
23 |
24 | apply plugin: 'com.android.application'
25 | apply plugin: 'kotlin-android'
26 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27 |
28 | android {
29 | compileSdkVersion 28
30 |
31 | sourceSets {
32 | main.java.srcDirs += 'src/main/kotlin'
33 | }
34 |
35 | lintOptions {
36 | disable 'InvalidPackage'
37 | }
38 |
39 | defaultConfig {
40 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
41 | applicationId "com.example.example_app"
42 | minSdkVersion 16
43 | targetSdkVersion 28
44 | versionCode flutterVersionCode.toInteger()
45 | versionName flutterVersionName
46 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
47 | }
48 |
49 | buildTypes {
50 | release {
51 | // TODO: Add your own signing config for the release build.
52 | // Signing with the debug keys for now, so `flutter run --release` works.
53 | signingConfig signingConfigs.debug
54 | }
55 | }
56 | }
57 |
58 | flutter {
59 | source '../..'
60 | }
61 |
62 | dependencies {
63 | implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
64 | testImplementation 'junit:junit:4.12'
65 | androidTestImplementation 'androidx.test:runner:1.1.1'
66 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
67 | }
68 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # rounded_loading_button
2 |
3 | [](https://pub.dev/packages/rounded_loading_button)
4 | 
5 | [](https://codecov.io/gh/chrisedg87/flutter_rounded_loading_button)
6 | [](https://pub.dev/packages/effective_dart)
7 | [](https://opensource.org/licenses/MIT)
8 | [](https://github.com/Solido/awesome-flutter)
9 |
10 | RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.
11 |
12 | 
13 |
14 | ## Installation
15 |
16 | Add this to your pubspec.yaml:
17 |
18 | dependencies:
19 | rounded_loading_button: ^2.0.8
20 |
21 | ## Usage
22 |
23 | ### Import
24 |
25 | import 'package:rounded_loading_button/rounded_loading_button.dart';
26 |
27 | ### Simple Implementation
28 |
29 | final RoundedLoadingButtonController _btnController = RoundedLoadingButtonController();
30 |
31 | void _doSomething() async {
32 | Timer(Duration(seconds: 3), () {
33 | _btnController.success();
34 | });
35 | }
36 |
37 | RoundedLoadingButton(
38 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
39 | controller: _btnController,
40 | onPressed: _doSomething,
41 | )
42 |
43 | The Rounded Loading Button has many configurable properties, including:
44 |
45 | * `duration` - The duration of the button animation
46 | * `loaderSize` - The size of the CircularProgressIndicator
47 | * `animateOnTap` - Whether to trigger the loading animation on the tap event
48 | * `resetAfterDuration` - Reset the animation after specified duration, defaults to 15 seconds
49 | * `errorColor` - The color of the button when it is in the error state
50 | * `successColor` - The color of the button when it is in the success state
51 | * `successIcon` - The icon for the success state
52 | * `failedIcon` - The icon for the failed state
53 |
54 |
55 | ## Contributions
56 |
57 | All contributions are welcome!
58 |
59 |
--------------------------------------------------------------------------------
/example/ios/Runner/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/example/pubspec.yaml:
--------------------------------------------------------------------------------
1 | name: example_app
2 | description: A new Flutter project.
3 |
4 | # The following defines the version and build number for your application.
5 | # A version number is three numbers separated by dots, like 1.2.43
6 | # followed by an optional build number separated by a +.
7 | # Both the version and the builder number may be overridden in flutter
8 | # build by specifying --build-name and --build-number, respectively.
9 | # In Android, build-name is used as versionName while build-number used as versionCode.
10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
12 | # Read more about iOS versioning at
13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
14 | version: 2.0.3+3
15 |
16 | publish_to: none
17 |
18 | environment:
19 | sdk: ">=2.15.0 <3.0.0"
20 |
21 | dependencies:
22 | flutter:
23 | sdk: flutter
24 |
25 | # The following adds the Cupertino Icons font to your application.
26 | # Use with the CupertinoIcons class for iOS style icons.
27 | cupertino_icons: ^1.0.2
28 | rounded_loading_button:
29 | path: ../
30 |
31 | dev_dependencies:
32 | flutter_test:
33 | sdk: flutter
34 |
35 |
36 | # For information on the generic Dart part of this file, see the
37 | # following page: https://dart.dev/tools/pub/pubspec
38 |
39 | # The following section is specific to Flutter.
40 | flutter:
41 |
42 | # The following line ensures that the Material Icons font is
43 | # included with your application, so that you can use the icons in
44 | # the material Icons class.
45 | uses-material-design: true
46 |
47 | # To add assets to your application, add an assets section, like this:
48 | # assets:
49 | # - images/a_dot_burr.jpeg
50 | # - images/a_dot_ham.jpeg
51 |
52 | # An image asset can refer to one or more resolution-specific "variants", see
53 | # https://flutter.dev/assets-and-images/#resolution-aware.
54 |
55 | # For details regarding adding assets from package dependencies, see
56 | # https://flutter.dev/assets-and-images/#from-packages
57 |
58 | # To add custom fonts to your application, add a fonts section here,
59 | # in this "flutter" section. Each entry in this list should have a
60 | # "family" key with the font family name, and a "fonts" key with a
61 | # list giving the asset and other descriptors for the font. For
62 | # example:
63 | # fonts:
64 | # - family: Schyler
65 | # fonts:
66 | # - asset: fonts/Schyler-Regular.ttf
67 | # - asset: fonts/Schyler-Italic.ttf
68 | # style: italic
69 | # - family: Trajan Pro
70 | # fonts:
71 | # - asset: fonts/TrajanPro.ttf
72 | # - asset: fonts/TrajanPro_Bold.ttf
73 | # weight: 700
74 | #
75 | # For details regarding fonts from package dependencies,
76 | # see https://flutter.dev/custom-fonts/#from-packages
77 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## [2.1.0]
2 | * Fixed issues related to late initialisation in the controller (Programmatically stop and start fails #47)
3 | * Added safety against bad state errors (Unhandled Exception: Bad state: Cannot add new events after calling close #48)
4 | * Resolved a bunch of lints and code style issues
5 |
6 | ## [2.0.9]
7 | * Added ability to listen to and query button status from the controller
8 |
9 | ## [2.0.8]
10 | * Added success and error icons parameters
11 | * Added completion curve and duration parameters
12 |
13 | ## [2.0.7]
14 | * Updated rxdart constraints
15 | * Updated the screenshot
16 |
17 | ## [2.0.6]
18 | * Fixed bug with state key
19 | * Added the auto reset functionality
20 |
21 | ## [2.0.5]
22 | * Fixed disabled colour issue
23 |
24 | ## [2.0.4]
25 | * Fixed disabled issue
26 |
27 | ## [2.0.3]
28 | * Style effective dart
29 |
30 | ## [2.0.2]
31 | * Thanks for [joaovvrodrigues](https://github.com/joaovvrodrigues) ([#32](https://github.com/chrisedg87/flutter_rounded_loading_button/pull/32) by [joaovvrodrigues](https://github.com/joaovvrodrigues)).
32 | * Fix button animation!
33 |
34 | ## [2.0.1]
35 | * Thanks for [joaovvrodrigues](https://github.com/joaovvrodrigues) ([#32](https://github.com/chrisedg87/flutter_rounded_loading_button/pull/32) by [joaovvrodrigues](https://github.com/joaovvrodrigues)).
36 | * Added compatibility with NullSafety
37 | * Removed RaisedButton deprecated
38 | * Add new ElevatedButton
39 | * Update dependencies
40 |
41 | ## [1.0.18]
42 | * Updated dependencies
43 |
44 | ## [1.0.17]
45 | * Allow to change color when the button is disabled
46 |
47 | ## [1.0.16]
48 | * Add custom button color option for success state
49 | * Add option to resize the CircularProgressIndicator
50 |
51 | ## [1.0.15]
52 |
53 | * Added custom color option for error state
54 |
55 | ## [1.0.14]
56 |
57 | * Updated dartrx package version
58 |
59 | ## [1.0.13]
60 |
61 | * Downgraded rxdart dependency
62 |
63 | ## [1.0.12]
64 |
65 | * Added documentation
66 | * Formatting fixes
67 |
68 | ## [1.0.11]
69 |
70 | * Fix for print statement
71 |
72 | ## [1.0.10]
73 |
74 | * Added configurable button elevation
75 |
76 | ## [1.0.9]
77 |
78 | * Added configurable border radius
79 | * Added configurable animation duration
80 |
81 | ## [1.0.8]
82 |
83 | * README fix
84 | * Colour now inherits from theme
85 |
86 | ## [1.0.7]
87 |
88 | * Added configurable circular progress color #8
89 |
90 | ## [1.0.6]
91 |
92 | * Fixed the issue were BehaviorSubject was not closed correctly
93 | * Fixed the animation reset bug #6
94 |
95 | ## [1.0.5]
96 |
97 | * Fixed loading width bug #3
98 | * Fixed padding issue with the loading spinner
99 | * Fixed button disabled bug #4
100 |
101 | ## [1.0.4]
102 |
103 | * Added animation disposal
104 | * Added configurable width
105 | * Added configurable animation on tapped
106 |
107 | ## [1.0.3]
108 |
109 | * Example test updates
110 |
111 | ## [1.0.2]
112 |
113 | * Example updates
114 |
115 | ## [1.0.1]
116 |
117 | * Format changes
118 | * Description update
119 |
120 | ## [1.0.0]
121 |
122 | * Initial release.
123 |
--------------------------------------------------------------------------------
/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "size" : "20x20",
5 | "idiom" : "iphone",
6 | "filename" : "Icon-App-20x20@2x.png",
7 | "scale" : "2x"
8 | },
9 | {
10 | "size" : "20x20",
11 | "idiom" : "iphone",
12 | "filename" : "Icon-App-20x20@3x.png",
13 | "scale" : "3x"
14 | },
15 | {
16 | "size" : "29x29",
17 | "idiom" : "iphone",
18 | "filename" : "Icon-App-29x29@1x.png",
19 | "scale" : "1x"
20 | },
21 | {
22 | "size" : "29x29",
23 | "idiom" : "iphone",
24 | "filename" : "Icon-App-29x29@2x.png",
25 | "scale" : "2x"
26 | },
27 | {
28 | "size" : "29x29",
29 | "idiom" : "iphone",
30 | "filename" : "Icon-App-29x29@3x.png",
31 | "scale" : "3x"
32 | },
33 | {
34 | "size" : "40x40",
35 | "idiom" : "iphone",
36 | "filename" : "Icon-App-40x40@2x.png",
37 | "scale" : "2x"
38 | },
39 | {
40 | "size" : "40x40",
41 | "idiom" : "iphone",
42 | "filename" : "Icon-App-40x40@3x.png",
43 | "scale" : "3x"
44 | },
45 | {
46 | "size" : "60x60",
47 | "idiom" : "iphone",
48 | "filename" : "Icon-App-60x60@2x.png",
49 | "scale" : "2x"
50 | },
51 | {
52 | "size" : "60x60",
53 | "idiom" : "iphone",
54 | "filename" : "Icon-App-60x60@3x.png",
55 | "scale" : "3x"
56 | },
57 | {
58 | "size" : "20x20",
59 | "idiom" : "ipad",
60 | "filename" : "Icon-App-20x20@1x.png",
61 | "scale" : "1x"
62 | },
63 | {
64 | "size" : "20x20",
65 | "idiom" : "ipad",
66 | "filename" : "Icon-App-20x20@2x.png",
67 | "scale" : "2x"
68 | },
69 | {
70 | "size" : "29x29",
71 | "idiom" : "ipad",
72 | "filename" : "Icon-App-29x29@1x.png",
73 | "scale" : "1x"
74 | },
75 | {
76 | "size" : "29x29",
77 | "idiom" : "ipad",
78 | "filename" : "Icon-App-29x29@2x.png",
79 | "scale" : "2x"
80 | },
81 | {
82 | "size" : "40x40",
83 | "idiom" : "ipad",
84 | "filename" : "Icon-App-40x40@1x.png",
85 | "scale" : "1x"
86 | },
87 | {
88 | "size" : "40x40",
89 | "idiom" : "ipad",
90 | "filename" : "Icon-App-40x40@2x.png",
91 | "scale" : "2x"
92 | },
93 | {
94 | "size" : "76x76",
95 | "idiom" : "ipad",
96 | "filename" : "Icon-App-76x76@1x.png",
97 | "scale" : "1x"
98 | },
99 | {
100 | "size" : "76x76",
101 | "idiom" : "ipad",
102 | "filename" : "Icon-App-76x76@2x.png",
103 | "scale" : "2x"
104 | },
105 | {
106 | "size" : "83.5x83.5",
107 | "idiom" : "ipad",
108 | "filename" : "Icon-App-83.5x83.5@2x.png",
109 | "scale" : "2x"
110 | },
111 | {
112 | "size" : "1024x1024",
113 | "idiom" : "ios-marketing",
114 | "filename" : "Icon-App-1024x1024@1x.png",
115 | "scale" : "1x"
116 | }
117 | ],
118 | "info" : {
119 | "version" : 1,
120 | "author" : "xcode"
121 | }
122 | }
123 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.2.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.16.0"
46 | effective_dart:
47 | dependency: "direct dev"
48 | description:
49 | name: effective_dart
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.3.2"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.3.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | matcher:
71 | dependency: transitive
72 | description:
73 | name: matcher
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.12.11"
77 | material_color_utilities:
78 | dependency: transitive
79 | description:
80 | name: material_color_utilities
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "0.1.4"
84 | meta:
85 | dependency: transitive
86 | description:
87 | name: meta
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.7.0"
91 | path:
92 | dependency: transitive
93 | description:
94 | name: path
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.8.1"
98 | rxdart:
99 | dependency: "direct main"
100 | description:
101 | name: rxdart
102 | url: "https://pub.dartlang.org"
103 | source: hosted
104 | version: "0.27.3"
105 | sky_engine:
106 | dependency: transitive
107 | description: flutter
108 | source: sdk
109 | version: "0.0.99"
110 | source_span:
111 | dependency: transitive
112 | description:
113 | name: source_span
114 | url: "https://pub.dartlang.org"
115 | source: hosted
116 | version: "1.8.2"
117 | stack_trace:
118 | dependency: transitive
119 | description:
120 | name: stack_trace
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.10.0"
124 | stream_channel:
125 | dependency: transitive
126 | description:
127 | name: stream_channel
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "2.1.0"
131 | string_scanner:
132 | dependency: transitive
133 | description:
134 | name: string_scanner
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "1.1.0"
138 | term_glyph:
139 | dependency: transitive
140 | description:
141 | name: term_glyph
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.2.0"
145 | test_api:
146 | dependency: transitive
147 | description:
148 | name: test_api
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "0.4.9"
152 | vector_math:
153 | dependency: transitive
154 | description:
155 | name: vector_math
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "2.1.2"
159 | sdks:
160 | dart: ">=2.17.0-0 <3.0.0"
161 |
--------------------------------------------------------------------------------
/example/lib/main.dart:
--------------------------------------------------------------------------------
1 | import 'dart:async';
2 |
3 | import 'package:flutter/material.dart';
4 | import 'package:rounded_loading_button/rounded_loading_button.dart';
5 |
6 | void main() => runApp(MyApp());
7 |
8 | class MyApp extends StatelessWidget {
9 | // This widget is the root of your application.
10 | @override
11 | Widget build(BuildContext context) {
12 | return MaterialApp(
13 | title: 'Rounded Loading Button Demo',
14 | theme: ThemeData(
15 | primarySwatch: Colors.blue,
16 | ),
17 | home: MyHomePage(),
18 | );
19 | }
20 | }
21 |
22 | class MyHomePage extends StatefulWidget {
23 | MyHomePage();
24 |
25 | @override
26 | _MyHomePageState createState() => _MyHomePageState();
27 | }
28 |
29 | class _MyHomePageState extends State {
30 | final RoundedLoadingButtonController _btnController1 =
31 | RoundedLoadingButtonController();
32 |
33 | final RoundedLoadingButtonController _btnController2 =
34 | RoundedLoadingButtonController();
35 |
36 | void _doSomething(RoundedLoadingButtonController controller) async {
37 | Timer(Duration(seconds: 10), () {
38 | controller.success();
39 | });
40 | }
41 |
42 | @override
43 | void initState() {
44 | super.initState();
45 | _btnController1.stateStream.listen((value) {
46 | print(value);
47 |
48 | });
49 | }
50 |
51 | @override
52 | Widget build(BuildContext context) {
53 | return Scaffold(
54 | appBar: AppBar(
55 | title: Text('Rounded Loading Button Demo'),
56 | ),
57 | body: Center(
58 | child: Column(
59 | mainAxisAlignment: MainAxisAlignment.center,
60 | children: [
61 | RoundedLoadingButton(
62 | successIcon: Icons.cloud,
63 | failedIcon: Icons.cottage,
64 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
65 | controller: _btnController1,
66 | onPressed: () => _doSomething(_btnController1),
67 | ),
68 | SizedBox(
69 | height: 50,
70 | ),
71 | RoundedLoadingButton(
72 | color: Colors.amber,
73 | successColor: Colors.amber,
74 | controller: _btnController2,
75 | onPressed: () => _doSomething(_btnController2),
76 | valueColor: Colors.black,
77 | borderRadius: 10,
78 | child: Text('''
79 | Tap me i have a huge text''', style: TextStyle(color: Colors.white)),
80 | ),
81 | SizedBox(
82 | height: 50,
83 | ),
84 | OutlinedButton(
85 | style: ButtonStyle(
86 | shape: MaterialStateProperty.all(RoundedRectangleBorder(
87 | borderRadius: BorderRadius.circular(30))),
88 | ),
89 | onPressed: () {
90 | _btnController1.reset();
91 | _btnController2.reset();
92 | },
93 | child: Text('Reset')),
94 | SizedBox(
95 | height: 20,
96 | ),
97 | OutlinedButton(
98 | style: ButtonStyle(
99 | shape: MaterialStateProperty.all(RoundedRectangleBorder(
100 | borderRadius: BorderRadius.circular(30))),
101 | ),
102 | onPressed: () {
103 | _btnController1.error();
104 | _btnController2.error();
105 | },
106 | child: Text('Error'),
107 | ),
108 | SizedBox(
109 | height: 20,
110 | ),
111 | OutlinedButton(
112 | style: ButtonStyle(
113 | shape: MaterialStateProperty.all(RoundedRectangleBorder(
114 | borderRadius: BorderRadius.circular(30))),
115 | ),
116 | onPressed: () {
117 | // _btnController1.success();
118 | // _btnController2.success();
119 | // _btnController1
120 | print(_btnController1.currentState);
121 | },
122 | child: Text('Success'),
123 | )
124 | ],
125 | ),
126 | ));
127 | }
128 | }
129 |
--------------------------------------------------------------------------------
/example/pubspec.lock:
--------------------------------------------------------------------------------
1 | # Generated by pub
2 | # See https://dart.dev/tools/pub/glossary#lockfile
3 | packages:
4 | async:
5 | dependency: transitive
6 | description:
7 | name: async
8 | url: "https://pub.dartlang.org"
9 | source: hosted
10 | version: "2.8.2"
11 | boolean_selector:
12 | dependency: transitive
13 | description:
14 | name: boolean_selector
15 | url: "https://pub.dartlang.org"
16 | source: hosted
17 | version: "2.1.0"
18 | characters:
19 | dependency: transitive
20 | description:
21 | name: characters
22 | url: "https://pub.dartlang.org"
23 | source: hosted
24 | version: "1.2.0"
25 | charcode:
26 | dependency: transitive
27 | description:
28 | name: charcode
29 | url: "https://pub.dartlang.org"
30 | source: hosted
31 | version: "1.3.1"
32 | clock:
33 | dependency: transitive
34 | description:
35 | name: clock
36 | url: "https://pub.dartlang.org"
37 | source: hosted
38 | version: "1.1.0"
39 | collection:
40 | dependency: transitive
41 | description:
42 | name: collection
43 | url: "https://pub.dartlang.org"
44 | source: hosted
45 | version: "1.16.0"
46 | cupertino_icons:
47 | dependency: "direct main"
48 | description:
49 | name: cupertino_icons
50 | url: "https://pub.dartlang.org"
51 | source: hosted
52 | version: "1.0.4"
53 | fake_async:
54 | dependency: transitive
55 | description:
56 | name: fake_async
57 | url: "https://pub.dartlang.org"
58 | source: hosted
59 | version: "1.3.0"
60 | flutter:
61 | dependency: "direct main"
62 | description: flutter
63 | source: sdk
64 | version: "0.0.0"
65 | flutter_test:
66 | dependency: "direct dev"
67 | description: flutter
68 | source: sdk
69 | version: "0.0.0"
70 | matcher:
71 | dependency: transitive
72 | description:
73 | name: matcher
74 | url: "https://pub.dartlang.org"
75 | source: hosted
76 | version: "0.12.11"
77 | material_color_utilities:
78 | dependency: transitive
79 | description:
80 | name: material_color_utilities
81 | url: "https://pub.dartlang.org"
82 | source: hosted
83 | version: "0.1.4"
84 | meta:
85 | dependency: transitive
86 | description:
87 | name: meta
88 | url: "https://pub.dartlang.org"
89 | source: hosted
90 | version: "1.7.0"
91 | path:
92 | dependency: transitive
93 | description:
94 | name: path
95 | url: "https://pub.dartlang.org"
96 | source: hosted
97 | version: "1.8.1"
98 | rounded_loading_button:
99 | dependency: "direct main"
100 | description:
101 | path: ".."
102 | relative: true
103 | source: path
104 | version: "2.1.0"
105 | rxdart:
106 | dependency: transitive
107 | description:
108 | name: rxdart
109 | url: "https://pub.dartlang.org"
110 | source: hosted
111 | version: "0.27.3"
112 | sky_engine:
113 | dependency: transitive
114 | description: flutter
115 | source: sdk
116 | version: "0.0.99"
117 | source_span:
118 | dependency: transitive
119 | description:
120 | name: source_span
121 | url: "https://pub.dartlang.org"
122 | source: hosted
123 | version: "1.8.2"
124 | stack_trace:
125 | dependency: transitive
126 | description:
127 | name: stack_trace
128 | url: "https://pub.dartlang.org"
129 | source: hosted
130 | version: "1.10.0"
131 | stream_channel:
132 | dependency: transitive
133 | description:
134 | name: stream_channel
135 | url: "https://pub.dartlang.org"
136 | source: hosted
137 | version: "2.1.0"
138 | string_scanner:
139 | dependency: transitive
140 | description:
141 | name: string_scanner
142 | url: "https://pub.dartlang.org"
143 | source: hosted
144 | version: "1.1.0"
145 | term_glyph:
146 | dependency: transitive
147 | description:
148 | name: term_glyph
149 | url: "https://pub.dartlang.org"
150 | source: hosted
151 | version: "1.2.0"
152 | test_api:
153 | dependency: transitive
154 | description:
155 | name: test_api
156 | url: "https://pub.dartlang.org"
157 | source: hosted
158 | version: "0.4.9"
159 | vector_math:
160 | dependency: transitive
161 | description:
162 | name: vector_math
163 | url: "https://pub.dartlang.org"
164 | source: hosted
165 | version: "2.1.2"
166 | sdks:
167 | dart: ">=2.17.0-0 <3.0.0"
168 |
--------------------------------------------------------------------------------
/test/rounded_loading_button_test.dart:
--------------------------------------------------------------------------------
1 | import 'package:flutter/material.dart';
2 | import 'package:flutter_test/flutter_test.dart';
3 | import 'package:rounded_loading_button/rounded_loading_button.dart';
4 |
5 | class MockOnPressedFunction {
6 | int called = 0;
7 |
8 | void handler() {
9 | called++;
10 | }
11 | }
12 |
13 | void main() {
14 | late MockOnPressedFunction mockOnPressedFunction;
15 |
16 | setUp(() {
17 | mockOnPressedFunction = MockOnPressedFunction();
18 | });
19 |
20 | testWidgets('should call tap function', (tester) async {
21 | final btnController = RoundedLoadingButtonController();
22 |
23 | await tester.pumpWidget(Directionality(
24 | textDirection: TextDirection.ltr,
25 | child: Material(
26 | child: Center(
27 | child: RoundedLoadingButton(
28 | color: Colors.blue,
29 | onPressed: mockOnPressedFunction.handler,
30 | animateOnTap: false,
31 | controller: btnController,
32 | width: 200,
33 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
34 | ),
35 | ),
36 | )));
37 |
38 | await tester.tap(find.byType(RoundedLoadingButton));
39 |
40 | expect(mockOnPressedFunction.called, 1);
41 | });
42 |
43 | testWidgets('should show progress indicator when in loading state',
44 | (tester) async {
45 | final btnController = RoundedLoadingButtonController();
46 |
47 | await tester.pumpWidget(Directionality(
48 | textDirection: TextDirection.ltr,
49 | child: Material(
50 | child: Center(
51 | child: RoundedLoadingButton(
52 | color: Colors.blue,
53 | onPressed: mockOnPressedFunction.handler,
54 | controller: btnController,
55 | width: 200,
56 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
57 | ),
58 | ),
59 | )));
60 |
61 | btnController.start();
62 |
63 | await tester.pump(const Duration(seconds: 1));
64 |
65 | expect(find.byType(CircularProgressIndicator), findsOneWidget);
66 | });
67 |
68 | testWidgets('should stop and return to default', (tester) async {
69 | final btnController = RoundedLoadingButtonController();
70 |
71 | await tester.pumpWidget(Directionality(
72 | textDirection: TextDirection.ltr,
73 | child: Material(
74 | child: Center(
75 | child: RoundedLoadingButton(
76 | controller: btnController,
77 | color: Colors.blue,
78 | onPressed: mockOnPressedFunction.handler,
79 | width: 200,
80 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
81 | ),
82 | ),
83 | )));
84 |
85 | btnController.start();
86 |
87 | await tester.pump(const Duration(seconds: 1));
88 |
89 | expect(find.byType(CircularProgressIndicator), findsOneWidget);
90 |
91 | btnController.stop();
92 |
93 | await tester.pumpAndSettle();
94 |
95 | expect(find.text('Tap me!'), findsOneWidget);
96 | });
97 |
98 | testWidgets('should reset to default state', (tester) async {
99 | final btnController = RoundedLoadingButtonController();
100 |
101 | await tester.pumpWidget(Directionality(
102 | textDirection: TextDirection.ltr,
103 | child: Material(
104 | child: Center(
105 | child: RoundedLoadingButton(
106 | color: Colors.blue,
107 | onPressed: mockOnPressedFunction.handler,
108 | controller: btnController,
109 | width: 200,
110 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
111 | ),
112 | ),
113 | )));
114 |
115 | btnController.success();
116 |
117 | await tester.pumpAndSettle();
118 |
119 | btnController.reset();
120 |
121 | await tester.pumpAndSettle();
122 |
123 | expect(find.text('Tap me!'), findsOneWidget);
124 | });
125 |
126 | testWidgets('should not show progress indicator when in idle state',
127 | (tester) async {
128 | final btnController = RoundedLoadingButtonController();
129 |
130 | await tester.pumpWidget(Directionality(
131 | textDirection: TextDirection.ltr,
132 | child: Material(
133 | child: Center(
134 | child: RoundedLoadingButton(
135 | color: Colors.blue,
136 | onPressed: mockOnPressedFunction.handler,
137 | controller: btnController,
138 | width: 200,
139 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
140 | ),
141 | ),
142 | )));
143 |
144 | expect(find.byType(CircularProgressIndicator), findsNothing);
145 | });
146 |
147 | testWidgets('should show icon when in success state', (tester) async {
148 | final btnController = RoundedLoadingButtonController();
149 |
150 | await tester.pumpWidget(Directionality(
151 | textDirection: TextDirection.ltr,
152 | child: Material(
153 | child: Center(
154 | child: RoundedLoadingButton(
155 | color: Colors.blue,
156 | onPressed: mockOnPressedFunction.handler,
157 | controller: btnController,
158 | width: 200,
159 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
160 | ),
161 | ),
162 | )));
163 |
164 | btnController.success();
165 |
166 | await tester.pumpAndSettle();
167 |
168 | expect(find.byIcon(Icons.check), findsOneWidget);
169 | });
170 |
171 | testWidgets('should show icon when in error state', (tester) async {
172 | final btnController = RoundedLoadingButtonController();
173 |
174 | await tester.pumpWidget(Directionality(
175 | textDirection: TextDirection.ltr,
176 | child: Material(
177 | child: Center(
178 | child: RoundedLoadingButton(
179 | color: Colors.blue,
180 | onPressed: mockOnPressedFunction.handler,
181 | controller: btnController,
182 | width: 200,
183 | child: Text('Tap me!', style: TextStyle(color: Colors.white)),
184 | ),
185 | ),
186 | )));
187 |
188 | btnController.error();
189 |
190 | await tester.pumpAndSettle();
191 |
192 | expect(find.byIcon(Icons.close), findsOneWidget);
193 | });
194 | }
195 |
--------------------------------------------------------------------------------
/lib/rounded_loading_button.dart:
--------------------------------------------------------------------------------
1 | library rounded_loading_button;
2 |
3 | import 'dart:async';
4 |
5 | import 'package:flutter/material.dart';
6 | import 'package:rxdart/rxdart.dart';
7 |
8 | /// States that your button can assume via the controller
9 | // ignore: public_member_api_docs
10 | enum ButtonState { idle, loading, success, error }
11 |
12 | /// Initialize class
13 | class RoundedLoadingButton extends StatefulWidget {
14 | /// Button controller, now required
15 | final RoundedLoadingButtonController controller;
16 |
17 | /// The callback that is called when
18 | /// the button is tapped or otherwise activated.
19 | final VoidCallback? onPressed;
20 |
21 | /// The button's label
22 | final Widget child;
23 |
24 | /// The primary color of the button
25 | final Color? color;
26 |
27 | /// The vertical extent of the button.
28 | final double height;
29 |
30 | /// The horizontal extent of the button.
31 | final double width;
32 |
33 | /// The size of the CircularProgressIndicator
34 | final double loaderSize;
35 |
36 | /// The stroke width of the CircularProgressIndicator
37 | final double loaderStrokeWidth;
38 |
39 | /// Whether to trigger the animation on the tap event
40 | final bool animateOnTap;
41 |
42 | /// The color of the static icons
43 | final Color valueColor;
44 |
45 | /// reset the animation after specified duration,
46 | /// use resetDuration parameter to set Duration, defaults to 15 seconds
47 | final bool resetAfterDuration;
48 |
49 | /// The curve of the shrink animation
50 | final Curve curve;
51 |
52 | /// The radius of the button border
53 | final double borderRadius;
54 |
55 | /// The duration of the button animation
56 | final Duration duration;
57 |
58 | /// The elevation of the raised button
59 | final double elevation;
60 |
61 | /// Duration after which reset the button
62 | final Duration resetDuration;
63 |
64 | /// The color of the button when it is in the error state
65 | final Color? errorColor;
66 |
67 | /// The color of the button when it is in the success state
68 | final Color? successColor;
69 |
70 | /// The color of the button when it is disabled
71 | final Color? disabledColor;
72 |
73 | /// The icon for the success state
74 | final IconData successIcon;
75 |
76 | /// The icon for the failed state
77 | final IconData failedIcon;
78 |
79 | /// The success and failed animation curve
80 | final Curve completionCurve;
81 |
82 | /// The duration of the success and failed animation
83 | final Duration completionDuration;
84 |
85 | Duration get _borderDuration {
86 | return Duration(milliseconds: (duration.inMilliseconds / 2).round());
87 | }
88 |
89 | /// initialize constructor
90 | const RoundedLoadingButton({
91 | Key? key,
92 | required this.controller,
93 | required this.onPressed,
94 | required this.child,
95 | this.color = Colors.lightBlue,
96 | this.height = 50,
97 | this.width = 300,
98 | this.loaderSize = 24.0,
99 | this.loaderStrokeWidth = 2.0,
100 | this.animateOnTap = true,
101 | this.valueColor = Colors.white,
102 | this.borderRadius = 35,
103 | this.elevation = 2,
104 | this.duration = const Duration(milliseconds: 500),
105 | this.curve = Curves.easeInOutCirc,
106 | this.errorColor = Colors.red,
107 | this.successColor,
108 | this.resetDuration = const Duration(seconds: 15),
109 | this.resetAfterDuration = false,
110 | this.successIcon = Icons.check,
111 | this.failedIcon = Icons.close,
112 | this.completionCurve = Curves.elasticOut,
113 | this.completionDuration = const Duration(milliseconds: 1000),
114 | this.disabledColor,
115 | }) : super(key: key);
116 |
117 | @override
118 | State createState() => RoundedLoadingButtonState();
119 | }
120 |
121 | /// Class implementation
122 | class RoundedLoadingButtonState extends State
123 | with TickerProviderStateMixin {
124 | late AnimationController _buttonController;
125 | late AnimationController _borderController;
126 | late AnimationController _checkButtonController;
127 |
128 | late Animation _squeezeAnimation;
129 | late Animation _bounceAnimation;
130 | late Animation _borderAnimation;
131 |
132 | final _state = BehaviorSubject.seeded(ButtonState.idle);
133 |
134 | @override
135 | Widget build(BuildContext context) {
136 | final theme = Theme.of(context);
137 |
138 | Widget _check = Container(
139 | alignment: FractionalOffset.center,
140 | decoration: BoxDecoration(
141 | color: widget.successColor ?? theme.primaryColor,
142 | borderRadius:
143 | BorderRadius.all(Radius.circular(_bounceAnimation.value / 2)),
144 | ),
145 | width: _bounceAnimation.value,
146 | height: _bounceAnimation.value,
147 | child: _bounceAnimation.value > 20
148 | ? Icon(
149 | widget.successIcon,
150 | color: widget.valueColor,
151 | )
152 | : null,
153 | );
154 |
155 | Widget _cross = Container(
156 | alignment: FractionalOffset.center,
157 | decoration: BoxDecoration(
158 | color: widget.errorColor,
159 | borderRadius:
160 | BorderRadius.all(Radius.circular(_bounceAnimation.value / 2)),
161 | ),
162 | width: _bounceAnimation.value,
163 | height: _bounceAnimation.value,
164 | child: _bounceAnimation.value > 20
165 | ? Icon(
166 | widget.failedIcon,
167 | color: widget.valueColor,
168 | )
169 | : null,
170 | );
171 |
172 | Widget _loader = SizedBox(
173 | height: widget.loaderSize,
174 | width: widget.loaderSize,
175 | child: CircularProgressIndicator(
176 | valueColor: AlwaysStoppedAnimation(widget.valueColor),
177 | strokeWidth: widget.loaderStrokeWidth,
178 | ),
179 | );
180 |
181 | Widget childStream = StreamBuilder(
182 | stream: _state,
183 | builder: (context, snapshot) {
184 | return AnimatedSwitcher(
185 | duration: const Duration(milliseconds: 200),
186 | child: snapshot.data == ButtonState.loading ? _loader : widget.child,
187 | );
188 | },
189 | );
190 |
191 | final _btn = ButtonTheme(
192 | shape: RoundedRectangleBorder(borderRadius: _borderAnimation.value),
193 | disabledColor: widget.disabledColor,
194 | padding: const EdgeInsets.all(0),
195 | child: ElevatedButton(
196 | style: ElevatedButton.styleFrom(
197 | disabledForegroundColor: widget.disabledColor,
198 | minimumSize: Size(_squeezeAnimation.value, widget.height),
199 | shape: RoundedRectangleBorder(
200 | borderRadius: BorderRadius.circular(widget.borderRadius),
201 | ),
202 | backgroundColor: widget.color,
203 | elevation: widget.elevation,
204 | padding: const EdgeInsets.all(0),
205 | ),
206 | onPressed: widget.onPressed == null ? null : _btnPressed,
207 | child: childStream,
208 | ),
209 | );
210 |
211 | return SizedBox(
212 | height: widget.height,
213 | child: Center(
214 | child: _state.value == ButtonState.error
215 | ? _cross
216 | : _state.value == ButtonState.success
217 | ? _check
218 | : _btn,
219 | ),
220 | );
221 | }
222 |
223 | @override
224 | void initState() {
225 | super.initState();
226 |
227 | _buttonController =
228 | AnimationController(duration: widget.duration, vsync: this);
229 |
230 | _checkButtonController =
231 | AnimationController(duration: widget.completionDuration, vsync: this);
232 |
233 | _borderController =
234 | AnimationController(duration: widget._borderDuration, vsync: this);
235 |
236 | _bounceAnimation = Tween(begin: 0, end: widget.height).animate(
237 | CurvedAnimation(
238 | parent: _checkButtonController,
239 | curve: widget.completionCurve,
240 | ),
241 | );
242 | _bounceAnimation.addListener(() {
243 | setState(() {});
244 | });
245 |
246 | _squeezeAnimation =
247 | Tween(begin: widget.width, end: widget.height).animate(
248 | CurvedAnimation(parent: _buttonController, curve: widget.curve),
249 | );
250 |
251 | _squeezeAnimation.addListener(() {
252 | setState(() {});
253 | });
254 |
255 | _squeezeAnimation.addStatusListener((state) {
256 | if (state == AnimationStatus.completed && widget.animateOnTap) {
257 | if (widget.onPressed != null) {
258 | widget.onPressed!();
259 | }
260 | }
261 | });
262 |
263 | _borderAnimation = BorderRadiusTween(
264 | begin: BorderRadius.circular(widget.borderRadius),
265 | end: BorderRadius.circular(widget.height),
266 | ).animate(_borderController);
267 |
268 | _borderAnimation.addListener(() {
269 | setState(() {});
270 | });
271 |
272 | // There is probably a better way of doing this...
273 | _state.stream.listen((event) {
274 | if (!mounted) return;
275 | widget.controller._state.sink.add(event);
276 | });
277 |
278 | widget.controller._addListeners(_start, _stop, _success, _error, _reset);
279 | }
280 |
281 | @override
282 | void dispose() {
283 | _buttonController.dispose();
284 | _checkButtonController.dispose();
285 | _borderController.dispose();
286 | _state.close();
287 | super.dispose();
288 | }
289 |
290 | void _btnPressed() async {
291 | if (widget.animateOnTap) {
292 | _start();
293 | } else {
294 | if (widget.onPressed != null) {
295 | widget.onPressed!();
296 | }
297 | }
298 | }
299 |
300 | void _start() {
301 | if (!mounted) return;
302 | _state.sink.add(ButtonState.loading);
303 | _borderController.forward();
304 | _buttonController.forward();
305 | if (widget.resetAfterDuration) _reset();
306 | }
307 |
308 | void _stop() {
309 | if (!mounted) return;
310 | _state.sink.add(ButtonState.idle);
311 | _buttonController.reverse();
312 | _borderController.reverse();
313 | }
314 |
315 | void _success() {
316 | if (!mounted) return;
317 | _state.sink.add(ButtonState.success);
318 | _checkButtonController.forward();
319 | }
320 |
321 | void _error() {
322 | if (!mounted) return;
323 | _state.sink.add(ButtonState.error);
324 | _checkButtonController.forward();
325 | }
326 |
327 | void _reset() async {
328 | if (widget.resetAfterDuration) await Future.delayed(widget.resetDuration);
329 | if (!mounted) return;
330 | _state.sink.add(ButtonState.idle);
331 | unawaited(_buttonController.reverse());
332 | unawaited(_borderController.reverse());
333 | _checkButtonController.reset();
334 | }
335 | }
336 |
337 | /// Options that can be chosen by the controller
338 | /// each will perform a unique animation
339 | class RoundedLoadingButtonController {
340 | VoidCallback? _startListener;
341 | VoidCallback? _stopListener;
342 | VoidCallback? _successListener;
343 | VoidCallback? _errorListener;
344 | VoidCallback? _resetListener;
345 |
346 | void _addListeners(
347 | VoidCallback startListener,
348 | VoidCallback stopListener,
349 | VoidCallback successListener,
350 | VoidCallback errorListener,
351 | VoidCallback resetListener,
352 | ) {
353 | _startListener = startListener;
354 | _stopListener = stopListener;
355 | _successListener = successListener;
356 | _errorListener = errorListener;
357 | _resetListener = resetListener;
358 | }
359 |
360 | final BehaviorSubject _state =
361 | BehaviorSubject.seeded(ButtonState.idle);
362 |
363 | /// A read-only stream of the button state
364 | Stream get stateStream => _state.stream;
365 |
366 | /// Gets the current state
367 | ButtonState? get currentState => _state.value;
368 |
369 | /// Notify listeners to start the loading animation
370 | void start() {
371 | if (_startListener != null) _startListener!();
372 | }
373 |
374 | /// Notify listeners to start the stop animation
375 | void stop() {
376 | if (_stopListener != null) _stopListener!();
377 | }
378 |
379 | /// Notify listeners to start the success animation
380 | void success() {
381 | if (_successListener != null) _successListener!();
382 | }
383 |
384 | /// Notify listeners to start the error animation
385 | void error() {
386 | if (_errorListener != null) _errorListener!();
387 | }
388 |
389 | /// Notify listeners to start the reset animation
390 | void reset() {
391 | if (_resetListener != null) _resetListener!();
392 | }
393 | }
394 |
--------------------------------------------------------------------------------
/example/ios/Runner.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
12 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
13 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
14 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
15 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; };
16 | /* End PBXBuildFile section */
17 |
18 | /* Begin PBXCopyFilesBuildPhase section */
19 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = {
20 | isa = PBXCopyFilesBuildPhase;
21 | buildActionMask = 2147483647;
22 | dstPath = "";
23 | dstSubfolderSpec = 10;
24 | files = (
25 | );
26 | name = "Embed Frameworks";
27 | runOnlyForDeploymentPostprocessing = 0;
28 | };
29 | /* End PBXCopyFilesBuildPhase section */
30 |
31 | /* Begin PBXFileReference section */
32 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; };
33 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; };
34 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; };
35 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; };
36 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
37 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; };
38 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; };
39 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; };
40 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
42 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
43 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
44 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
45 | /* End PBXFileReference section */
46 |
47 | /* Begin PBXFrameworksBuildPhase section */
48 | 97C146EB1CF9000F007C117D /* Frameworks */ = {
49 | isa = PBXFrameworksBuildPhase;
50 | buildActionMask = 2147483647;
51 | files = (
52 | );
53 | runOnlyForDeploymentPostprocessing = 0;
54 | };
55 | /* End PBXFrameworksBuildPhase section */
56 |
57 | /* Begin PBXGroup section */
58 | 9740EEB11CF90186004384FC /* Flutter */ = {
59 | isa = PBXGroup;
60 | children = (
61 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */,
62 | 9740EEB21CF90195004384FC /* Debug.xcconfig */,
63 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */,
64 | 9740EEB31CF90195004384FC /* Generated.xcconfig */,
65 | );
66 | name = Flutter;
67 | sourceTree = "";
68 | };
69 | 97C146E51CF9000F007C117D = {
70 | isa = PBXGroup;
71 | children = (
72 | 9740EEB11CF90186004384FC /* Flutter */,
73 | 97C146F01CF9000F007C117D /* Runner */,
74 | 97C146EF1CF9000F007C117D /* Products */,
75 | );
76 | sourceTree = "";
77 | };
78 | 97C146EF1CF9000F007C117D /* Products */ = {
79 | isa = PBXGroup;
80 | children = (
81 | 97C146EE1CF9000F007C117D /* Runner.app */,
82 | );
83 | name = Products;
84 | sourceTree = "";
85 | };
86 | 97C146F01CF9000F007C117D /* Runner */ = {
87 | isa = PBXGroup;
88 | children = (
89 | 97C146FA1CF9000F007C117D /* Main.storyboard */,
90 | 97C146FD1CF9000F007C117D /* Assets.xcassets */,
91 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */,
92 | 97C147021CF9000F007C117D /* Info.plist */,
93 | 97C146F11CF9000F007C117D /* Supporting Files */,
94 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */,
95 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */,
96 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */,
97 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */,
98 | );
99 | path = Runner;
100 | sourceTree = "";
101 | };
102 | 97C146F11CF9000F007C117D /* Supporting Files */ = {
103 | isa = PBXGroup;
104 | children = (
105 | );
106 | name = "Supporting Files";
107 | sourceTree = "";
108 | };
109 | /* End PBXGroup section */
110 |
111 | /* Begin PBXNativeTarget section */
112 | 97C146ED1CF9000F007C117D /* Runner */ = {
113 | isa = PBXNativeTarget;
114 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
115 | buildPhases = (
116 | 9740EEB61CF901F6004384FC /* Run Script */,
117 | 97C146EA1CF9000F007C117D /* Sources */,
118 | 97C146EB1CF9000F007C117D /* Frameworks */,
119 | 97C146EC1CF9000F007C117D /* Resources */,
120 | 9705A1C41CF9048500538489 /* Embed Frameworks */,
121 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */,
122 | );
123 | buildRules = (
124 | );
125 | dependencies = (
126 | );
127 | name = Runner;
128 | productName = Runner;
129 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */;
130 | productType = "com.apple.product-type.application";
131 | };
132 | /* End PBXNativeTarget section */
133 |
134 | /* Begin PBXProject section */
135 | 97C146E61CF9000F007C117D /* Project object */ = {
136 | isa = PBXProject;
137 | attributes = {
138 | LastUpgradeCheck = 1020;
139 | ORGANIZATIONNAME = "";
140 | TargetAttributes = {
141 | 97C146ED1CF9000F007C117D = {
142 | CreatedOnToolsVersion = 7.3.1;
143 | LastSwiftMigration = 1100;
144 | };
145 | };
146 | };
147 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */;
148 | compatibilityVersion = "Xcode 3.2";
149 | developmentRegion = en;
150 | hasScannedForEncodings = 0;
151 | knownRegions = (
152 | en,
153 | Base,
154 | );
155 | mainGroup = 97C146E51CF9000F007C117D;
156 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */;
157 | projectDirPath = "";
158 | projectRoot = "";
159 | targets = (
160 | 97C146ED1CF9000F007C117D /* Runner */,
161 | );
162 | };
163 | /* End PBXProject section */
164 |
165 | /* Begin PBXResourcesBuildPhase section */
166 | 97C146EC1CF9000F007C117D /* Resources */ = {
167 | isa = PBXResourcesBuildPhase;
168 | buildActionMask = 2147483647;
169 | files = (
170 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */,
171 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */,
172 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */,
173 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */,
174 | );
175 | runOnlyForDeploymentPostprocessing = 0;
176 | };
177 | /* End PBXResourcesBuildPhase section */
178 |
179 | /* Begin PBXShellScriptBuildPhase section */
180 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
181 | isa = PBXShellScriptBuildPhase;
182 | buildActionMask = 2147483647;
183 | files = (
184 | );
185 | inputPaths = (
186 | );
187 | name = "Thin Binary";
188 | outputPaths = (
189 | );
190 | runOnlyForDeploymentPostprocessing = 0;
191 | shellPath = /bin/sh;
192 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin";
193 | };
194 | 9740EEB61CF901F6004384FC /* Run Script */ = {
195 | isa = PBXShellScriptBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | inputPaths = (
200 | );
201 | name = "Run Script";
202 | outputPaths = (
203 | );
204 | runOnlyForDeploymentPostprocessing = 0;
205 | shellPath = /bin/sh;
206 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
207 | };
208 | /* End PBXShellScriptBuildPhase section */
209 |
210 | /* Begin PBXSourcesBuildPhase section */
211 | 97C146EA1CF9000F007C117D /* Sources */ = {
212 | isa = PBXSourcesBuildPhase;
213 | buildActionMask = 2147483647;
214 | files = (
215 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */,
216 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */,
217 | );
218 | runOnlyForDeploymentPostprocessing = 0;
219 | };
220 | /* End PBXSourcesBuildPhase section */
221 |
222 | /* Begin PBXVariantGroup section */
223 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = {
224 | isa = PBXVariantGroup;
225 | children = (
226 | 97C146FB1CF9000F007C117D /* Base */,
227 | );
228 | name = Main.storyboard;
229 | sourceTree = "";
230 | };
231 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = {
232 | isa = PBXVariantGroup;
233 | children = (
234 | 97C147001CF9000F007C117D /* Base */,
235 | );
236 | name = LaunchScreen.storyboard;
237 | sourceTree = "";
238 | };
239 | /* End PBXVariantGroup section */
240 |
241 | /* Begin XCBuildConfiguration section */
242 | 249021D3217E4FDB00AE95B9 /* Profile */ = {
243 | isa = XCBuildConfiguration;
244 | buildSettings = {
245 | ALWAYS_SEARCH_USER_PATHS = NO;
246 | CLANG_ANALYZER_NONNULL = YES;
247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
248 | CLANG_CXX_LIBRARY = "libc++";
249 | CLANG_ENABLE_MODULES = YES;
250 | CLANG_ENABLE_OBJC_ARC = YES;
251 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
252 | CLANG_WARN_BOOL_CONVERSION = YES;
253 | CLANG_WARN_COMMA = YES;
254 | CLANG_WARN_CONSTANT_CONVERSION = YES;
255 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
256 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
257 | CLANG_WARN_EMPTY_BODY = YES;
258 | CLANG_WARN_ENUM_CONVERSION = YES;
259 | CLANG_WARN_INFINITE_RECURSION = YES;
260 | CLANG_WARN_INT_CONVERSION = YES;
261 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
262 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
263 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
264 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
265 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
266 | CLANG_WARN_STRICT_PROTOTYPES = YES;
267 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
268 | CLANG_WARN_UNREACHABLE_CODE = YES;
269 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
270 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
271 | COPY_PHASE_STRIP = NO;
272 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
273 | ENABLE_NS_ASSERTIONS = NO;
274 | ENABLE_STRICT_OBJC_MSGSEND = YES;
275 | GCC_C_LANGUAGE_STANDARD = gnu99;
276 | GCC_NO_COMMON_BLOCKS = YES;
277 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
278 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
279 | GCC_WARN_UNDECLARED_SELECTOR = YES;
280 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
281 | GCC_WARN_UNUSED_FUNCTION = YES;
282 | GCC_WARN_UNUSED_VARIABLE = YES;
283 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
284 | MTL_ENABLE_DEBUG_INFO = NO;
285 | SDKROOT = iphoneos;
286 | SUPPORTED_PLATFORMS = iphoneos;
287 | TARGETED_DEVICE_FAMILY = "1,2";
288 | VALIDATE_PRODUCT = YES;
289 | };
290 | name = Profile;
291 | };
292 | 249021D4217E4FDB00AE95B9 /* Profile */ = {
293 | isa = XCBuildConfiguration;
294 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
295 | buildSettings = {
296 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
297 | CLANG_ENABLE_MODULES = YES;
298 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
299 | ENABLE_BITCODE = NO;
300 | FRAMEWORK_SEARCH_PATHS = (
301 | "$(inherited)",
302 | "$(PROJECT_DIR)/Flutter",
303 | );
304 | INFOPLIST_FILE = Runner/Info.plist;
305 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
306 | LIBRARY_SEARCH_PATHS = (
307 | "$(inherited)",
308 | "$(PROJECT_DIR)/Flutter",
309 | );
310 | PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleApp;
311 | PRODUCT_NAME = "$(TARGET_NAME)";
312 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
313 | SWIFT_VERSION = 5.0;
314 | VERSIONING_SYSTEM = "apple-generic";
315 | };
316 | name = Profile;
317 | };
318 | 97C147031CF9000F007C117D /* Debug */ = {
319 | isa = XCBuildConfiguration;
320 | buildSettings = {
321 | ALWAYS_SEARCH_USER_PATHS = NO;
322 | CLANG_ANALYZER_NONNULL = YES;
323 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
324 | CLANG_CXX_LIBRARY = "libc++";
325 | CLANG_ENABLE_MODULES = YES;
326 | CLANG_ENABLE_OBJC_ARC = YES;
327 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
328 | CLANG_WARN_BOOL_CONVERSION = YES;
329 | CLANG_WARN_COMMA = YES;
330 | CLANG_WARN_CONSTANT_CONVERSION = YES;
331 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
332 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
333 | CLANG_WARN_EMPTY_BODY = YES;
334 | CLANG_WARN_ENUM_CONVERSION = YES;
335 | CLANG_WARN_INFINITE_RECURSION = YES;
336 | CLANG_WARN_INT_CONVERSION = YES;
337 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
338 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
339 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
340 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
341 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
342 | CLANG_WARN_STRICT_PROTOTYPES = YES;
343 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
344 | CLANG_WARN_UNREACHABLE_CODE = YES;
345 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
346 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
347 | COPY_PHASE_STRIP = NO;
348 | DEBUG_INFORMATION_FORMAT = dwarf;
349 | ENABLE_STRICT_OBJC_MSGSEND = YES;
350 | ENABLE_TESTABILITY = YES;
351 | GCC_C_LANGUAGE_STANDARD = gnu99;
352 | GCC_DYNAMIC_NO_PIC = NO;
353 | GCC_NO_COMMON_BLOCKS = YES;
354 | GCC_OPTIMIZATION_LEVEL = 0;
355 | GCC_PREPROCESSOR_DEFINITIONS = (
356 | "DEBUG=1",
357 | "$(inherited)",
358 | );
359 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
360 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
361 | GCC_WARN_UNDECLARED_SELECTOR = YES;
362 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
363 | GCC_WARN_UNUSED_FUNCTION = YES;
364 | GCC_WARN_UNUSED_VARIABLE = YES;
365 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
366 | MTL_ENABLE_DEBUG_INFO = YES;
367 | ONLY_ACTIVE_ARCH = YES;
368 | SDKROOT = iphoneos;
369 | TARGETED_DEVICE_FAMILY = "1,2";
370 | };
371 | name = Debug;
372 | };
373 | 97C147041CF9000F007C117D /* Release */ = {
374 | isa = XCBuildConfiguration;
375 | buildSettings = {
376 | ALWAYS_SEARCH_USER_PATHS = NO;
377 | CLANG_ANALYZER_NONNULL = YES;
378 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
379 | CLANG_CXX_LIBRARY = "libc++";
380 | CLANG_ENABLE_MODULES = YES;
381 | CLANG_ENABLE_OBJC_ARC = YES;
382 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
383 | CLANG_WARN_BOOL_CONVERSION = YES;
384 | CLANG_WARN_COMMA = YES;
385 | CLANG_WARN_CONSTANT_CONVERSION = YES;
386 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
388 | CLANG_WARN_EMPTY_BODY = YES;
389 | CLANG_WARN_ENUM_CONVERSION = YES;
390 | CLANG_WARN_INFINITE_RECURSION = YES;
391 | CLANG_WARN_INT_CONVERSION = YES;
392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
393 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
394 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
395 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
396 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
397 | CLANG_WARN_STRICT_PROTOTYPES = YES;
398 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
399 | CLANG_WARN_UNREACHABLE_CODE = YES;
400 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
401 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
402 | COPY_PHASE_STRIP = NO;
403 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
404 | ENABLE_NS_ASSERTIONS = NO;
405 | ENABLE_STRICT_OBJC_MSGSEND = YES;
406 | GCC_C_LANGUAGE_STANDARD = gnu99;
407 | GCC_NO_COMMON_BLOCKS = YES;
408 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
409 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
410 | GCC_WARN_UNDECLARED_SELECTOR = YES;
411 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
412 | GCC_WARN_UNUSED_FUNCTION = YES;
413 | GCC_WARN_UNUSED_VARIABLE = YES;
414 | IPHONEOS_DEPLOYMENT_TARGET = 9.0;
415 | MTL_ENABLE_DEBUG_INFO = NO;
416 | SDKROOT = iphoneos;
417 | SUPPORTED_PLATFORMS = iphoneos;
418 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
419 | TARGETED_DEVICE_FAMILY = "1,2";
420 | VALIDATE_PRODUCT = YES;
421 | };
422 | name = Release;
423 | };
424 | 97C147061CF9000F007C117D /* Debug */ = {
425 | isa = XCBuildConfiguration;
426 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */;
427 | buildSettings = {
428 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
429 | CLANG_ENABLE_MODULES = YES;
430 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
431 | ENABLE_BITCODE = NO;
432 | FRAMEWORK_SEARCH_PATHS = (
433 | "$(inherited)",
434 | "$(PROJECT_DIR)/Flutter",
435 | );
436 | INFOPLIST_FILE = Runner/Info.plist;
437 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
438 | LIBRARY_SEARCH_PATHS = (
439 | "$(inherited)",
440 | "$(PROJECT_DIR)/Flutter",
441 | );
442 | PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleApp;
443 | PRODUCT_NAME = "$(TARGET_NAME)";
444 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
445 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
446 | SWIFT_VERSION = 5.0;
447 | VERSIONING_SYSTEM = "apple-generic";
448 | };
449 | name = Debug;
450 | };
451 | 97C147071CF9000F007C117D /* Release */ = {
452 | isa = XCBuildConfiguration;
453 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */;
454 | buildSettings = {
455 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
456 | CLANG_ENABLE_MODULES = YES;
457 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
458 | ENABLE_BITCODE = NO;
459 | FRAMEWORK_SEARCH_PATHS = (
460 | "$(inherited)",
461 | "$(PROJECT_DIR)/Flutter",
462 | );
463 | INFOPLIST_FILE = Runner/Info.plist;
464 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
465 | LIBRARY_SEARCH_PATHS = (
466 | "$(inherited)",
467 | "$(PROJECT_DIR)/Flutter",
468 | );
469 | PRODUCT_BUNDLE_IDENTIFIER = com.example.exampleApp;
470 | PRODUCT_NAME = "$(TARGET_NAME)";
471 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
472 | SWIFT_VERSION = 5.0;
473 | VERSIONING_SYSTEM = "apple-generic";
474 | };
475 | name = Release;
476 | };
477 | /* End XCBuildConfiguration section */
478 |
479 | /* Begin XCConfigurationList section */
480 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = {
481 | isa = XCConfigurationList;
482 | buildConfigurations = (
483 | 97C147031CF9000F007C117D /* Debug */,
484 | 97C147041CF9000F007C117D /* Release */,
485 | 249021D3217E4FDB00AE95B9 /* Profile */,
486 | );
487 | defaultConfigurationIsVisible = 0;
488 | defaultConfigurationName = Release;
489 | };
490 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = {
491 | isa = XCConfigurationList;
492 | buildConfigurations = (
493 | 97C147061CF9000F007C117D /* Debug */,
494 | 97C147071CF9000F007C117D /* Release */,
495 | 249021D4217E4FDB00AE95B9 /* Profile */,
496 | );
497 | defaultConfigurationIsVisible = 0;
498 | defaultConfigurationName = Release;
499 | };
500 | /* End XCConfigurationList section */
501 | };
502 | rootObject = 97C146E61CF9000F007C117D /* Project object */;
503 | }
504 |
--------------------------------------------------------------------------------