GridView: Improve look of tiles

This commit is contained in:
Vishesh Handa
2020-03-30 11:54:10 +02:00
parent 930356aaf1
commit 9cbe6dd389

View File

@ -66,8 +66,18 @@ class GridFolderView extends StatelessWidget {
body = body.replaceAll('[x]', ''); body = body.replaceAll('[x]', '');
body = body.replaceAll('[X]', ''); body = body.replaceAll('[X]', '');
var textTheme = Theme.of(context).textTheme; var theme = Theme.of(context);
var tileContent = Padding( var textTheme = theme.textTheme;
var borderColor = theme.highlightColor.withAlpha(50);
if (theme.brightness == Brightness.dark) {
borderColor = theme.highlightColor.withAlpha(100);
}
var tileContent = Container(
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(8)),
border: Border.all(color: borderColor),
),
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
@ -79,7 +89,7 @@ class GridFolderView extends StatelessWidget {
style: textTheme.title, style: textTheme.title,
), ),
if (note.title != null && note.title.isNotEmpty) if (note.title != null && note.title.isNotEmpty)
const SizedBox(height: 8.0), const SizedBox(height: 12.0),
Flexible( Flexible(
flex: 1, flex: 1,
child: Text( child: Text(
@ -99,7 +109,7 @@ class GridFolderView extends StatelessWidget {
var tile = Material( var tile = Material(
borderRadius: borderRadius, borderRadius: borderRadius,
type: MaterialType.card, type: MaterialType.card,
child: Padding(padding: const EdgeInsets.all(4.0), child: tileContent), child: tileContent,
); );
/*var tile = Container( /*var tile = Container(