mucke/lib/presentation/utils.dart

13 lines
324 B
Dart
Raw Normal View History

2020-03-28 11:08:43 +01:00
import 'dart:io';
import 'package:flutter/material.dart';
2020-04-04 21:02:42 +02:00
ImageProvider getAlbumImage(String albumArtPath) {
2020-03-28 11:08:43 +01:00
// return Image.asset('assets/no_cover.png');
if (albumArtPath == null || !File(albumArtPath).existsSync()) {
2020-04-04 21:02:42 +02:00
return const AssetImage('assets/no_cover.png');
2020-03-28 11:08:43 +01:00
}
2020-04-04 21:02:42 +02:00
return FileImage(File(albumArtPath));
2020-03-28 11:08:43 +01:00
}