flet-rive 0.1.0__tar.gz → 0.70.0.dev6619__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flet-rive might be problematic. Click here for more details.

Files changed (30) hide show
  1. {flet_rive-0.1.0/src/flutter/flet_rive → flet_rive-0.70.0.dev6619}/LICENSE +1 -1
  2. flet_rive-0.70.0.dev6619/PKG-INFO +56 -0
  3. flet_rive-0.70.0.dev6619/README.md +40 -0
  4. flet_rive-0.70.0.dev6619/pyproject.toml +24 -0
  5. flet_rive-0.70.0.dev6619/src/flet_rive/__init__.py +3 -0
  6. flet_rive-0.70.0.dev6619/src/flet_rive/rive.py +82 -0
  7. flet_rive-0.70.0.dev6619/src/flet_rive.egg-info/PKG-INFO +56 -0
  8. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/src/flet_rive.egg-info/SOURCES.txt +2 -4
  9. flet_rive-0.70.0.dev6619/src/flet_rive.egg-info/requires.txt +1 -0
  10. flet_rive-0.70.0.dev6619/src/flutter/flet_rive/lib/flet_rive.dart +3 -0
  11. flet_rive-0.70.0.dev6619/src/flutter/flet_rive/lib/src/extension.dart +16 -0
  12. flet_rive-0.70.0.dev6619/src/flutter/flet_rive/lib/src/rive.dart +75 -0
  13. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/src/flutter/flet_rive/pubspec.lock +203 -140
  14. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/src/flutter/flet_rive/pubspec.yaml +10 -5
  15. flet_rive-0.1.0/PKG-INFO +0 -42
  16. flet_rive-0.1.0/README.md +0 -28
  17. flet_rive-0.1.0/pyproject.toml +0 -36
  18. flet_rive-0.1.0/src/flet_rive/__init__.py +0 -1
  19. flet_rive-0.1.0/src/flet_rive/rive.py +0 -187
  20. flet_rive-0.1.0/src/flet_rive.egg-info/PKG-INFO +0 -42
  21. flet_rive-0.1.0/src/flet_rive.egg-info/requires.txt +0 -1
  22. flet_rive-0.1.0/src/flutter/flet_rive/CHANGELOG.md +0 -3
  23. flet_rive-0.1.0/src/flutter/flet_rive/README.md +0 -3
  24. flet_rive-0.1.0/src/flutter/flet_rive/lib/flet_rive.dart +0 -3
  25. flet_rive-0.1.0/src/flutter/flet_rive/lib/src/create_control.dart +0 -22
  26. flet_rive-0.1.0/src/flutter/flet_rive/lib/src/rive.dart +0 -80
  27. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/setup.cfg +0 -0
  28. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/src/flet_rive.egg-info/dependency_links.txt +0 -0
  29. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/src/flet_rive.egg-info/top_level.txt +0 -0
  30. {flet_rive-0.1.0 → flet_rive-0.70.0.dev6619}/src/flutter/flet_rive/analysis_options.yaml +0 -0
@@ -198,4 +198,4 @@
198
198
  distributed under the License is distributed on an "AS IS" BASIS,
199
199
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
200
  See the License for the specific language governing permissions and
201
- limitations under the License.
201
+ limitations under the License.
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.4
2
+ Name: flet-rive
3
+ Version: 0.70.0.dev6619
4
+ Summary: Display Rive animations in Flet apps.
5
+ Author-email: Flet contributors <hello@flet.dev>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://flet.dev
8
+ Project-URL: Documentation, https://docs.flet.dev/rive
9
+ Project-URL: Repository, https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-rive
10
+ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: flet==0.70.0.dev6619
15
+ Dynamic: license-file
16
+
17
+ # flet-rive
18
+
19
+ [![pypi](https://img.shields.io/pypi/v/flet-rive.svg)](https://pypi.python.org/pypi/flet-rive)
20
+ [![downloads](https://static.pepy.tech/badge/flet-rive/month)](https://pepy.tech/project/flet-rive)
21
+ [![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-rive/LICENSE)
22
+
23
+ A cross-platform [Flet](https://flet.dev) extension for displaying [Rive](https://rive.app/) animations.
24
+
25
+ It is based on the [rive](https://pub.dev/packages/rive) Flutter package.
26
+
27
+ ## Documentation
28
+
29
+ Detailed documentation to this package can be found [here](https://docs.flet.dev/rive/).
30
+
31
+ ## Platform Support
32
+
33
+ | Platform | Windows | macOS | Linux | iOS | Android | Web |
34
+ |----------|---------|-------|-------|-----|---------|-----|
35
+ | Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
36
+
37
+ ## Usage
38
+
39
+ ### Installation
40
+
41
+ To install the `flet-rive` package and add it to your project dependencies:
42
+
43
+ - Using `uv`:
44
+ ```bash
45
+ uv add flet-rive
46
+ ```
47
+
48
+ - Using `pip`:
49
+ ```bash
50
+ pip install flet-rive
51
+ ```
52
+ After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
53
+
54
+ ### Examples
55
+
56
+ For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/rive).
@@ -0,0 +1,40 @@
1
+ # flet-rive
2
+
3
+ [![pypi](https://img.shields.io/pypi/v/flet-rive.svg)](https://pypi.python.org/pypi/flet-rive)
4
+ [![downloads](https://static.pepy.tech/badge/flet-rive/month)](https://pepy.tech/project/flet-rive)
5
+ [![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-rive/LICENSE)
6
+
7
+ A cross-platform [Flet](https://flet.dev) extension for displaying [Rive](https://rive.app/) animations.
8
+
9
+ It is based on the [rive](https://pub.dev/packages/rive) Flutter package.
10
+
11
+ ## Documentation
12
+
13
+ Detailed documentation to this package can be found [here](https://docs.flet.dev/rive/).
14
+
15
+ ## Platform Support
16
+
17
+ | Platform | Windows | macOS | Linux | iOS | Android | Web |
18
+ |----------|---------|-------|-------|-----|---------|-----|
19
+ | Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
20
+
21
+ ## Usage
22
+
23
+ ### Installation
24
+
25
+ To install the `flet-rive` package and add it to your project dependencies:
26
+
27
+ - Using `uv`:
28
+ ```bash
29
+ uv add flet-rive
30
+ ```
31
+
32
+ - Using `pip`:
33
+ ```bash
34
+ pip install flet-rive
35
+ ```
36
+ After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
37
+
38
+ ### Examples
39
+
40
+ For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/rive).
@@ -0,0 +1,24 @@
1
+ [project]
2
+ name = "flet-rive"
3
+ version = "0.70.0.dev6619"
4
+ description = "Display Rive animations in Flet apps."
5
+ readme = "README.md"
6
+ authors = [{ name = "Flet contributors", email = "hello@flet.dev" }]
7
+ license = "Apache-2.0"
8
+ requires-python = ">=3.10"
9
+ dependencies = [
10
+ "flet==0.70.0.dev6619",
11
+ ]
12
+
13
+ [project.urls]
14
+ Homepage = "https://flet.dev"
15
+ Documentation = "https://docs.flet.dev/rive"
16
+ Repository = "https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-rive"
17
+ Issues = "https://github.com/flet-dev/flet/issues"
18
+
19
+ [tool.setuptools.package-data]
20
+ "flutter.flet_rive" = ["**/*"]
21
+
22
+ [build-system]
23
+ requires = ["setuptools"]
24
+ build-backend = "setuptools.build_meta"
@@ -0,0 +1,3 @@
1
+ from flet_rive.rive import Rive as Rive
2
+
3
+ __all__ = ["Rive"]
@@ -0,0 +1,82 @@
1
+ from dataclasses import field
2
+ from typing import Optional
3
+
4
+ import flet as ft
5
+
6
+ __all__ = ["Rive"]
7
+
8
+
9
+ @ft.control("Rive")
10
+ class Rive(ft.LayoutControl):
11
+ """
12
+ Displays rive animations.
13
+ """
14
+
15
+ src: str
16
+ """
17
+ The source of your rive animation.
18
+
19
+ Can either be a URL or a path to a local asset file.
20
+ """
21
+
22
+ placeholder: Optional[ft.Control] = None
23
+ """
24
+ Control displayed while the Rive is loading.
25
+ """
26
+
27
+ artboard: Optional[str] = None
28
+ """
29
+ The name of the artboard to use.
30
+ If not specified, the default artboard of the provided `src` is used.
31
+ """
32
+
33
+ alignment: Optional[ft.Alignment] = None
34
+ """
35
+ Alignment for the animation in the Rive control.
36
+ """
37
+
38
+ enable_antialiasing: bool = True
39
+ """
40
+ Whether to enable anti-aliasing when rendering.
41
+ """
42
+
43
+ use_artboard_size: bool = False
44
+ """
45
+ Determines whether to use the inherent size of the artboard,
46
+ i.e. the absolute size defined by the artboard,
47
+ or size the control based on the available constraints only (sized by parent).
48
+ """
49
+
50
+ fit: Optional[ft.BoxFit] = None
51
+ """
52
+ The animation's fit.
53
+ """
54
+
55
+ speed_multiplier: ft.Number = 1.0
56
+ """
57
+ A multiplier for controlling the speed of the Rive animation playback.
58
+ """
59
+
60
+ animations: list[str] = field(default_factory=list)
61
+ """
62
+ List of animations to play; default animation is played if empty.
63
+ """
64
+
65
+ state_machines: list[str] = field(default_factory=list)
66
+ """
67
+ List of state machines to play; none will play if empty.
68
+ """
69
+
70
+ headers: Optional[dict[str, str]] = None
71
+ """
72
+ Headers for network requests.
73
+ """
74
+
75
+ clip_rect: Optional[ft.Rect] = None
76
+ """
77
+ Clip the artboard to this rect.
78
+
79
+ If not supplied it'll default to the constraint size provided by the parent
80
+ control.
81
+ Unless the Artboard has clipping disabled, then no clip will be applied.
82
+ """
@@ -0,0 +1,56 @@
1
+ Metadata-Version: 2.4
2
+ Name: flet-rive
3
+ Version: 0.70.0.dev6619
4
+ Summary: Display Rive animations in Flet apps.
5
+ Author-email: Flet contributors <hello@flet.dev>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://flet.dev
8
+ Project-URL: Documentation, https://docs.flet.dev/rive
9
+ Project-URL: Repository, https://github.com/flet-dev/flet/tree/main/sdk/python/packages/flet-rive
10
+ Project-URL: Issues, https://github.com/flet-dev/flet/issues
11
+ Requires-Python: >=3.10
12
+ Description-Content-Type: text/markdown
13
+ License-File: LICENSE
14
+ Requires-Dist: flet==0.70.0.dev6619
15
+ Dynamic: license-file
16
+
17
+ # flet-rive
18
+
19
+ [![pypi](https://img.shields.io/pypi/v/flet-rive.svg)](https://pypi.python.org/pypi/flet-rive)
20
+ [![downloads](https://static.pepy.tech/badge/flet-rive/month)](https://pepy.tech/project/flet-rive)
21
+ [![license](https://img.shields.io/badge/License-Apache_2.0-green.svg)](https://github.com/flet-dev/flet/blob/main/sdk/python/packages/flet-rive/LICENSE)
22
+
23
+ A cross-platform [Flet](https://flet.dev) extension for displaying [Rive](https://rive.app/) animations.
24
+
25
+ It is based on the [rive](https://pub.dev/packages/rive) Flutter package.
26
+
27
+ ## Documentation
28
+
29
+ Detailed documentation to this package can be found [here](https://docs.flet.dev/rive/).
30
+
31
+ ## Platform Support
32
+
33
+ | Platform | Windows | macOS | Linux | iOS | Android | Web |
34
+ |----------|---------|-------|-------|-----|---------|-----|
35
+ | Supported| ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
36
+
37
+ ## Usage
38
+
39
+ ### Installation
40
+
41
+ To install the `flet-rive` package and add it to your project dependencies:
42
+
43
+ - Using `uv`:
44
+ ```bash
45
+ uv add flet-rive
46
+ ```
47
+
48
+ - Using `pip`:
49
+ ```bash
50
+ pip install flet-rive
51
+ ```
52
+ After this, you will have to manually add this package to your `requirements.txt` or `pyproject.toml`.
53
+
54
+ ### Examples
55
+
56
+ For examples, see [these](https://github.com/flet-dev/flet/tree/main/sdk/python/examples/controls/rive).
@@ -1,3 +1,4 @@
1
+ LICENSE
1
2
  README.md
2
3
  pyproject.toml
3
4
  src/flet_rive/__init__.py
@@ -7,12 +8,9 @@ src/flet_rive.egg-info/SOURCES.txt
7
8
  src/flet_rive.egg-info/dependency_links.txt
8
9
  src/flet_rive.egg-info/requires.txt
9
10
  src/flet_rive.egg-info/top_level.txt
10
- src/flutter/flet_rive/CHANGELOG.md
11
- src/flutter/flet_rive/LICENSE
12
- src/flutter/flet_rive/README.md
13
11
  src/flutter/flet_rive/analysis_options.yaml
14
12
  src/flutter/flet_rive/pubspec.lock
15
13
  src/flutter/flet_rive/pubspec.yaml
16
14
  src/flutter/flet_rive/lib/flet_rive.dart
17
- src/flutter/flet_rive/lib/src/create_control.dart
15
+ src/flutter/flet_rive/lib/src/extension.dart
18
16
  src/flutter/flet_rive/lib/src/rive.dart
@@ -0,0 +1 @@
1
+ flet==0.70.0.dev6619
@@ -0,0 +1,3 @@
1
+ library flet_rive;
2
+
3
+ export "src/extension.dart" show Extension;
@@ -0,0 +1,16 @@
1
+ import 'package:flet/flet.dart';
2
+ import 'package:flutter/cupertino.dart';
3
+
4
+ import 'rive.dart';
5
+
6
+ class Extension extends FletExtension {
7
+ @override
8
+ Widget? createWidget(Key? key, Control control) {
9
+ switch (control.type) {
10
+ case "Rive":
11
+ return RiveControl(control: control);
12
+ default:
13
+ return null;
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,75 @@
1
+ import 'package:flet/flet.dart';
2
+ import 'package:flutter/widgets.dart';
3
+ import 'package:rive/rive.dart';
4
+
5
+ class RiveControl extends StatefulWidget {
6
+ final Control control;
7
+
8
+ const RiveControl({super.key, required this.control});
9
+
10
+ @override
11
+ State<RiveControl> createState() => _RiveControlState();
12
+ }
13
+
14
+ class _RiveControlState extends State<RiveControl> {
15
+ @override
16
+ Widget build(BuildContext context) {
17
+ debugPrint("Rive build: ${widget.control.id} (${widget.control.hashCode})");
18
+ var src = widget.control.getString("src");
19
+ if (src == null) {
20
+ return const ErrorControl("Rive must have \"src\" specified.");
21
+ }
22
+
23
+ var artBoard = widget.control.getString("art_board");
24
+ var antiAliasing = widget.control.getBool("enable_anti_aliasing", true)!;
25
+ var useArtBoardSize = widget.control.getBool("use_art_board_size", false)!;
26
+ var fit = widget.control.getBoxFit("fit");
27
+ var alignment = widget.control.getAlignment("alignment");
28
+ var placeholder = widget.control.buildWidget("placeholder");
29
+ var speedMultiplier = widget.control.getDouble("speed_multiplier", 1)!;
30
+ var animations = widget.control.get<List<String>>("animations", const [])!;
31
+ var stateMachines =
32
+ widget.control.get<List<String>>("state_machines", const [])!;
33
+ var headers = widget.control.get("headers")?.cast<String, String>();
34
+ var clipRect = widget.control.getRect("clip_rect");
35
+
36
+ Widget? rive;
37
+
38
+ var assetSrc = widget.control.backend.getAssetSource(src);
39
+ if (assetSrc.isFile) {
40
+ // Local File
41
+ rive = RiveAnimation.file(
42
+ assetSrc.path,
43
+ artboard: artBoard,
44
+ fit: fit,
45
+ antialiasing: antiAliasing,
46
+ useArtboardSize: useArtBoardSize,
47
+ alignment: alignment,
48
+ placeHolder: placeholder,
49
+ speedMultiplier: speedMultiplier,
50
+ animations: animations,
51
+ stateMachines: stateMachines,
52
+ clipRect: clipRect,
53
+ );
54
+ } else {
55
+ // URL
56
+ rive = RiveAnimation.network(
57
+ assetSrc.path,
58
+ fit: fit,
59
+ artboard: artBoard,
60
+ alignment: alignment,
61
+ antialiasing: antiAliasing,
62
+ useArtboardSize: useArtBoardSize,
63
+ placeHolder: placeholder,
64
+ speedMultiplier: speedMultiplier,
65
+ animations: animations,
66
+ stateMachines: stateMachines,
67
+ headers: headers,
68
+ clipRect: clipRect,
69
+ // onInit: _onInit,
70
+ );
71
+ }
72
+
73
+ return ConstrainedControl(control: widget.control, child: rive);
74
+ }
75
+ }