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
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# flutter_gifimage

We should know that in order to achieve Gif in flutter, we can use Image, but we have no way to manipulate Gif, for example: change its speed, control it has been playing in a frame,
in which frame range loop. These problems can be solved by this widget,it also help you contain gif cache,avoid load frame every time.
We can use gifs in Flutter but there is no way to manipulate them. If you are planning to:

* change its speed
* set the current frame of the gif
* animate to and from specific frames
* loop the gif frames in a specific range

This package solves these problems, it also helps you to contain gif cache, to avoid that the frame is loaded over and over again.

# Screenshots

![](arts/gif.gif)

# Usage(Simple)
add in pubspec
To install the package add this to your `pubspec.yaml`:

```dart

flutter_gifimage: ^1.0.0

```

simple usage
Simple example usage:

```dart
GifController controller= GifController(vsync: this);
GifController controller = GifController(vsync: this);


GifImage(
Expand All @@ -34,7 +40,7 @@ We should know that in order to achieve Gif in flutter, we can use Image, but we

```dart
// loop from 0 frame to 29 frame
controller.repeat(min:0,max:29,period:Duration(millseconds:300));
controller.repeat(min: 0, max: 29, period: Duration(milliseconds: 300));

// jumpTo thrid frame(index from 0)
controller.value = 0;
Expand All @@ -44,7 +50,7 @@ We should know that in order to achieve Gif in flutter, we can use Image, but we

```

If you need to preCache gif,try this
If you need to preCache gif, try this

```dart
// put imageProvider
Expand All @@ -56,7 +62,7 @@ We should know that in order to achieve Gif in flutter, we can use Image, but we


# Thanks
* [gif_ani](https://github.com/hyz1992/gif_ani) (thanks for giving me idea)
* [gif_ani](https://github.com/hyz1992/gif_ani) (thanks for giving me the idea)

# License

Expand Down
8 changes: 4 additions & 4 deletions example/lib/main.dart

Large diffs are not rendered by default.

103 changes: 55 additions & 48 deletions example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,58 @@ packages:
dependency: transitive
description:
name: async
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.3.0"
version: "2.5.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "2.1.0"
characters:
dependency: transitive
description:
name: characters
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
charcode:
dependency: transitive
description:
name: charcode
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
clock:
dependency: transitive
description:
name: clock
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.2"
version: "1.1.0"
collection:
dependency: transitive
description:
name: collection
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.14.11"
version: "1.15.0"
cupertino_icons:
dependency: "direct main"
description:
name: cupertino_icons
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
fake_async:
dependency: transitive
description:
name: fake_async
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
version: "1.2.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -47,7 +68,7 @@ packages:
path: ".."
relative: true
source: path
version: "1.0.1"
version: "1.1.0"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -57,37 +78,23 @@ packages:
dependency: transitive
description:
name: matcher
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.12.5"
version: "0.12.10"
meta:
dependency: transitive
description:
name: meta
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.7"
version: "1.3.0"
path:
dependency: transitive
description:
name: path
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.6.4"
pedantic:
dependency: transitive
description:
name: pedantic
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.8.0+1"
quiver:
dependency: transitive
description:
name: quiver
url: "https://pub.flutter-io.cn"
source: hosted
version: "2.0.5"
version: "1.8.0"
sky_engine:
dependency: transitive
description: flutter
Expand All @@ -97,57 +104,57 @@ packages:
dependency: transitive
description:
name: source_span
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.5.5"
version: "1.8.0"
stack_trace:
dependency: transitive
description:
name: stack_trace
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.9.3"
version: "1.10.0"
stream_channel:
dependency: transitive
description:
name: stream_channel
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
version: "2.1.0"
string_scanner:
dependency: transitive
description:
name: string_scanner
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.5"
version: "1.1.0"
term_glyph:
dependency: transitive
description:
name: term_glyph
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.0"
version: "1.2.0"
test_api:
dependency: transitive
description:
name: test_api
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.5"
version: "0.2.19"
typed_data:
dependency: transitive
description:
name: typed_data
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "1.1.6"
version: "1.3.0"
vector_math:
dependency: transitive
description:
name: vector_math
url: "https://pub.flutter-io.cn"
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.8"
version: "2.1.0"
sdks:
dart: ">=2.2.2 <3.0.0"
dart: ">=2.12.0 <3.0.0"
4 changes: 2 additions & 2 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ description: A new Flutter project.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1
version: 1.1.0

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: '>=2.12.0 <3.0.0'

dependencies:
flutter:
Expand Down
Loading