Updates for publishing Rive Flutter

Some updates to clean up warnings and info reported from flutter analyze.

Diffs=
83e539cff Updates for publishing Rive Flutter (#5666)

Co-authored-by: Luigi Rosso <luigi-rosso@users.noreply.github.com>
This commit is contained in:
luigi-rosso
2023-07-25 23:36:50 +00:00
parent 8dfb05c64d
commit c1c4c94533
11 changed files with 30 additions and 20 deletions

View File

@ -1 +1 @@
215d11c864cc550adbcfc9a47691cf9583fa7f25
83e539cffb488c3f88fe68a997d4251ecd309be7

View File

@ -1,8 +1,11 @@
## UPCOMING
## 0.11.6
- Follow path constraint.
- Expose `useArtboardSize` in `RiveAnimation` widget. Which is a boolean that determines whether to use the inherent size of the artboard, i.e. the absolute size defined by the artboard, or size the widget based on the available constraints only (sized by parent).
- Add `clipRect` to `RiveAnimation` and `Rive` widgets. Forces the artboard to clip with the provided Rect.
- Fixed `Rive` widget always applying a clip, regardless of `Artboard.clip` value (set in the Editor).
- Support for run targeting with text modifiers.
- Transform constraint can target text origin.
## 0.11.5
@ -11,6 +14,7 @@
- Fix [[331](https://github.com/rive-app/rive-flutter/issues/331)] - external control on a Joystick not applied
Deprecated:
- `assetResolver` parameter on `RiveFile.network` and `RiveFile.import`. Use `assetLoader` instead - see `CallbackAssetLoader`.
- `NetworkAssetResolver`, use `CallbackAssetLoader` instead.

View File

@ -6,7 +6,6 @@ class CoreStringType extends CoreFieldType<String> {
String deserialize(BinaryReader reader) =>
reader.readString(explicitLength: true);
@override
void read(BinaryReader reader) {
var length = reader.readVarUint();
reader.read(length);

View File

@ -195,8 +195,8 @@ class StateTransition extends StateTransitionBase {
animationFrom.durationSeconds;
}
// Sometimes the time never reaches exitTime due to precision differences
// on diff platforms
// Sometimes the time never reaches exitTime due to precision
// differences on diff platforms
if (time < exitTime - 1 / 1000) {
return AllowTransition.waitingForExit;
}

View File

@ -2,10 +2,4 @@ import 'package:rive/src/generated/assets/drawable_asset_base.dart';
export 'package:rive/src/generated/assets/drawable_asset_base.dart';
abstract class DrawableAsset extends DrawableAssetBase {
@override
void heightChanged(double from, double to) {}
@override
void widthChanged(double from, double to) {}
}
abstract class DrawableAsset extends DrawableAssetBase {}

View File

@ -16,7 +16,6 @@ export 'package:rive/src/generated/constraints/follow_path_constraint_base.dart'
class FollowPathConstraint extends FollowPathConstraintBase {
final ui.Path _worldPath = ui.Path();
@override
Mat2D get targetTransform {
if (target is! Shape) {
return target!.worldTransform;

View File

@ -525,10 +525,10 @@ class Text extends TextBase with TextStyleContainer {
super.update(dirt);
bool rebuildRenderStyles = dirt & ComponentDirt.paint != 0;
if (dirt & ComponentDirt.path != 0) {
// TODO: (Lugi) Hardcoded font for now
// TODO: (Luigi) Hardcoded font for now
const defaultFontAsset = 'assets/fonts/Inter-Regular.ttf';
if (_defaultFont == null) {
final future = rootBundle.load(defaultFontAsset).then((fontAsset) {
rootBundle.load(defaultFontAsset).then((fontAsset) {
_defaultFont = Font.decode(fontAsset.buffer.asUint8List());
// Reshape now that we have font.
markShapeDirty();

View File

@ -341,6 +341,17 @@ class RangeMapper {
}
index++;
}
if (characterCount > 0) {
var indexTo = indexFrom + characterCount;
if (indexTo > start && end > indexFrom) {
var actualStart = max(start, indexFrom);
int selected = min(end, indexTo) - actualStart;
if (selected > 0) {
indices.add(actualStart);
lengths.add(selected);
}
}
}
indices.add(end);
return RangeMapper(indices, lengths);
}

View File

@ -1,5 +1,5 @@
name: rive
version: 0.11.5
version: 0.11.6
homepage: https://rive.app
description: Rive 2 Flutter Runtime. This package provides runtime functionality for playing back and interacting with animations built with the Rive editor available at https://rive.app.
repository: https://github.com/rive-app/rive-flutter

View File

@ -192,8 +192,8 @@ void main() {
// by default we try to check for assets
});
test(
'If we provide a callback, we are hit first, and success means no cdn hit',
() async {
'If we provide a callback, we are hit first, and success means '
'no cdn hit', () async {
// lets just return an image
final imageBytes = loadFile('assets/file.png');
final parameters = [];
@ -219,8 +219,8 @@ void main() {
});
test(
'If we provide a callback, we are hit first, a failure means we hit cdn',
() async {
'If we provide a callback, we are hit first, a failure means we '
'hit cdn', () async {
// lets just return an image
final parameters = [];
await HttpOverrides.runZoned(() async {

View File

@ -11,7 +11,10 @@ import 'src/utils.dart';
void main() {
late MockHttpClient mockHttpClient;
// ignore: close_sinks
late MockHttpClientRequest request;
setUpAll(() {
registerFallbackValue(ArtboardFake());
registerFallbackValue(Uri());