Skip to content

Commit

Permalink
imageKey
Browse files Browse the repository at this point in the history
  • Loading branch information
danemadsen committed Aug 5, 2024
1 parent eac377f commit 2d5c555
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/classes/providers/character.dart
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,14 @@ class Character extends ChangeNotifier {

Key get key => _key;

Key get imageKey {
final bytes = _profile!.readAsBytesSync();

final hash = sha256.convert(bytes).toString();

return ValueKey(hash);
}

String get name => _name;

bool get useSystem => _useSystem;
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/shared/pages/character_customization_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class _CharacterCustomizationPageState extends State<CharacterCustomizationPage>
Padding(
padding: const EdgeInsets.all(20.0),
child: FutureTileImage(
key: character.key,
key: character.imageKey,
image: character.profile,
borderRadius: BorderRadius.circular(10.0),
)
Expand Down

0 comments on commit 2d5c555

Please sign in to comment.