Skip to content

Commit

Permalink
Import supports UTF-8
Browse files Browse the repository at this point in the history
  • Loading branch information
dchristl committed Oct 7, 2023
1 parent 2388d0a commit f8256fa
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion headless_haystack/lib/accessory/accessory_registry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class AccessoryRegistry extends ChangeNotifier {
accessory.addLocationHistoryEntry(report);
}
}

_storeAccessories();
return accessory.locationHistory;
}
}
2 changes: 1 addition & 1 deletion headless_haystack/lib/dashboard/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class _DashboardState extends State<Dashboard> {
SnackBar(
backgroundColor: Theme.of(context).colorScheme.error,
content: Text(
'Could not find location reports. Try again later.',
'Could not find location reports. Try again later. Error: ${e.toString()}',
style: TextStyle(
color: Theme.of(context).colorScheme.onError,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class _ItemFileImportState extends State<ItemFileImport> {

/// Parse the JSON encoded accessories from the file stored at [filePath].
Future<List<AccessoryDTO>> _parseAccessories(Uint8List bytes) async {
String encodedContent = String.fromCharCodes(bytes);
String encodedContent = utf8.decode(bytes);

List<dynamic> content = jsonDecode(encodedContent);
var accessoryDTOs =
Expand Down
3 changes: 3 additions & 0 deletions headless_haystack/lib/item_management/new_item_action.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import 'dart:convert';
import 'dart:typed_data';

import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:headless_haystack/item_management/item_creation.dart';
Expand Down

0 comments on commit f8256fa

Please sign in to comment.