dnie_tools 0.0.2
Flutter DNIe tools
DNIe tools
Flutter DNIe tools
Disclaimer
This library is under heavy development!! For sure I will improve it on next versions so be carefull to use it!!
Roadmap
- Read DNIe -> DONE
- Auth with DNIe -> WIP
- Sign with DNIe -> WIP
Getting Started
This project is a plug-in package, to get information from the DNIe 3.0 (spanish official document)
Right is still WIP and only works on iOS
What can this libray do?
-
Get information from the DNIe 3.0:
- nif
- birth
- expiry
- docNumber
- expeditionCountry
- sex
- nationality
- name
- surname
- address
- city
- state
- DNIe image
- Sign image
Reqs
- Android 19+
- NFC on your smartphone
Install
WIP
How to use it
That's simple, whew you want to get the DNIe data, do:
- Listen for changes:
DnieTools.stream.listen((dnieResponse) {
// Event is the response
}
- Read DNIe
await DnieTools.read("DNIe_CAN");
Event data detail
An event is a DnieResponse, it has three attrs:
-
status. With these values:
INIT: Initialize receivedREADY: Ready, now you can tap your DNIe to the phoneIN_PROGRESS:Reading dataINFO: Here you can find the DNIe data in thedataattributeIMAGE: Here you can find the image file path in thedataattribute, take a look also totypeERROR: An error has ocurred, the error message comes fromdata
-
type. Only applies on:
IN_PROGRESS: Type could beINFO(getting info),PICTURE(getting DNIe picture) andSIGN(getting image sign)IMAGE:PICTURESIGN
-
data: Only applies on:
INFO: The DNIe info (birth, name, surname, nif, etc)
-
uri: Only applies on:
IMAGE: Here you will get the image URI, simply callImage.file(File(uri))to see the pic Q&A
Why do I need to pass the DNIe CAN? -> Because It's mandatory, take a look to dnie official website for more info Why doesn't works on iOS? Ask Tim Cook & Spanish government, we can't use NFC :(