Line data Source code
1 : import 'dart:typed_data'; 2 : 3 : import 'package:pal/src/database/entity/app_icon_entity.dart'; 4 : import 'package:pal/src/database/repository/project_repository.dart'; 5 : 6 : abstract class ProjectEditorService { 7 6 : factory ProjectEditorService.build( 8 : ProjectRepository projectRepository, 9 : ) => 10 6 : ProjectEditorHttpService(projectRepository); 11 : 12 0 : Future<AppIconEntity> sendAppIcon(Uint8List icon, String imageType) => throw "not implemented yet"; 13 0 : Future<AppIconEntity> updateAppIcon(String appIconId, Uint8List icon, String imageType) => throw "not implemented yet"; 14 0 : Future<AppIconEntity> getAppIcon() => throw "not implemented yet"; 15 : 16 : } 17 : 18 : class ProjectEditorHttpService implements ProjectEditorService { 19 : final ProjectRepository projectRepository; 20 : 21 6 : ProjectEditorHttpService(this.projectRepository); 22 : 23 : @override 24 0 : Future<AppIconEntity> sendAppIcon(Uint8List icon, String imageType) async { 25 0 : return this.projectRepository.createAppIcon( icon, imageType); 26 : } 27 : 28 0 : Future<AppIconEntity> updateAppIcon(String appIconId, Uint8List icon, String imageType) async { 29 0 : return this.projectRepository.updateAppIcon(appIconId, icon, imageType); 30 : } 31 : 32 0 : @override 33 : Future<AppIconEntity> getAppIcon() { 34 0 : return this.projectRepository.getAppIcon(); 35 : } 36 : }