tomasweigenast / paged-datatable

A DataTable widget for Flutter that supports cursor/offset pagination, filters and sorting
https://pub.dev/packages/paged_datatable
MIT License
15 stars 11 forks source link

custom footer not shown #4

Closed heshesh2010 closed 10 months ago

heshesh2010 commented 12 months ago

hi , after upgraded to 1.3.0 and set theme like

    theme: const PagedDataTableThemeData(
                      configuration: PagedDataTableConfiguration(
                        footer: PagedDataTableFooterConfiguration(
                            showTotalElements: true, visible: false),
                        pageSizes: [2, 10, 20, 50, 100],
                      ),
                      headerBackgroundColor: Color(0xffFAFAFA),
                      rowColors: [
                        Colors.white,
                        Color(0xffF2F2F2),
                      ]),

and my custom footer is not shown

footer: Container( height: 50, color: Colors.black, child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( children: [ const Text("Rows per page:"), 10.horizontalSpace, DropdownButton( underline: Container(), icon: const Padding( padding: EdgeInsets.symmetric(horizontal: 8.0), child: Icon(Icons.keyboard_arrow_down_sharp), ), //isDense: true, padding: EdgeInsets.zero, hint: Text( "10", style: Get.textTheme.bodyMedium, ), items: ['10', '20', '30', '40'] .map((String value) { return DropdownMenuItem( value: value, child: Text(value), ); }).toList(), onChanged: (value) {}, ) ], ), Row( children: [ const Text("1-10 of 100"), 10.horizontalSpace, IconButton( onPressed: () {}, icon: const Icon(Icons.arrow_back_ios)), IconButton( onPressed: () {}, icon: const Icon(Icons.arrow_forward_ios)), ], ) ], ), ),

tomasweigenast commented 12 months ago

Oh, I got it. The footer property is used to show additional widgets to the actual PagedDataTable footer, it does not add a custom footer. Custom widgets are placed to the left of the footer.

If you want a custom footer, the best you can do is place your custom footer widget next to the PagedDataTable widget inside a Column.

Although, it can be a good idea to place a custom footer inside the PagedDataTable as you mention.

heshesh2010 commented 12 months ago

ok how I can navigate to next or previous page or choose rows count from drop menu using the controller ? cuz I'm using my own custom widgets

tomasweigenast commented 10 months ago

Now it's possible. Check out the new version