Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 43 additions & 50 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,58 @@
# Glass effect - for your skeleton loading
Show a glass effect using a single AnimationController over a list of Widgets.

<p align="center">
<img src="https://github.com/Apparence-io/better_skeleton/raw/master/images/logo.png" alt="better skeleton logo" />
</p>
<br><br>
<a href="https://en.apparence.io"><img src="https://github.com/Apparence-io/bart/raw/master/.github/img/logo.png" alt="Apparence.io logo"></a>
<p><small>Developed with 💙 &nbsp;by Apparence.io</small></p>

<p align="center">
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-purple.svg" alt="License: MIT"></a>
<a href="https://pub.dev/packages/usb_device"><img src="https://img.shields.io/pub/v/better_skeleton" alt="pub dev usb_device"></a>
</p>
<br>
<hr>
<br>

## 🚀&nbsp; Overview

Show a glass effect using a single AnimationController over a list of Widgets

<p align="center">
<img src="https://github.com/Apparence-io/better_skeleton/blob/master/images/example.gif?raw=true" width="230" alt="Apparence.io better skeleton plugin gif">
<img src="https://github.com/Apparence-io/better_skeleton/blob/master/images/example.gif?raw=true" width="230" alt="Apparence.io better skeleton plugin gif">
</p>

## Tldr - features?
- Show a glass effect using a single AnimationController over a list of Widgets
## 📖&nbsp; Getting started

## Getting Started
Create an animation controller in repeat mode then just provide this controller to every AnimatedSkeleton.

This effect is made using a custom RenderWidget.

Example of using:
- Create an animation controller (in your stateful widget for exemple)

```dart
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> with SingleTickerProviderStateMixin {
late final AnimationController animationController;

@override
void initState() {
super.initState();
animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 1000))..repeat();
}

@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Column(
children: [
SizedBox(height: 100),
AnimatedSkeleton(
listenable: animationController,
child: FakeCard(),
),
AnimatedSkeleton(
listenable: animationController,
child: FakeCard(),
),
AnimatedSkeleton(
listenable: animationController,
child: FakeCard2(),
),
],
),
),
);
}
}
final AnimationController animationController = AnimationController(vsync: this, duration: Duration(milliseconds: 1000))..repeat();
```

Note: FakeCard is a container widget we made with just a grey background. See example.
- Create a fake container widget (this is a placeholder widget which is shown when data is loading).

- Wrap the fake widget with the Plugin.

```dart
AnimatedSkeleton(
listenable: animationController,
child: FakeCard(),
);
```

> Note: See example for more.

## 📣&nbsp; Sponsor

<img src="https://github.com/Apparence-io/bart/raw/master/.github/img/apparence_logo.png" alt="logo apparence io" />
<br />
<br />

[Initiated and sponsored by Apparence.io.](https://apparence.io)

## 👥&nbsp; Contribution

Contributions are welcome.
Contribute by creating a PR or create an issue 🎉.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 30
compileSdkVersion 31

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
6 changes: 3 additions & 3 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@ packages:
dependency: "direct main"
description:
name: cupertino_icons
sha256: "486b7bc707424572cdf7bd7e812a0c146de3fd47ecadf070254cc60383f21dd8"
sha256: e35129dc44c9118cee2a5603506d823bab99c68393879edb440e0090d07586be
url: "https://pub.dev"
source: hosted
version: "1.0.3"
version: "1.0.5"
fake_async:
dependency: transitive
description:
Expand Down Expand Up @@ -176,5 +176,5 @@ packages:
source: hosted
version: "2.1.4"
sdks:
dart: ">=3.0.0-0 <4.0.0"
dart: ">=3.0.5 <4.0.0"
flutter: ">=1.20.0"
27 changes: 0 additions & 27 deletions example/test/widget_test.dart

This file was deleted.

Binary file added images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,5 @@ packages:
source: hosted
version: "2.1.4"
sdks:
dart: ">=3.0.0-0 <4.0.0"
dart: ">=3.0.5 <4.0.0"
flutter: ">=1.20.0"
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ version: 0.0.2
repository: https://github.com/Apparence-io/better_skeleton.git

environment:
sdk: ">=2.14.0 <4.0.0"
sdk: '>=3.0.5 <4.0.0'
flutter: ">=1.20.0"

dependencies:
flutter:
sdk: flutter
vector_math: ^2.1.0
vector_math: ^2.1.4

dev_dependencies:
flutter_test:
Expand Down