Issue
I created a GridView with crossAxisCount: 3. The problem is that if the totalWidth of the GridView is not dividable by 3, the background will shine through the GridView resulting in like the background colored lines visible on the GridView. Is there a way to avoid it?
Note: Problem does not appear on mobile
Code for Reproduction:
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SizedBox(
width: 301,
child: GridView.count(
crossAxisCount: 3,
children: [
for (int i = 0; i < 12; i++)
Container(
color: Colors.black,
),
],
),
),
),
);
}
}
Solution
This can be removed using border.
Container(
decoration: BoxDecoration(
color: Colors.black,
border: Border.all(
color: Colors.black,
),
),
),
Answered By - Yeasin Sheikh

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.