|
|
|
@ -60,6 +60,39 @@ class ThumbnailImage extends StatelessWidget {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Widget buildVideoIcon() {
|
|
|
|
|
|
|
|
final minutes = asset.duration.inMinutes;
|
|
|
|
|
|
|
|
final durationString = asset.duration.toString();
|
|
|
|
|
|
|
|
return Positioned(
|
|
|
|
|
|
|
|
top: 5,
|
|
|
|
|
|
|
|
right: 5,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
minutes > 59
|
|
|
|
|
|
|
|
? durationString.substring(0, 7) // h:mm:ss
|
|
|
|
|
|
|
|
: minutes > 0
|
|
|
|
|
|
|
|
? durationString.substring(2, 7) // mm:ss
|
|
|
|
|
|
|
|
: durationString.substring(3, 7), // m:ss
|
|
|
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
|
|
fontWeight: FontWeight.bold,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const SizedBox(
|
|
|
|
|
|
|
|
width: 3,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const Icon(
|
|
|
|
|
|
|
|
Icons.play_circle_fill_rounded,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
size: 18,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Widget buildImage() {
|
|
|
|
Widget buildImage() {
|
|
|
|
final image = SizedBox(
|
|
|
|
final image = SizedBox(
|
|
|
|
width: 300,
|
|
|
|
width: 300,
|
|
|
|
@ -162,26 +195,7 @@ class ThumbnailImage extends StatelessWidget {
|
|
|
|
size: 18,
|
|
|
|
size: 18,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
if (!asset.isImage)
|
|
|
|
if (!asset.isImage) buildVideoIcon(),
|
|
|
|
Positioned(
|
|
|
|
|
|
|
|
top: 5,
|
|
|
|
|
|
|
|
right: 5,
|
|
|
|
|
|
|
|
child: Row(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
Text(
|
|
|
|
|
|
|
|
asset.duration.toString().substring(0, 7),
|
|
|
|
|
|
|
|
style: const TextStyle(
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
const Icon(
|
|
|
|
|
|
|
|
Icons.play_circle_outline_rounded,
|
|
|
|
|
|
|
|
color: Colors.white,
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
],
|
|
|
|
],
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
|