diff --git a/lib/flutter_nfc_kit.dart b/lib/flutter_nfc_kit.dart index 457ac85..812cb43 100644 --- a/lib/flutter_nfc_kit.dart +++ b/lib/flutter_nfc_kit.dart @@ -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'; @@ -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 setIosAlertMessage(String message) async { @@ -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 authenticateSector( - int index, {T? keyA, T? keyB} - ) async { + static Future authenticateSector(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. @@ -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. @@ -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 readSector(int index) async { - return await _channel.invokeMethod('readSector', { - 'index': index - }); + return await _channel.invokeMethod('readSector', {'index': index}); } - } diff --git a/lib/flutter_nfc_kit_web.dart b/lib/flutter_nfc_kit_web.dart index af50c20..ded52f9 100644 --- a/lib/flutter_nfc_kit_web.dart +++ b/lib/flutter_nfc_kit_web.dart @@ -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';