Files
notes/lib/widgets/note_tile.dart
T

46 lines
1.1 KiB
Dart
Raw Normal View History

2022-10-23 17:57:59 +02:00
import 'package:flutter/material.dart';
2022-11-03 16:43:50 +01:00
import '../canvas/document_types.dart';
import '../canvas/drawing_page.dart';
2022-10-23 17:57:59 +02:00
class NoteTile extends StatelessWidget {
const NoteTile({Key? key, required this.data}) : super(key: key);
2022-11-04 23:09:50 +01:00
final NoteMetaData data;
2022-10-23 17:57:59 +02:00
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
2022-11-04 23:09:50 +01:00
builder: (context) => DrawingPage(meta: data),
2022-10-23 17:57:59 +02:00
),
2022-11-12 19:35:16 +01:00
);
},
child: SizedBox(
width: 100,
child: Column(
children: [
SizedBox(
height: 150,
width: 100,
child: Container(
color: Colors.white,
),
),
Text(
data.name,
style: const TextStyle(color: Colors.white),
overflow: TextOverflow.ellipsis,
),
Text('${data.lastModified.hour}:${data.lastModified.minute}',
style: const TextStyle(color: Colors.white))
],
),
2022-10-23 17:57:59 +02:00
),
);
}
}