Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NoticeBar] android下跑马灯效果滚动一会就一直卡住滚不动 #441

Open
jiaozhouzhou opened this issue Jan 6, 2025 · 1 comment

Comments

@jiaozhouzhou
Copy link

jiaozhouzhou commented Jan 6, 2025

tdesign-flutter 版本

0.1.7

重现链接

No response

重现步骤

`import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:tdesign_flutter/tdesign_flutter.dart' show TDNoticeBar, TDIcons, TDNoticeBarStyle;

class ScrollNotice extends StatelessWidget {
final double width;
final double height;
final EdgeInsetsGeometry? margin;
final String? text;

const ScrollNotice({
super.key,
required this.width,
required this.height,
this.margin,
this.text,
});

@OverRide
Widget build(BuildContext context) {
return text!=null ? Container(
width: width,
height: height,
margin: margin,
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.r),
),
child: TDNoticeBar(
context: text,
speed: 50,
prefixIcon: TDIcons.sound,
marquee: true,
style: TDNoticeBarStyle(
leftIconColor: const Color.fromRGBO(247, 225, 168, 1.0),
padding: EdgeInsets.symmetric(vertical: 14.w, horizontal: 20.w),
backgroundColor: const Color.fromRGBO(63, 60, 92, 1),
textStyle: TextStyle(color: const Color.fromRGBO(247, 225, 168, 1.0), fontSize: 26.sp, height: 1)
),
),
) : const SizedBox(height: 0);
}
}`

使用
ScrollNotice(width: 709.w, height: 60.w, margin: EdgeInsets.only(left: 28.w),text: "提示文字描述提示文字描述提示文字描述提示文字描述提示文字")

报错信息
Unhandled Exception: 'package:flutter/src/widgets/scroll_activity.dart': Failed assertion: line 655 pos 15: 'duration > Duration.zero': is not true.
E/flutter ( 4633): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter ( 4633): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter ( 4633): #2 new DrivenScrollActivity (package:flutter/src/widgets/scroll_activity.dart:655:15)
E/flutter ( 4633): #3 ScrollPositionWithSingleContext.animateTo (package:flutter/src/widgets/scroll_position_with_single_context.dart:186:43)
E/flutter ( 4633): #4 ScrollController.animateTo (package:flutter/src/widgets/scroll_controller.dart:203:68)
E/flutter ( 4633): #5 _TDNoticeBarState._scroll. (package:tdesign_flutter/src/components/notice_bar/td_notice_bar.dart:144:34)
E/flutter ( 4633): #6 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:398:19)
E/flutter ( 4633): #7 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:429:5)
E/flutter ( 4633): #8 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:184:12)
E/flutter ( 4633):

期望结果

No response

实际结果

No response

Flutter版本

Flutter(3.19.5)

设备与机型信息

电视盒子

系统版本

Android TV 10

补充说明

No response

Copy link
Contributor

github-actions bot commented Jan 6, 2025

👋 @jiaozhouzhou,感谢给 TDesign 提出了 issue。
请根据 issue 模版确保背景信息的完善,我们将调查并尽快回复你。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant