Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adjust Dart test and add Pigeon TODOs
  • Loading branch information
stuartmorgan-g committed Jan 4, 2023
commit dfa7a1cb716544a5c2eb834665c82e2bea925576
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ import 'package:pigeon/pigeon.dart';
@HostApi(dartHostTestHandler: 'TestUserDefaultsApi')
abstract class UserDefaultsApi {
void remove(String key);
// TODO(stuartmorgan): Give these setters better Swift signatures (_,forKey:)
// once https://github.com/flutter/flutter/issues/105932 is fixed.
void setBool(String key, bool value);
void setDouble(String key, double value);
void setValue(String key, Object value);
// TODO(stuartmorgan): Make these non-nullable once
// https://github.com/flutter/flutter/issues/97848 is fixed.
Map<String?, Object?> getAll();
void clear();
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ void main() {
final Map<String?, Object?> all = await plugin.getAll();
expect(all.length, 5);
expect(all['flutter.aBool'], api.items['flutter.aBool']);
expect(all['flutter.aDouble'], api.items['flutter.aDouble']);
expect(all['flutter.aDouble'],
closeTo(api.items['flutter.aDouble']! as num, 0.0001));
expect(all['flutter.anInt'], api.items['flutter.anInt']);
expect(all['flutter.aString'], api.items['flutter.aString']);
expect(all['flutter.aStringList'], api.items['flutter.aStringList']);
Expand Down