opt: 一键三连

This commit is contained in:
guozhigq
2024-06-10 12:50:15 +08:00
parent 0f5508e3ce
commit 5c9fbbcfb2

View File

@ -185,7 +185,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
); );
_scaleTransition = Tween<double>(begin: 0.5, end: 1.5).animate(_controller) _scaleTransition = Tween<double>(begin: 0.5, end: 1.5).animate(_controller)
..addListener(() async { ..addListener(() async {
_progress.value = _scaleTransition.value - 0.5; _progress.value =
double.parse((_scaleTransition.value - 0.5).toStringAsFixed(3));
if (_progress.value == 1) { if (_progress.value == 1) {
if (_controller.status == AnimationStatus.completed) { if (_controller.status == AnimationStatus.completed) {
await videoIntroController.actionOneThree(); await videoIntroController.actionOneThree();
@ -560,8 +561,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
Widget progressWidget(progress) { Widget progressWidget(progress) {
return SizedBox( return SizedBox(
width: 68, width: 33,
height: 68, height: 33,
child: CircularProgressIndicator( child: CircularProgressIndicator(
value: progress.value, value: progress.value,
strokeWidth: 2, strokeWidth: 2,
@ -575,16 +576,15 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
bool likeStatus = videoIntroController.hasLike.value; bool likeStatus = videoIntroController.hasLike.value;
ColorScheme colorScheme = Theme.of(context).colorScheme; ColorScheme colorScheme = Theme.of(context).colorScheme;
return Stack( return Stack(
alignment: Alignment.center,
children: [ children: [
progressWidget(_progress), Positioned(child: progressWidget(_progress), top: 15, left: 24),
InkWell( InkWell(
onTapDown: (details) { onTapDown: (details) {
feedBack(); feedBack();
if (videoIntroController.userInfo == null) { // if (videoIntroController.userInfo == null) {
SmartDialog.showToast('账号未登录'); // SmartDialog.showToast('账号未登录');
return; // return;
} // }
_controller.forward(); _controller.forward();
}, },
onTapUp: (TapUpDetails details) { onTapUp: (TapUpDetails details) {
@ -640,9 +640,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
), ),
'coin': Obx( 'coin': Obx(
() => Stack( () => Stack(
alignment: Alignment.center,
children: [ children: [
progressWidget(_progress), Positioned(child: progressWidget(_progress), top: 15, left: 24),
ActionItem( ActionItem(
icon: Image.asset('assets/images/coin.png', width: 30), icon: Image.asset('assets/images/coin.png', width: 30),
onTap: handleState(videoIntroController.actionCoinVideo), onTap: handleState(videoIntroController.actionCoinVideo),
@ -654,9 +653,8 @@ class _VideoInfoState extends State<VideoInfo> with TickerProviderStateMixin {
), ),
'collect': Obx( 'collect': Obx(
() => Stack( () => Stack(
alignment: Alignment.center,
children: [ children: [
progressWidget(_progress), Positioned(child: progressWidget(_progress), top: 15, left: 24),
ActionItem( ActionItem(
icon: const Icon(Icons.star_border), icon: const Icon(Icons.star_border),
selectIcon: const Icon(Icons.star), selectIcon: const Icon(Icons.star),