Skip to content

Commit cbd5148

Browse files
committed
fix breaking changes after package updates
1 parent 3146929 commit cbd5148

5 files changed

Lines changed: 54 additions & 20 deletions

File tree

lib/base/networking/cache/cache_entry.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import 'package:drift/native.dart';
55
import 'package:path_provider/path_provider.dart';
66
import 'package:path/path.dart' as p;
77
import 'package:sqlite3/sqlite3.dart';
8-
import 'package:sqlite3_flutter_libs/sqlite3_flutter_libs.dart';
98

109
part 'cache_entry.g.dart';
1110

@@ -34,9 +33,9 @@ LazyDatabase _openConnection() {
3433
final file = File(p.join(dbFolder.path, 'db.sqlite'));
3534

3635
// Also work around limitations on old Android versions
37-
if (Platform.isAndroid) {
36+
/* if (Platform.isAndroid) {
3837
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
39-
}
38+
} */
4039

4140
// Make sqlite3 pick a more suitable location for temporary files - the
4241
// one from the system may be inaccessible due to sandboxing.

lib/personComponent/model/personDetails/person_details.dart

Lines changed: 47 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -106,53 +106,88 @@ class PersonDetails {
106106
if (officialContact!.phone != null) {
107107
phones.add(
108108
Phone(
109-
officialContact!.phone!,
110-
label: PhoneLabel.work,
109+
number: officialContact!.phone!,
110+
label: const Label(PhoneLabel.work),
111111
isPrimary: true,
112112
),
113113
);
114114
}
115115
if (officialContact!.mobilePhone != null) {
116116
phones.add(
117-
Phone(officialContact!.mobilePhone!, label: PhoneLabel.workMobile),
117+
Phone(
118+
number: officialContact!.mobilePhone!,
119+
label: const Label(PhoneLabel.workMobile),
120+
),
118121
);
119122
}
120123
if (officialContact!.fax != null) {
121-
phones.add(Phone(officialContact!.fax!, label: PhoneLabel.faxWork));
124+
phones.add(
125+
Phone(
126+
number: officialContact!.fax!,
127+
label: const Label(PhoneLabel.workFax),
128+
),
129+
);
122130
}
123131
if (officialContact!.homepage != null) {
124132
websites.add(
125-
Website(officialContact!.homepage!, label: WebsiteLabel.work),
133+
Website(
134+
url: officialContact!.homepage!,
135+
label: const Label(WebsiteLabel.work),
136+
),
126137
);
127138
}
128139
}
129140
if (privateContact != null) {
130141
if (privateContact!.phone != null) {
131-
phones.add(Phone(privateContact!.phone!, label: PhoneLabel.home));
142+
phones.add(
143+
Phone(
144+
number: privateContact!.phone!,
145+
label: const Label(PhoneLabel.home),
146+
),
147+
);
132148
}
133149
if (privateContact!.mobilePhone != null) {
134150
phones.add(
135-
Phone(privateContact!.mobilePhone!, label: PhoneLabel.mobile),
151+
Phone(
152+
number: privateContact!.mobilePhone!,
153+
label: const Label(PhoneLabel.mobile),
154+
),
136155
);
137156
}
138157
if (privateContact!.fax != null) {
139-
phones.add(Phone(privateContact!.fax!, label: PhoneLabel.faxHome));
158+
phones.add(
159+
Phone(
160+
number: privateContact!.fax!,
161+
label: const Label(PhoneLabel.homeFax),
162+
),
163+
);
140164
}
141165
if (privateContact!.homepage != null) {
142166
websites.add(
143-
Website(privateContact!.homepage!, label: WebsiteLabel.home),
167+
Website(
168+
url: privateContact!.homepage!,
169+
label: const Label(WebsiteLabel.home),
170+
),
144171
);
145172
}
146173
}
147174

148-
var photo = imageData != null ? base64DecodeImageData(imageData!) : null;
175+
final photoBytes = imageData != null
176+
? base64DecodeImageData(imageData!)
177+
: null;
149178

150179
return Contact(
151180
name: Name(prefix: title ?? "", first: firstName, last: name),
152-
emails: [Email(email, label: EmailLabel.work, isPrimary: true)],
181+
emails: [
182+
Email(
183+
address: email,
184+
label: const Label(EmailLabel.work),
185+
isPrimary: true,
186+
),
187+
],
153188
phones: phones,
154189
websites: websites,
155-
photo: photo,
190+
photo: photoBytes != null ? Photo(fullSize: photoBytes) : null,
156191
);
157192
}
158193
}

lib/personComponent/views/person_details_view.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ class _PersonDetailsViewState extends ConsumerState<PersonDetailsView> {
164164
return ElevatedButton(
165165
onPressed: () async {
166166
// Add the contact to the user's contacts
167-
await FlutterContacts.openExternalInsert(personDetails.contact);
167+
await FlutterContacts.create(personDetails.contact);
168168
},
169169
child: Text(context.tr("add_contact")),
170170
);

pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1777,10 +1777,10 @@ packages:
17771777
dependency: transitive
17781778
description:
17791779
name: vm_service
1780-
sha256: "45caa6c5917fa127b5dbcfbd1fa60b14e583afdc08bfc96dda38886ca252eb60"
1780+
sha256: "046d3928e16fa4dc46e8350415661755ab759d9fc97fc21b5ab295f71e4f0499"
17811781
url: "https://pub.dev"
17821782
source: hosted
1783-
version: "15.0.2"
1783+
version: "15.1.0"
17841784
watcher:
17851785
dependency: transitive
17861786
description:
@@ -1871,5 +1871,5 @@ packages:
18711871
source: hosted
18721872
version: "3.1.3"
18731873
sdks:
1874-
dart: ">=3.10.3 <4.0.0"
1874+
dart: ">=3.11.4 <4.0.0"
18751875
flutter: ">=3.38.4"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ publish_to: 'none'
44
version: 5.3.0+1
55

66
environment:
7-
sdk: ^3.10.0
7+
sdk: ^3.11.4
88

99
dependencies:
1010
flutter:

0 commit comments

Comments
 (0)