Not being able to add vertical line in flutter

user3808307

I have the following layout

Form(
  onChanged: _updateFormProgress,
  child: Row(       
    children: [
      Expanded(
        flex: 3,
        child: Column(
          children: [
            ....
          ],
        ),
      ),
      Expanded(
        flex: 2,
        child: Column(
          children: [
            ...
          ],
        ),
      )
    ],
  ),
);

I need a vertical separator line beteen the two Expanded

I tried:

Form(
  onChanged: _updateFormProgress,
  child: Row(       
    children: [
      Expanded(
        flex: 3,
        child: Column(
          children: [
            ....
          ],
        ),
      ),
      Container(
        child: VerticalDivider(
          color: Colors.red,
          width: 1,
        )
      ),
      Expanded(
        flex: 2,
        child: Column(
          children: [
            ...
          ],
        ),
      )
    ],
  ),
);

And it compiles but I can't see the line. I also tried other options like wrapping the Expanded in a Container and make a border but have different issues with that

KuKu

I changed code like tree you provide, and change it to work.

Please wrap 'Row' with 'IntrinsicHeight'.

enter image description here

I attached full code I tested.

import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        visualDensity: VisualDensity.adaptivePlatformDensity,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Padding(
        padding: EdgeInsets.all(10),
        child: Center(
          child: Column(
            children: [
              Container(
                child: Form(
                  onChanged: () {},
                  child: IntrinsicHeight(
                    child: Row(
                      children: [
                        Expanded(
                          flex: 3,
                          child: Column(
                            children: [
                              Container(child: Text('a')),
                              Container(child: Text('a')),
                              Container(child: Text('a')),
                            ],
                          ),
                        ),
                        Container(
                          child: VerticalDivider(
                            color: Colors.red,
                            width: 1,
                          ),
                        ),
                        Expanded(
                          flex: 2,
                          child: Column(
                            children: [
                              Container(child: Text('a')),
                              Container(child: Text('a')),
                              Container(child: Text('a')),
                            ],
                          ),
                        )
                      ],
                    ),
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}


Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Flutter expanded vertical line

From Dev

Add vertical line to bottom css

From Dev

Dimple JS add vertical line

From Dev

Command Line Parser Library .NET being able to retrieve version number

From Dev

Add vertical line in background in quantmod chart

From Dev

Add thick vertical line to table using CSS

From Dev

How to add vertical line between UITableViewCell IOS

From Dev

How to Add vertical line in table Latex

From Dev

how to add vertical line between two divs

From Dev

Plotly: How to add vertical line to plotly plot?

From Dev

Add thick vertical line to table using CSS

From Dev

Add vertical line to stacked horizontal bar chart

From Dev

How to add vertical line for below layout?

From Java

How to add line dash in Flutter

From Dev

Add vertical line to line chart in rChart NVD3 (nPlot)

From Dev

Not able vertical align

From Dev

TypeScript : Not being able to iterate line by line over a uploaded file(Angular 9)

From Dev

Ant, concat: Not able to add a carriage return line feed

From Java

How to Add a Vertical Divider between Widget on Column in Flutter?

From Dev

Not being able to catch an exception

From Dev

Not being able to catch an exception

From Dev

Not being able to autowire a bean

From Dev

Not being able to use promise

From Dev

How to Add a Vertical Line inside a texbox using html and css

From Dev

How to add a label for a vertical line with legend in ggplot2

From Dev

Google Combo Chart add horizontal and vertical line in column chart

From Dev

Add vertical line in a DT datatable in a shiny app with custom container

From Dev

How to add a vertical line in my web page Using Twitter Bootstrap?

From Dev

How do I add a vertical line separating the two columns?

Related Related

HotTag

Archive