caduandrade / multi_split_view

Provides horizontal or vertical multiple split view for Flutter.
https://caduandrade.github.io/multi_split_view/
MIT License
129 stars 24 forks source link

[Feature request] Custom divider as widget #16

Closed sirkalmi closed 2 years ago

sirkalmi commented 2 years ago

I want to set a widget as a divider, is it possible?

caduandrade commented 2 years ago

Hi!

It's not possible. It is only possible to define a custom painting. Are you needing to define your own widget?

sirkalmi commented 2 years ago

Hi!

"Are you needing to define your own widget?"

The graphic is designed with a unique divider that has a handle that looks like a floating button.

caduandrade commented 2 years ago

I'll see how to make it available ok?

sirkalmi commented 2 years ago

I would be very grateful!

caduandrade commented 2 years ago

I think it might be necessary to have an optional builder to build each instance of Divider Widget. In this case, I think this could ignore the painter defined in the theme and use only the Widget. What do you think?

The Divider's thickness should continue to be defined by the theme. Then the created widget will be resized by that width or height.

sirkalmi commented 2 years ago

"I think it might be necessary to have an optional builder to build each instance of Divider Widget. In this case, I think this could ignore the painter defined in the theme and use only the Widget. What do you think?"

I think that would be the right solution.

caduandrade commented 2 years ago

Hi @sirkalmi !

If you want, you can try out the master branch before I release a version. Perhaps you will need something else.

    MultiSplitViewTheme(
        child: MultiSplitView(
            children: children,
            dividerBuilder: (Axis axis,
                int index,
                bool resizable,
                bool dragging,
                bool highlighted,
                MultiSplitViewThemeData themeData) {
              Color color = Colors.orange;
              if (dragging) {
                color = Colors.yellow;
              } else if (highlighted) {
                color = Colors.amber;
              }
              return Container(color: color);
            }),
        data: MultiSplitViewThemeData(dividerThickness: 20));
caduandrade commented 2 years ago

@sirkalmi

I will release the version and close this issue. If you need anything, let me know.

sirkalmi commented 2 years ago

Yes, thank you very much for the development! Sorry for the late reply, I haven't had time to try yet.