Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix incorrect use of getter #23

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion platform_device_id/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class _MyAppState extends State<MyApp> {
String? deviceId;
// Platform messages may fail, so we use a try/catch PlatformException.
try {
deviceId = await PlatformDeviceId.getDeviceId;
deviceId = await PlatformDeviceId.fetchDeviceId();
} on PlatformException {
deviceId = 'Failed to get deviceId.';
}
Expand Down
2 changes: 1 addition & 1 deletion platform_device_id/lib/platform_device_id.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class PlatformDeviceId {
static final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();

/// Information derived from `android`-`androidId` or `ios`-`identifierForVendor`
static Future<String?> get getDeviceId async {
static Future<String?> fetchDeviceId() async {
String? deviceId;
try {
if (kIsWeb) {
Expand Down
2 changes: 1 addition & 1 deletion platform_device_id/test/platform_device_id_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
});

test('Get Device ID ', () async {
String? deviceID = await PlatformDeviceId.getDeviceId;
String? deviceID = await PlatformDeviceId.fetchDeviceId();
expect(deviceID, '42');
});
}
2 changes: 1 addition & 1 deletion platform_device_id_macos/example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ void main() {
find.byWidgetPredicate((Widget widget) =>
widget is Text &&
widget.data != null &&
widget.data.startsWith('Running on:')),
widget.data!.startsWith('Running on:')),
findsOneWidget,
);
});
Expand Down