|
|
|
@ -37,10 +37,12 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final commentsProvider = Provider.of<CommentsProvider>(context, listen: false);
|
|
|
|
final commentsProvider = Provider.of<CommentsProvider>(context);
|
|
|
|
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
final userProvider = Provider.of<UserProvider>(context, listen: false);
|
|
|
|
return Container(
|
|
|
|
return SingleChildScrollView(
|
|
|
|
height: MediaQuery.of(context).size.height * 0.55,
|
|
|
|
child: Wrap(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Container(
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
margin: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
decoration: BoxDecoration(
|
|
|
|
@ -74,13 +76,18 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
|
|
|
|
child: context.translation.comments.heading3(context).custom(fontWeight: FontWeight.w600),
|
|
|
|
child: context.translation.comments.heading3(context).custom(fontWeight: FontWeight.w600),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
commentsProvider.comments.isEmpty
|
|
|
|
commentsProvider.comments.isEmpty
|
|
|
|
? NoItemFound(message: context.translation.noDataFound).expanded
|
|
|
|
? SizedBox(
|
|
|
|
|
|
|
|
height: MediaQuery.of(context).size.height * 0.25,
|
|
|
|
|
|
|
|
child: NoItemFound(message: context.translation.noDataFound),
|
|
|
|
|
|
|
|
)
|
|
|
|
: LazyLoading(
|
|
|
|
: LazyLoading(
|
|
|
|
nextPage: commentsProvider.nextPage,
|
|
|
|
nextPage: commentsProvider.nextPage,
|
|
|
|
onLazyLoad: () async => await commentsProvider.getComments(callId: widget.requestId),
|
|
|
|
onLazyLoad: () async => await commentsProvider.getComments(callId: widget.requestId),
|
|
|
|
child: ListView.separated(
|
|
|
|
child: ListView.separated(
|
|
|
|
itemCount: commentsProvider.comments.length,
|
|
|
|
itemCount: commentsProvider.comments.length,
|
|
|
|
padding: const EdgeInsets.only(top: 16, bottom: 8),
|
|
|
|
padding: const EdgeInsets.only(top: 16, bottom: 8),
|
|
|
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
separatorBuilder: (cxt, index) => 8.height,
|
|
|
|
separatorBuilder: (cxt, index) => 8.height,
|
|
|
|
itemBuilder: (context, itemIndex) {
|
|
|
|
itemBuilder: (context, itemIndex) {
|
|
|
|
final model = commentsProvider.comments[itemIndex];
|
|
|
|
final model = commentsProvider.comments[itemIndex];
|
|
|
|
@ -100,10 +107,10 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
|
|
|
|
).toShadowContainer(context);
|
|
|
|
).toShadowContainer(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).expanded,
|
|
|
|
),
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).expanded,
|
|
|
|
),
|
|
|
|
if (userProvider.user.type == UsersTypes.normal_user) 8.height,
|
|
|
|
if (userProvider.user.type == UsersTypes.normal_user) 8.height,
|
|
|
|
if (userProvider.user.type == UsersTypes.normal_user) // todo its keeps loading when open keyboard or dismiss
|
|
|
|
if (userProvider.user.type == UsersTypes.normal_user) // todo its keeps loading when open keyboard or dismiss
|
|
|
|
AppTextFormField(
|
|
|
|
AppTextFormField(
|
|
|
|
@ -128,6 +135,9 @@ class _CommentsBottomSheetState extends State<CommentsBottomSheet> {
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|