skip to Main Content

I am using the groupedlistview library and I have a problem, after all the elements there is an empty space, how to get rid of it?

GroupedListView<BookComposition, String>(
                              shrinkWrap: true,
                              elements: _elements,
                              groupBy: (element) => element.ticketTypeName!,
                              groupComparator: (value1, value2) => value2.compareTo(value1),
                              itemComparator: (item1, item2) =>                                 item1.ticketTypeName!.compareTo(item2.ticketTypeName!),
                              order: GroupedListOrder.ASC,
                              useStickyGroupSeparators: false,
                              groupSeparatorBuilder: (String typeName) =>
                                  Container(
                                    height: 0,
                                  ),
                              itemBuilder: (c, element) {
                                if (element.ticketTypeName == ticketTypeName) {
                                  return ActionsTile(...);
                                }
                                return Container();
                              }),

I don’t seem to have any indentations, but the problem persists. help me please

enter image description here

2

Answers


  1. class Solution {
    public:
        int firstUniqChar(string s) {
            vector<int> oc(26);
            //store frequency of each character of s
            for (auto i : s) oc[i - 'a']++;
            //first character with frequency = 1 is the answer
            for (int i = 0; i < s.size(); i++) {
                if (oc[s[i] - 'a'] == 1) return i;
            }
            //no character with frequency = 1
            return -1;
        }
    };
    
    Login or Signup to reply.
  2.   padding: EdgeInsets.zero,
    

    add padding on GroupedListView

            GroupedListView<BookComposition, String>(
              padding: EdgeInsets.zero,
              shrinkWrap: true,
              elements: _elements,
              groupBy: (element) => element.ticketTypeName!,
              groupComparator: (value1, value2) => value2.compareTo(value1),
              itemComparator: (item1, item2) => item1.ticketTypeName!.compareTo(item2.ticketTypeName!),
              order: GroupedListOrder.ASC,
              useStickyGroupSeparators: false,
              groupSeparatorBuilder: (String typeName) =>
                  Container(
                    height: 0,
                  ),
              itemBuilder: (c, element) {
                if (element.ticketTypeName == ticketTypeName) {
                  return ActionsTile(...);
                }
                return Container();
              },),
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search