Skip to content

Commit

Permalink
fix: link deletion (resolve #22)
Browse files Browse the repository at this point in the history
fix: new collections (resolve #25)
fix: link descriptions from sharing intent (resolve #24)
  • Loading branch information
muety committed Jan 4, 2022
1 parent 21bb56d commit 2ad26ed
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions android/local.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdk.dir=/media/ferdinand/HDD/android/sdk
flutter.sdk=/opt/flutter
flutter.versionName=1.2.3
flutter.buildMode=debug
flutter.versionCode=31
flutter.versionName=1.2.4
flutter.buildMode=release
flutter.versionCode=32
1 change: 1 addition & 0 deletions lib/database/collection_db_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class CollectionDbHelper extends DatabaseHelper {

Future<void> insert(LinkCollection collection) async {
Map<String, dynamic> collectionMap = collection.toJson();
collectionMap.remove('links');
await db.insert(tableName, collectionMap, conflictAlgorithm: ConflictAlgorithm.replace);
}

Expand Down
2 changes: 1 addition & 1 deletion lib/models/link_collection.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class LinkCollection with Comparable<LinkCollection> {
LinkCollection({this.id, this.name, this.links});

factory LinkCollection.fromJson(Map<String, dynamic> json) {
List<Link> links = json.containsKey('links') ? (json['links'] as List<Map<String, dynamic>>).map((l) => Link.fromJson(l)).toList() : [];
List<Link> links = json.containsKey('links') ? (json['links'] as List<dynamic>).map((l) => Link.fromJson(l)).toList() : [];
links.sort();

return LinkCollection(
Expand Down
3 changes: 2 additions & 1 deletion lib/pages/add_link_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ class _AddLinkPageState extends AnchrState<AddLinkPage> with AnchrActions {
@override
void initState() {
super.initState();
_linkInputController.addListener(_onLinkEdit);

_linkInputController.text = widget.linkData != null && widget.linkData.containsKey(Strings.keySharedLinkUrl) ? widget.linkData[Strings.keySharedLinkUrl] : '';

_descriptionInputController.text =
widget.linkData != null && widget.linkData.containsKey(Strings.keySharedLinkTitle) ? widget.linkData[Strings.keySharedLinkTitle] : '';

_linkInputController.addListener(_onLinkEdit);
}

@override
Expand Down
1 change: 1 addition & 0 deletions lib/resources/strings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Strings {
static const labelDeleteButton = 'Delete Link';
static const labelCopyButton = 'Copy Link';
static const labelShareButton = 'Share Link';
static const labelDeleteCollectionButton = 'Delete Collection';
static const labelLoginButton = 'Login';
static const labelLogoutButton = 'Logout';
static const labelCancelButton = 'Cancel';
Expand Down
2 changes: 1 addition & 1 deletion lib/services/collection_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ class CollectionService extends ApiService {
}

if (responses[1].statusCode == 200) {
links = (json.decode(responses[1].body) as List<dynamic>).map((l) => Link.fromJson(l)).toList(growable: false);
links = (json.decode(responses[1].body) as List<dynamic>).map((l) => Link.fromJson(l)).toList();
} else {
throw WebServiceException(message: responses[1].body);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/collection_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _CollectionDrawerState extends State<CollectionDrawer> {
children: <Widget>[
ListTile(
leading: const Icon(Icons.delete),
title: const Text(Strings.labelDeleteButton),
title: const Text(Strings.labelDeleteCollectionButton),
onTap: () => showDialog(
context: context,
builder: DeleteCollectionDialog(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: anchr_android
description: Android client for Anchr.io link collections

version: 1.2.3+31
version: 1.2.4+32

environment:
sdk: ">=2.10.0 <3.0.0"
Expand Down

0 comments on commit 2ad26ed

Please sign in to comment.