macosui / macos_ui

Flutter widgets and themes implementing the current macOS design language.
https://macosui.github.io/macos_ui/#/
MIT License
1.87k stars 182 forks source link

feat: implement MacosTable #320

Closed pithuene closed 1 month ago

pithuene commented 1 year ago

I implemented a MacosTable widget which looks similar to the macOS NSTableView (adresses #262 and #199). The table features ordering by column and row selection. I have also added some tests for the basic operations. I am sure there is still a lot to improve, both in code and in UI, but I hope this can serve as a starting point.

This is a screenshot of the table widget running in a process monitor application I am building. Note that this is running on linux and the font is not the one used on macOS. Screenshot_2022-11-18_14-13-43

Pre-launch Checklist

Yetispapa commented 1 year ago

This is awesome! @GroovinChip, is there something in the way for merging?

pithuene commented 1 year ago

Hey @GroovinChip, thanks a lot for giving me feedback on my pull request! I tried to implement your requested changes but am not sure what you were asking for in the changelog file.

Thanks again for your time!

GroovinChip commented 1 year ago

Hey @GroovinChip, thanks a lot for giving me feedback on my pull request! I tried to implement your requested changes but am not sure what you were asking for in the changelog file.

Thanks again for your time!

I mean add an entry that describes what the new version adds or changes. If you look at the file you'll understand.

Yetispapa commented 1 year ago

@pithuene looking forward for the merge! Can you maybe give me an example, how the ordering actually work?

It seems, when I change the datasource like so:


StreamBuilder(
          stream: widget.bloc.items,
          initialData: widget.bloc.items.value,
          builder: (BuildContext context, snapshot) {

....

    changeOrder: (order) {
      // this will update the StreamBuilder
      widget.bloc.changeOrder(order.direction.name);
      return true;
    },

The ordering gets messed up somehow. Can you help me here out. Thanks

pithuene commented 1 year ago

I can take a look @Yetispapa but I would need more context, its hard to tell much just from the code you've shown. You need to implement the ordering yourself (which you probably did in bloc.changeOrder, but I can't see). Also I am not sure why you wrapped the table in a StreamBuilder, you should call dataChanged on the data source after the data has changed and let the table do the rebuilding internally.

Yetispapa commented 1 year ago

@pithuene, thanks for the quick repsonse. Alright. Let me check it again.

GroovinChip commented 1 year ago

@pithuene anything new to report on this?

pithuene commented 1 year ago

@GroovinChip not yet. I've been too busy the last few weeks, might find the time next week though.

GroovinChip commented 1 year ago

No problem my dude, take your time. Your life comes first :)

romanr commented 1 month ago

PR gonna be 2 years in couple e months 🍾

pithuene commented 1 month ago

Yeah, sorry about that, but I won't be able to finish it. If anyone wants to use my code and take it from here, feel free. But I'm closing the PR for now.