Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Refractor to use children: [] instead of view1, view2 and perhaps a wrapper-widget for view #2

Open
EriKWDev opened this issue Jan 12, 2021 · 3 comments

Comments

@EriKWDev
Copy link

EriKWDev commented Jan 12, 2021

It would be nice if we could have more than two views inside a single splitview! Currently I have to set view2 to SplitView itself multiple times...

I propose that the widget should change to instead incorporate the more common children: [] approach. This would mean that instead of having to nest them like this:

SplitView(
  viewMode: SplitViewMode.Horizontal,
  view1: Container(
    child: Center(child: Text("View1")),
    color: Colors.red,
  ),
  view2: SplitView(
    gripSize: 3.0,
    viewMode: SplitViewMode.Horizontal,
    view1: Container(
      child: Center(child: Text("View2")),
      color: Colors.red,
    ),
    view2: SplitView(
    gripSize: 3.0,
    viewMode: SplitViewMode.Horizontal,
    view1: Container(
      child: Center(child: Text("View3")),
      color: Colors.red,
    ),
    view2: Container(
      child: Center(child: Text("View4")),
      color: Colors.blue,
    ),
  ),
  ),
),

We could do

SplitView({
   children: [
      Container(
          child: Center(child: Text("View1")),
          color: Colors.blue,
        ),
      Container(
          child: Center(child: Text("View2")),
          color: Colors.red,
        ),
      Container(
          child: Center(child: Text("View3")),
          color: Colors.blue,
        ),
     Container(
          child: Center(child: Text("View4")),
          color: Colors.red,
        ),
   ]
}),

It would also be nice if instead of having Containers/any other widget we had a wrapper-widget like ´SplitViewChild´ which could store each view's weights, widths, grip-colors and so-on.

@toshiaki-h
Copy link
Owner

toshiaki-h commented Jan 12, 2021

Thank you for your idea.
I was considering this approach. But I didn't have much time at the time, and this feature was enough for me.
I would like to consider it again with reference to your opinion.
Thank you.

@efraespada
Copy link
Contributor

Since this was introduced, there is no way to limit by a basic width limit.

@toshiaki-h
Copy link
Owner

@efraespada Thank you for pointing this out. Please wait while we fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants