mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-24 18:18:38 +00:00
@@ -27,33 +27,38 @@ class VideoReplyController extends ReplyController<MainListReply>
|
||||
dynamic get sourceId => IdUtils.av2bv(aid);
|
||||
|
||||
bool _isFabVisible = true;
|
||||
late final AnimationController fabAnimationCtr = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
)..forward();
|
||||
late final AnimationController _fabAnimationCtr;
|
||||
late final CurvedAnimation _curvedAnimation;
|
||||
late final Animation<Offset> animation;
|
||||
|
||||
late final anim =
|
||||
Tween<Offset>(
|
||||
begin: const Offset(0, 2),
|
||||
end: Offset.zero,
|
||||
).animate(
|
||||
CurvedAnimation(
|
||||
parent: fabAnimationCtr,
|
||||
curve: Curves.easeInOut,
|
||||
),
|
||||
);
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
_fabAnimationCtr = AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
)..forward();
|
||||
_curvedAnimation = CurvedAnimation(
|
||||
parent: _fabAnimationCtr,
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
animation = Tween<Offset>(
|
||||
begin: const Offset(0, 2),
|
||||
end: Offset.zero,
|
||||
).animate(_curvedAnimation);
|
||||
}
|
||||
|
||||
void showFab() {
|
||||
if (!_isFabVisible) {
|
||||
_isFabVisible = true;
|
||||
fabAnimationCtr.forward();
|
||||
_fabAnimationCtr.forward();
|
||||
}
|
||||
}
|
||||
|
||||
void hideFab() {
|
||||
if (_isFabVisible) {
|
||||
_isFabVisible = false;
|
||||
fabAnimationCtr.reverse();
|
||||
_fabAnimationCtr.reverse();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +78,8 @@ class VideoReplyController extends ReplyController<MainListReply>
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
fabAnimationCtr.dispose();
|
||||
_curvedAnimation.dispose();
|
||||
_fabAnimationCtr.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ class _VideoReplyPanelState extends State<VideoReplyPanel>
|
||||
right: kFloatingActionButtonMargin,
|
||||
bottom: kFloatingActionButtonMargin + bottom,
|
||||
child: SlideTransition(
|
||||
position: _videoReplyController.anim,
|
||||
position: _videoReplyController.animation,
|
||||
child: FloatingActionButton(
|
||||
heroTag: null,
|
||||
onPressed: () {
|
||||
|
||||
@@ -36,7 +36,7 @@ import 'package:flutter/foundation.dart' show kDebugMode;
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart' hide ContextExtensionss;
|
||||
import 'package:get/get.dart';
|
||||
|
||||
class ReplyItemGrpc extends StatelessWidget {
|
||||
const ReplyItemGrpc({
|
||||
|
||||
Reference in New Issue
Block a user