Skip to content

Commit

Permalink
fix: Error correction.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Sep 6, 2022
1 parent 3f1c1aa commit 9cf92ae
Show file tree
Hide file tree
Showing 28 changed files with 345 additions and 157 deletions.
13 changes: 10 additions & 3 deletions packages/firebase_model_notifier/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -309,14 +316,14 @@ packages:
name: katana_firebase
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
katana_flutter:
dependency: transitive
description:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -351,7 +358,7 @@ packages:
name: model_notifier
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
nm:
dependency: transitive
description:
Expand Down
9 changes: 8 additions & 1 deletion packages/katana_firebase/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
http:
dependency: transitive
description:
Expand Down Expand Up @@ -288,7 +295,7 @@ packages:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
matcher:
dependency: transitive
description:
Expand Down
13 changes: 10 additions & 3 deletions packages/katana_module/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
google_fonts:
dependency: transitive
description:
Expand Down Expand Up @@ -265,14 +272,14 @@ packages:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
katana_routing:
dependency: "direct main"
description:
name: katana_routing
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -307,7 +314,7 @@ packages:
name: model_notifier
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
nm:
dependency: transitive
description:
Expand Down
9 changes: 8 additions & 1 deletion packages/katana_routing/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
google_fonts:
dependency: "direct main"
description:
Expand Down Expand Up @@ -265,7 +272,7 @@ packages:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
matcher:
dependency: transitive
description:
Expand Down
36 changes: 33 additions & 3 deletions packages/masamune/lib/animation/sequence_animation_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ class _SequenceAnimationBuilder {

_SequenceAnimation animate(AnimationController controller) {
final int longestTimeMicro = _currentLengthInMicroSeconds();
// Sets the duration of the controller
controller.duration = Duration(microseconds: longestTimeMicro);

final Map<Object, Animatable> animatables = {};
Expand All @@ -137,7 +138,7 @@ class _SequenceAnimationBuilder {
final Interval intervalCurve = Interval(begin, end, curve: info.curve);
if (animatables[info.tag] == null) {
animatables[info.tag] =
IntervalAnimatable.chainCurve(info.animatable, intervalCurve);
_IntervalAnimatable.chainCurve(info.animatable, intervalCurve);
begins[info.tag] = begin;
ends[info.tag] = end;
} else {
Expand All @@ -147,10 +148,10 @@ class _SequenceAnimationBuilder {
"a) Have them not overlap \n"
"b) Add them in an ordered fashion\n"
"Animation with tag ${info.tag} ends at ${ends[info.tag]} but also begins at $begin");
animatables[info.tag] = IntervalAnimatable(
animatables[info.tag] = _IntervalAnimatable(
animatable: animatables[info.tag]!,
defaultAnimatable:
IntervalAnimatable.chainCurve(info.animatable, intervalCurve),
_IntervalAnimatable.chainCurve(info.animatable, intervalCurve),
begin: begins[info.tag]!,
end: ends[info.tag]!,
);
Expand Down Expand Up @@ -180,3 +181,32 @@ class _SequenceAnimation {
return _animations[key]!;
}
}

class _IntervalAnimatable<T> extends Animatable<T> {
_IntervalAnimatable({
required this.animatable,
required this.defaultAnimatable,
required this.begin,
required this.end,
});

final Animatable animatable;
final Animatable defaultAnimatable;

final double begin;

final double end;

static Animatable chainCurve(Animatable parent, Interval interval) {
return parent.chain(CurveTween(curve: interval));
}

@override
T transform(double t) {
if (t >= begin && t <= end) {
return animatable.transform(t);
} else {
return defaultAnimatable.transform(t);
}
}
}
1 change: 0 additions & 1 deletion packages/masamune/lib/masamune.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import 'dart:async';

import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:flutter_sequence_animation/flutter_sequence_animation.dart';
import 'package:katana_module/katana_module.dart';
import 'package:loading_animations/loading_animations.dart';

Expand Down
22 changes: 11 additions & 11 deletions packages/masamune/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -242,13 +242,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_sequence_animation:
dependency: "direct main"
description:
name: flutter_sequence_animation
url: "https://pub.dartlang.org"
source: hosted
version: "4.0.0-nullsafety"
flutter_test:
dependency: "direct dev"
description: flutter
Expand All @@ -259,6 +252,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
google_fonts:
dependency: transitive
description:
Expand Down Expand Up @@ -307,21 +307,21 @@ packages:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
katana_module:
dependency: "direct main"
description:
name: katana_module
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
katana_routing:
dependency: transitive
description:
name: katana_routing
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
loading_animations:
dependency: "direct main"
description:
Expand Down Expand Up @@ -363,7 +363,7 @@ packages:
name: model_notifier
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
nm:
dependency: transitive
description:
Expand Down
17 changes: 12 additions & 5 deletions packages/masamune_ads/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
google_fonts:
dependency: transitive
description:
Expand Down Expand Up @@ -314,21 +321,21 @@ packages:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
katana_module:
dependency: transitive
description:
name: katana_module
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
katana_routing:
dependency: transitive
description:
name: katana_routing
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
loading_animations:
dependency: transitive
description:
Expand All @@ -342,7 +349,7 @@ packages:
name: masamune
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+12"
version: "0.13.0+13"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -377,7 +384,7 @@ packages:
name: model_notifier
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
nm:
dependency: transitive
description:
Expand Down
23 changes: 15 additions & 8 deletions packages/masamune_agora/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ packages:
name: firebase_model_notifier
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
firebase_storage:
dependency: transitive
description:
Expand Down Expand Up @@ -413,6 +413,13 @@ packages:
description: flutter
source: sdk
version: "0.0.0"
font_awesome_flutter:
dependency: transitive
description:
name: font_awesome_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "10.1.0"
google_fonts:
dependency: transitive
description:
Expand Down Expand Up @@ -468,28 +475,28 @@ packages:
name: katana_firebase
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
katana_flutter:
dependency: transitive
description:
name: katana_flutter
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+7"
version: "0.13.0+8"
katana_module:
dependency: transitive
description:
name: katana_module
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
katana_routing:
dependency: transitive
description:
name: katana_routing
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+9"
version: "0.13.0+10"
loading_animations:
dependency: transitive
description:
Expand All @@ -503,14 +510,14 @@ packages:
name: masamune
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+12"
version: "0.13.0+13"
masamune_firebase:
dependency: "direct main"
description:
name: masamune_firebase
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+12"
version: "0.13.0+13"
matcher:
dependency: transitive
description:
Expand Down Expand Up @@ -545,7 +552,7 @@ packages:
name: model_notifier
url: "https://pub.dartlang.org"
source: hosted
version: "0.13.0+8"
version: "0.13.0+9"
nm:
dependency: transitive
description:
Expand Down
Loading

0 comments on commit 9cf92ae

Please sign in to comment.