Add symbol for offline available sheets
This commit is contained in:
@@ -125,6 +125,10 @@ class _HomePageState extends State<HomePage> with RouteAware {
|
||||
_sheets = await _sortSheetsByRecency(result.sheets);
|
||||
_isOnline = result.isOnline;
|
||||
|
||||
for (var sheet in _sheets) {
|
||||
sheet.availableOffline = await _apiClient!.isPdfFileCached(sheet.uuid);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import '../../../core/models/sheet.dart';
|
||||
|
||||
/// A list tile displaying a single sheet's information.
|
||||
@@ -24,6 +25,10 @@ class SheetListItem extends StatelessWidget {
|
||||
subtitle: Text(sheet.composer),
|
||||
onTap: onTap,
|
||||
onLongPress: onLongPress,
|
||||
trailing: Visibility(
|
||||
visible: !kIsWeb && sheet.availableOffline,
|
||||
child: Icon(Icons.download_done, color: Colors.green),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user