How can i center a widget between two column children? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!What is the relation between stateful and stateless widgets in Flutter?Flutter: how to traverse a Widget children?A column widget there all children match biggest widget widthStreamBuilder Widget is not rendered if nested in children: <Widget>[]In Flutter, how to balance the children of the Wrap widget?How to align single widgets in Flutter?How to remove space between widgets in Column in flutter?Flutter positioning widgets in ColumnHow to align center Y of widget to top edge of anotherFlutter: How to align widget to the topRight of column?

Why do the Z-fighters hide their power?

Does the main washing effect of soap come from foam?

Where and when has Thucydides been studied?

Is there night in Alpha Complex?

What does Sonny Burch mean by, "S.H.I.E.L.D. and HYDRA don't even exist anymore"?

Twin's vs. Twins'

How do I say "this must not happen"?

How to make an animal which can only breed for a certain number of generations?

An isoperimetric-type inequality inside a cube

Why can't fire hurt Daenerys but it did to Jon Snow in season 1?

French equivalents of おしゃれは足元から (Every good outfit starts with the shoes)

Searching extreme points of polyhedron

Found this skink in my tomato plant bucket. Is he trapped? Or could he leave if he wanted?

Does a random sequence of vectors span a Hilbert space?

Is the Mordenkainen's Sword spell underpowered?

Should man-made satellites feature an intelligent inverted "cow catcher"?

Vertical ranges of Column Plots in 12

Flight departed from the gate 5 min before scheduled departure time. Refund options

How to get a flat-head nail out of a piece of wood?

How do Java 8 default methods hеlp with lambdas?

New Order #6: Easter Egg

By what mechanism was the 2017 UK General Election called?

How to achieve cat-like agility?

The test team as an enemy of development? And how can this be avoided?



How can i center a widget between two column children?



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Data science time! April 2019 and salary with experience
The Ask Question Wizard is Live!What is the relation between stateful and stateless widgets in Flutter?Flutter: how to traverse a Widget children?A column widget there all children match biggest widget widthStreamBuilder Widget is not rendered if nested in children: <Widget>[]In Flutter, how to balance the children of the Wrap widget?How to align single widgets in Flutter?How to remove space between widgets in Column in flutter?Flutter positioning widgets in ColumnHow to align center Y of widget to top edge of anotherFlutter: How to align widget to the topRight of column?



.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I have a column which contains 3 children.



How can i place a widget (red rectangle) on top of this column and center it between the second and the last child?



This is what i try to achieve:



enter image description here










share|improve this question






















  • What is the use-case? This is not something that you can naturally achieve using widgets

    – Rémi Rousselet
    Mar 22 at 13:40











  • 1-3 are buttons which lead to further functions. The red rectangle widget should be shown, when the user is not logged in (=overlay for buttons 2&3). Buttons 2&3 are in disabled state, but i also need this rectangle for a message box. I have achieved it with a Stack-widget and margin-value, but i prefer a solution with "real center" between those two widgets.

    – Jan Möller
    Mar 22 at 14:14

















1















I have a column which contains 3 children.



How can i place a widget (red rectangle) on top of this column and center it between the second and the last child?



This is what i try to achieve:



enter image description here










share|improve this question






















  • What is the use-case? This is not something that you can naturally achieve using widgets

    – Rémi Rousselet
    Mar 22 at 13:40











  • 1-3 are buttons which lead to further functions. The red rectangle widget should be shown, when the user is not logged in (=overlay for buttons 2&3). Buttons 2&3 are in disabled state, but i also need this rectangle for a message box. I have achieved it with a Stack-widget and margin-value, but i prefer a solution with "real center" between those two widgets.

    – Jan Möller
    Mar 22 at 14:14













1












1








1








I have a column which contains 3 children.



How can i place a widget (red rectangle) on top of this column and center it between the second and the last child?



This is what i try to achieve:



enter image description here










share|improve this question














I have a column which contains 3 children.



How can i place a widget (red rectangle) on top of this column and center it between the second and the last child?



This is what i try to achieve:



enter image description here







flutter






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 22 at 13:31









Jan MöllerJan Möller

134215




134215












  • What is the use-case? This is not something that you can naturally achieve using widgets

    – Rémi Rousselet
    Mar 22 at 13:40











  • 1-3 are buttons which lead to further functions. The red rectangle widget should be shown, when the user is not logged in (=overlay for buttons 2&3). Buttons 2&3 are in disabled state, but i also need this rectangle for a message box. I have achieved it with a Stack-widget and margin-value, but i prefer a solution with "real center" between those two widgets.

    – Jan Möller
    Mar 22 at 14:14

















  • What is the use-case? This is not something that you can naturally achieve using widgets

    – Rémi Rousselet
    Mar 22 at 13:40











  • 1-3 are buttons which lead to further functions. The red rectangle widget should be shown, when the user is not logged in (=overlay for buttons 2&3). Buttons 2&3 are in disabled state, but i also need this rectangle for a message box. I have achieved it with a Stack-widget and margin-value, but i prefer a solution with "real center" between those two widgets.

    – Jan Möller
    Mar 22 at 14:14
















What is the use-case? This is not something that you can naturally achieve using widgets

– Rémi Rousselet
Mar 22 at 13:40





What is the use-case? This is not something that you can naturally achieve using widgets

– Rémi Rousselet
Mar 22 at 13:40













1-3 are buttons which lead to further functions. The red rectangle widget should be shown, when the user is not logged in (=overlay for buttons 2&3). Buttons 2&3 are in disabled state, but i also need this rectangle for a message box. I have achieved it with a Stack-widget and margin-value, but i prefer a solution with "real center" between those two widgets.

– Jan Möller
Mar 22 at 14:14





1-3 are buttons which lead to further functions. The red rectangle widget should be shown, when the user is not logged in (=overlay for buttons 2&3). Buttons 2&3 are in disabled state, but i also need this rectangle for a message box. I have achieved it with a Stack-widget and margin-value, but i prefer a solution with "real center" between those two widgets.

– Jan Möller
Mar 22 at 14:14












2 Answers
2






active

oldest

votes


















0














You can wrap Widget 2 & 3 in a Stack, then in that Stack have a Center Widget with the Red Widget inside of it.



This would only work if 2 & 3 are the same size though...






share|improve this answer






























    0














    You can create something like this,



    Column(
    mainAxisAlignment: MainAxisAlignment.center,
    children: <Widget>[
    RaisedButton(
    onPressed: null,
    child: Text("ONE"),
    ),
    Stack(
    alignment: Alignment.center,
    children: [
    Column(
    children: <Widget>[
    RaisedButton(
    onPressed: null,
    child: Text("TWO"),
    ),
    RaisedButton(
    onPressed: null,
    child: Text("THREE"),
    ),
    ],
    ),
    Align(
    alignment: Alignment.center,
    child: Container(
    color: Colors.red,
    height: 50,
    width: 50,
    ),
    )
    ],
    )
    ],
    ),


    • Column

      • Button

      • Stack

      • Column

        • Button

        • Button


      • Container(Red Area) Wrapped with Align Widget and Align by the center.






    share|improve this answer























      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55300738%2fhow-can-i-center-a-widget-between-two-column-children%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      You can wrap Widget 2 & 3 in a Stack, then in that Stack have a Center Widget with the Red Widget inside of it.



      This would only work if 2 & 3 are the same size though...






      share|improve this answer



























        0














        You can wrap Widget 2 & 3 in a Stack, then in that Stack have a Center Widget with the Red Widget inside of it.



        This would only work if 2 & 3 are the same size though...






        share|improve this answer

























          0












          0








          0







          You can wrap Widget 2 & 3 in a Stack, then in that Stack have a Center Widget with the Red Widget inside of it.



          This would only work if 2 & 3 are the same size though...






          share|improve this answer













          You can wrap Widget 2 & 3 in a Stack, then in that Stack have a Center Widget with the Red Widget inside of it.



          This would only work if 2 & 3 are the same size though...







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Mar 22 at 17:56









          01leo01leo

          581115




          581115























              0














              You can create something like this,



              Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: <Widget>[
              RaisedButton(
              onPressed: null,
              child: Text("ONE"),
              ),
              Stack(
              alignment: Alignment.center,
              children: [
              Column(
              children: <Widget>[
              RaisedButton(
              onPressed: null,
              child: Text("TWO"),
              ),
              RaisedButton(
              onPressed: null,
              child: Text("THREE"),
              ),
              ],
              ),
              Align(
              alignment: Alignment.center,
              child: Container(
              color: Colors.red,
              height: 50,
              width: 50,
              ),
              )
              ],
              )
              ],
              ),


              • Column

                • Button

                • Stack

                • Column

                  • Button

                  • Button


                • Container(Red Area) Wrapped with Align Widget and Align by the center.






              share|improve this answer



























                0














                You can create something like this,



                Column(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                RaisedButton(
                onPressed: null,
                child: Text("ONE"),
                ),
                Stack(
                alignment: Alignment.center,
                children: [
                Column(
                children: <Widget>[
                RaisedButton(
                onPressed: null,
                child: Text("TWO"),
                ),
                RaisedButton(
                onPressed: null,
                child: Text("THREE"),
                ),
                ],
                ),
                Align(
                alignment: Alignment.center,
                child: Container(
                color: Colors.red,
                height: 50,
                width: 50,
                ),
                )
                ],
                )
                ],
                ),


                • Column

                  • Button

                  • Stack

                  • Column

                    • Button

                    • Button


                  • Container(Red Area) Wrapped with Align Widget and Align by the center.






                share|improve this answer

























                  0












                  0








                  0







                  You can create something like this,



                  Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                  RaisedButton(
                  onPressed: null,
                  child: Text("ONE"),
                  ),
                  Stack(
                  alignment: Alignment.center,
                  children: [
                  Column(
                  children: <Widget>[
                  RaisedButton(
                  onPressed: null,
                  child: Text("TWO"),
                  ),
                  RaisedButton(
                  onPressed: null,
                  child: Text("THREE"),
                  ),
                  ],
                  ),
                  Align(
                  alignment: Alignment.center,
                  child: Container(
                  color: Colors.red,
                  height: 50,
                  width: 50,
                  ),
                  )
                  ],
                  )
                  ],
                  ),


                  • Column

                    • Button

                    • Stack

                    • Column

                      • Button

                      • Button


                    • Container(Red Area) Wrapped with Align Widget and Align by the center.






                  share|improve this answer













                  You can create something like this,



                  Column(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                  RaisedButton(
                  onPressed: null,
                  child: Text("ONE"),
                  ),
                  Stack(
                  alignment: Alignment.center,
                  children: [
                  Column(
                  children: <Widget>[
                  RaisedButton(
                  onPressed: null,
                  child: Text("TWO"),
                  ),
                  RaisedButton(
                  onPressed: null,
                  child: Text("THREE"),
                  ),
                  ],
                  ),
                  Align(
                  alignment: Alignment.center,
                  child: Container(
                  color: Colors.red,
                  height: 50,
                  width: 50,
                  ),
                  )
                  ],
                  )
                  ],
                  ),


                  • Column

                    • Button

                    • Stack

                    • Column

                      • Button

                      • Button


                    • Container(Red Area) Wrapped with Align Widget and Align by the center.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Mar 22 at 18:11









                  ibhavikmakwanaibhavikmakwana

                  6811318




                  6811318



























                      draft saved

                      draft discarded
















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid


                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.

                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55300738%2fhow-can-i-center-a-widget-between-two-column-children%23new-answer', 'question_page');

                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                      Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                      Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript