Skip to content

Commit

Permalink
Remove unnecessary import
Browse files Browse the repository at this point in the history
  • Loading branch information
jiegec committed Oct 30, 2023
1 parent 5c0d254 commit 77e78cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
28 changes: 10 additions & 18 deletions lib/flutter_nfc_kit.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import 'dart:async';
import 'dart:convert';
import 'dart:io' show Platform;
import 'dart:typed_data';

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -377,7 +376,7 @@ class FlutterNfcKit {
}

/// iOS only, change currently displayed NFC reader session alert message with [message].
///
///
/// There must be a valid session when invoking.
/// On Android, call to this function does nothing.
static Future<void> setIosAlertMessage(String message) async {
Expand All @@ -394,23 +393,19 @@ class FlutterNfcKit {
}

/// Authenticate against a sector of MIFARE Classic tag.
///
///
/// Either one of [keyA] or [keyB] must be provided.
/// If both are provided, [keyA] will be used.
/// Returns whether authentication succeeds.
static Future<bool> authenticateSector<T>(
int index, {T? keyA, T? keyB}
) async {
static Future<bool> authenticateSector<T>(int index,
{T? keyA, T? keyB}) async {
assert(T is String || T is Uint8List);
return await _channel.invokeMethod('authenticateSector', {
'index': index,
'keyA': keyA,
'keyB': keyB
});
return await _channel.invokeMethod(
'authenticateSector', {'index': index, 'keyA': keyA, 'keyB': keyB});
}

/// Read one block (16 bytes) from tag
///
///
/// There must be a valid session when invoking.
/// [index] refers to the block / page index.
/// For MIFARE Classic tags, you must first authenticate against the corresponding sector.
Expand All @@ -421,7 +416,7 @@ class FlutterNfcKit {
}

/// Write one block (16B) / page (4B) to MIFARE Classic / Ultralight tag
///
///
/// There must be a valid session when invoking.
/// [index] refers to the block / page index.
/// For MIFARE Classic tags, you must first authenticate against the corresponding sector.
Expand All @@ -434,16 +429,13 @@ class FlutterNfcKit {
}

/// Read one sector from MIFARE Classic tag
///
///
/// There must be a valid session when invoking.
/// [index] refers to the sector index.
/// You must first authenticate against the corresponding sector.
/// Note: not all sectors are 64B long, some tags might have 256B sectors.
/// Returns data in [Uint8List].
static Future<Uint8List> readSector(int index) async {
return await _channel.invokeMethod('readSector', {
'index': index
});
return await _channel.invokeMethod('readSector', {'index': index});
}

}
1 change: 0 additions & 1 deletion lib/flutter_nfc_kit_web.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'dart:async';
// ignore: avoid_web_libraries_in_flutter
import 'dart:html' as html show window;
import 'dart:js_util';
import 'dart:typed_data';
import 'package:convert/convert.dart';

import 'package:flutter/services.dart';
Expand Down

0 comments on commit 77e78cb

Please sign in to comment.