I am trying to draw separation lines like in the image below.
I was thinking of adding a 5 columns horizontally and making the separator columns smaller with a 1 dp line. However in Flutter all columns get equal width it seems or may be I am wrong.
How can I draw rows and column separators like the image below?
This is the code I am using
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,
),
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
Widget build(BuildContext context) {
Widget gridSection = Expanded(
flex: 1,
child: GridView.count(
crossAxisCount: 3,
childAspectRatio: 1.0,
shrinkWrap:true,
mainAxisSpacing: 2.0,
crossAxisSpacing: 2.0,
padding: const EdgeInsets.all(4.0),
children: <String>[
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
'http://www.for-example.org/img/main/forexamplelogo.png',
].map((String url) {
return GridTile(
child: Image.network(url, fit: BoxFit.cover));
}).toList()),
);
Widget body = Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
gridSection,
],
);
return Scaffold(
appBar: AppBar(
title: Text("Example 2 Page"),
),
body: Padding(
padding: EdgeInsets.symmetric(vertical: 0.0, horizontal: 0.0),
child: body,
),
);
}
}