We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
作者您好,我在按照example中的'paging_page.dart'进行修改。
class _PagingPageState extends State<PagingPage> { @override Widget build(BuildContext context) { return Scaffold( appBar: AppBar( title: Text('Paging example'.tr), ), body: CustomPaging( itemBuilder: <MyType>(context, index, item) { return const MyItem(item); }, ), ); } }
此处在itemBuilder中,我返回的是自己的Itme布局,同时传入自定义MyType类Item。但出现 The argument type 'MyType' can't be assigned to the parameter type 'MyType'. 问题, 就问该如何解决? 谢谢
itemBuilder
The argument type 'MyType' can't be assigned to the parameter type 'MyType'.
The text was updated successfully, but these errors were encountered:
找到问题了, ItemType不应该去动它。 直接对自己的item进行类型转换。虽然不知道为什么...
itemBuilder: <ItemType>(context, index, item) { return LeaveItem(item as MyType); }
Sorry, something went wrong.
- fix: EasyPaging.itemBuilder type inference (#762).
b2b5eaa
3.3.4添加了类型推断。如还有问题,请重新开启此issue
No branches or pull requests
作者您好,我在按照example中的'paging_page.dart'进行修改。
此处在
itemBuilder
中,我返回的是自己的Itme布局,同时传入自定义MyType类Item。但出现The argument type 'MyType' can't be assigned to the parameter type 'MyType'.
问题, 就问该如何解决? 谢谢The text was updated successfully, but these errors were encountered: