@@ -18,13 +18,17 @@ class _MyAppState extends State<MyApp> {
1818 late Uint8List resultRandomImage;
1919 late Uint8List resultCheckBackImage;
2020 late Uint8List resultIdCardBackImage;
21+ late Uint8List resultPassportImage;
22+ late Uint8List resultAnyIdImage;
2123
2224 @override
2325 void initState () {
2426 super .initState ();
2527 resultRandomImage = Uint8List .fromList ([]);
2628 resultCheckBackImage = Uint8List .fromList ([]);
2729 resultIdCardBackImage = Uint8List .fromList ([]);
30+ resultPassportImage = Uint8List .fromList ([]);
31+ resultAnyIdImage = Uint8List .fromList ([]);
2832 }
2933
3034 @override
@@ -36,9 +40,11 @@ class _MyAppState extends State<MyApp> {
3640 ),
3741 body: Column (
3842 children: [
39- _randomImageView (150.0 , 150.0 ),
40- _miSnapCheckBack (150.0 , 150.0 ),
41- _miSnapIdCardBack (150.0 , 150.0 ),
43+ _randomImageView (150.0 , 100.0 ),
44+ _miSnapCheckBack (150.0 , 100.0 ),
45+ _miSnapIdCardBack (150.0 , 100.0 ),
46+ _miSnapPassport (150.0 , 100.0 ),
47+ _miSnapAnyId (150.0 , 100.0 ),
4248 ],
4349 ),
4450 ),
@@ -155,4 +161,78 @@ class _MyAppState extends State<MyApp> {
155161 ),
156162 );
157163 }
164+
165+ Widget _miSnapPassport (double width, double height) {
166+ return SizedBox (
167+ height: height,
168+ width: width,
169+ child: Align (
170+ alignment: Alignment .center,
171+ child: InkWell (
172+ child: Container (
173+ decoration: BoxDecoration (
174+ color: const Color .fromARGB (100 , 245 , 245 , 245 ),
175+ border: Border .all (
176+ width: 1 ,
177+ color: const Color .fromARGB (100 , 204 , 204 , 204 ),
178+ ),
179+ ),
180+ child: resultPassportImage.isNotEmpty
181+ ? Image .memory (
182+ resultPassportImage,
183+ fit: BoxFit .cover,
184+ )
185+ : const SizedBox (
186+ width: double .infinity,
187+ height: double .infinity,
188+ )),
189+ onTap: () {
190+ MisnapFlutter ().misnapPassport ().then ((value) => {
191+ if (value != null && value.isNotEmpty)
192+ setState (() {
193+ resultPassportImage = value;
194+ })
195+ });
196+ },
197+ ),
198+ ),
199+ );
200+ }
201+
202+ Widget _miSnapAnyId (double width, double height) {
203+ return SizedBox (
204+ height: height,
205+ width: width,
206+ child: Align (
207+ alignment: Alignment .center,
208+ child: InkWell (
209+ child: Container (
210+ decoration: BoxDecoration (
211+ color: const Color .fromARGB (100 , 245 , 245 , 245 ),
212+ border: Border .all (
213+ width: 1 ,
214+ color: const Color .fromARGB (100 , 204 , 204 , 204 ),
215+ ),
216+ ),
217+ child: resultAnyIdImage.isNotEmpty
218+ ? Image .memory (
219+ resultAnyIdImage,
220+ fit: BoxFit .cover,
221+ )
222+ : const SizedBox (
223+ width: double .infinity,
224+ height: double .infinity,
225+ )),
226+ onTap: () {
227+ MisnapFlutter ().misnapAnyId ().then ((value) => {
228+ if (value != null && value.isNotEmpty)
229+ setState (() {
230+ resultAnyIdImage = value;
231+ })
232+ });
233+ },
234+ ),
235+ ),
236+ );
237+ }
158238}
0 commit comments