godilite / editable

This library allows you to create editable tables and spreadsheets with ease, either by providing initial row and column count to display an empty table or use it with predefined rows and column data sets.
MIT License
104 stars 36 forks source link

add non-editable columns and focusedBorder #28

Closed thumbert closed 3 years ago

thumbert commented 3 years ago

Hi,

Thanks for the package. I realized I needed columns that are non-editable, so I added a bool for this. I've also added the ability to specify a focusBorder for the cell you are editing (I think it looks nicer -- and is more similar to what a spreadsheet looks like.)

Please take a look at line 112 in table_body.dart, I don't know how to get the fontSize to match with the fontSize of the TextFormField. You may need to fix that.

Things that would be nice to have: 1) Ability to drag a cell down to populate empty cells 2) Some basic Copy/Paste/Undo functionality I'm just learning Flutter, so probably these are above my skill level as of now, but I'll open a ticket with suggestions.

Best regards, Tony

thumbert commented 3 years ago

There is an issue with the data alignment in general. Now only one kind of alignment is possible for the entire table.

For the non-editable column see line 95 in table_body. I have set it to centerLeft, but this should be available to be set outside, probably best on a by-column basis -- at least as a first improvement. For example, text leftAligned, but numbers rightAligned, etc.

godilite commented 3 years ago

Awesome, thank you for your observations and kind contributions, will look into adding those features when I have the time.