Skip to content

Commit

Permalink
馃帀 Release based_local_first_image v1.1.0 馃帀
Browse files Browse the repository at this point in the history
  • Loading branch information
Cierra-Runis committed Jan 29, 2024
1 parent 9085389 commit 4f75bc0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions packages/based_local_first_image/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.0

鈿狅笍Rename `BasedLocalFirstImage().fileName` to `BasedLocalFirstImage().filename`

## 1.0.0

馃尀First commit
2 changes: 1 addition & 1 deletion packages/based_local_first_image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Welcome to the world of local-first web development.
```dart
Image(
image: BasedLocalFirstImage(
fileName: '$index.png',
filename: '$index.png',
localDirectory: path.join(appSupport.path, 'image'),
remoteUrl: 'https://avatars.githubusercontent.com/u/$index?v=4',
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import 'package:flutter/foundation.dart';
@immutable
class BasedLocalFirstImage extends ImageProvider<BasedLocalFirstImage> {
const BasedLocalFirstImage({
required this.fileName,
required this.filename,
required this.localDirectory,
this.scale = 1.0,
this.remoteUrl,
this.headers,
});

final String fileName;
final String filename;
final String localDirectory;
final double scale;
final String? remoteUrl;
Expand Down Expand Up @@ -70,7 +70,7 @@ class BasedLocalFirstImage extends ImageProvider<BasedLocalFirstImage> {
assert(key == this);

try {
final filePath = path.join(key.localDirectory, key.fileName);
final filePath = path.join(key.localDirectory, key.filename);
final file = File(filePath);

if (file.existsSync()) {
Expand All @@ -79,7 +79,7 @@ class BasedLocalFirstImage extends ImageProvider<BasedLocalFirstImage> {

if (key.remoteUrl == null) {
throw Exception(
'remoteUrl is null, can not download $fileName from network',
'remoteUrl is null, can not download $filename from network',
);
}

Expand Down Expand Up @@ -131,15 +131,15 @@ class BasedLocalFirstImage extends ImageProvider<BasedLocalFirstImage> {
@override
bool operator ==(Object other) {
if (other is! BasedLocalFirstImage) return false;
return fileName == other.fileName &&
return filename == other.filename &&
localDirectory == other.localDirectory &&
remoteUrl == other.remoteUrl;
}

@override
int get hashCode => Object.hash(fileName, localDirectory, remoteUrl);
int get hashCode => Object.hash(filename, localDirectory, remoteUrl);

@override
String toString() =>
'BasedLocalFirstImageProvider(fileName: "$fileName", localDirectory:"$localDirectory")';
'BasedLocalFirstImageProvider(filename: "$filename", localDirectory:"$localDirectory")';
}
2 changes: 1 addition & 1 deletion packages/based_local_first_image/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: based_local_first_image
description: A Based Widget For Building More Useful Avatar
version: 1.0.0
version: 1.1.0
homepage: https://github.com/Cierra-Runis/based_widget/tree/master/packages/based_avatar

environment:
Expand Down

0 comments on commit 4f75bc0

Please sign in to comment.