mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-06 01:19:34 +00:00
lib item page ready
This commit is contained in:
parent
0d54f1cb15
commit
097caf8ec2
15 changed files with 804 additions and 221 deletions
2
lib/db/cache/schemas/image.dart
vendored
2
lib/db/cache/schemas/image.dart
vendored
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:isar/isar.dart';
|
||||
|
||||
part '../image.g.dart';
|
||||
part 'image.g.dart';
|
||||
|
||||
/// Represents a cover image for a library item
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'schemas/image.dart';
|
||||
part of 'image.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// _IsarCollectionGenerator
|
||||
|
|
@ -16,7 +16,7 @@ extension GetImageCollection on Isar {
|
|||
|
||||
const ImageSchema = IsarGeneratedSchema(
|
||||
schema: IsarSchema(
|
||||
name: 'Image',
|
||||
name: 'CacheImage',
|
||||
idName: 'id',
|
||||
embedded: false,
|
||||
properties: [
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
import 'package:flutter_cache_manager/flutter_cache_manager.dart';
|
||||
import 'package:whispering_pages/settings/constants.dart';
|
||||
|
||||
final imageCacheManager = CacheManager(
|
||||
Config(
|
||||
'image_cache_manager',
|
||||
'${AppMetadata.appNameLowerCase}_image_cache',
|
||||
stalePeriod: const Duration(days: 365 * 10),
|
||||
repo: JsonCacheInfoRepository(),
|
||||
maxNrOfCacheObjects: 1000,
|
||||
|
|
@ -11,8 +12,8 @@ final imageCacheManager = CacheManager(
|
|||
|
||||
final apiResponseCacheManager = CacheManager(
|
||||
Config(
|
||||
'api_response_cache_manager',
|
||||
stalePeriod: const Duration(days: 1),
|
||||
'${AppMetadata.appNameLowerCase}_api_response_cache',
|
||||
stalePeriod: const Duration(days: 7),
|
||||
repo: JsonCacheInfoRepository(),
|
||||
maxNrOfCacheObjects: 1000,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hive/hive.dart';
|
||||
import 'package:path/path.dart' as p;
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
|
@ -15,12 +16,13 @@ Future initStorage() async {
|
|||
// use whispering_pages as the directory for hive
|
||||
final storageDir = Directory(p.join(
|
||||
dir.path,
|
||||
AppMetadata.appName.toLowerCase().replaceAll(' ', '_'),
|
||||
AppMetadata.appNameLowerCase,
|
||||
),
|
||||
);
|
||||
await storageDir.create(recursive: true);
|
||||
|
||||
Hive.defaultDirectory = storageDir.path;
|
||||
debugPrint('Hive storage directory init: ${Hive.defaultDirectory}');
|
||||
|
||||
await registerModels();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue