chenfanfang / flutter_tableview

A flutter widget like iOS UITableview. let listView with section header and each section header will hover at the top.
https://pub.dev/packages/flutter_tableview
MIT License
42 stars 17 forks source link

Inkwell should be wrapped in Material() #6

Open SpudLaw opened 3 years ago

SpudLaw commented 3 years ago

In the flutter_tableview 1.0.1 docs in the How to use section:

The _sectionHeaderBuilder and the _cellBuilder both use Inkwell which needs to be wrapped in Material for it to work properly. Something like:

// Section header widget builder.
  Widget _sectionHeaderBuilder(BuildContext context, int section) {
    return Material(
      child: InkWell(
        onTap: () {
          print('click section header. -> section:$section');
        },
      child: Container(
        alignment: Alignment.centerLeft,
        padding: EdgeInsets.only(left: 16.0),
        color: Color.fromRGBO(220, 220, 220, 1),
        height: 100,
        child: Text('I am section header -> section:$section'),
      ),
    ));
  }