Beranda › Forums › Belajar Flutter Mobile Apps Tingkat Menengah › qr scan code running tapi tidak terkoneksi dengan kamera handphone nya
- This topic has 3 replies, 2 voices, and was last updated 4 years, 7 months ago by Anonymous.
-
AuthorPosts
-
April 16, 2022 at 4:00 PM #49405
pada saat di debuging muncul notice di bawah ini
The plugin
qrscanuses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib\main.dart on SM A013G in debug mode…
lib\main.dart:1
Parameter format not correct –
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Connecting to VM Service at ws://127.0.0.1:64736/AoT5ugXLCZc=/wsmohon pencerahanya kembali coach
April 16, 2022 at 4:01 PM #49406ini kodingan main.dart saya
import ‘package:flutter/material.dart’;
import ‘main_page.dart’;
import ‘package:qrscan/qrscan.dart’ as scanner;void main() {
runApp(MyApp());
}class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: MainPage(),
);
}
}April 16, 2022 at 4:02 PM #49407dan ini kodingan main_page.dart nya
import ‘package:flutter/material.dart’;
import ‘package:qrscan/qrscan.dart’ as scanner;class MainPage extends StatefulWidget {
@override
_MainPageState createState() => _MainPageState();
}class _MainPageState extends State<MainPage> {
String text = “hasil QR Scan”;@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(“QR Scan”),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(text),
SizedBox(
height: 20,
),
RaisedButton(
child: Text(“Scan”),
onPressed: () async {
text = await scanner.scan();
setState(() {});
},
)
],
),
),
);
}
}kira2 salah nya dimana ya coach mohon pencerahanya…terimakasih
April 16, 2022 at 4:24 PM #49408AnonymousHallo Sandi,
Kalau dilihat dari output errornya:
The plugin qrscan uses a deprecated version of the Android embedding. To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs. If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.Itu jelas ya sebuah warning terkait penggunaan versi android embeeding yang sudah deprecated pada code di plugin/package dari qrscan.
Nah karena ini merupakan masalah yang berada pada code dari package tersebut, maka tidak ada yang bisa kita lakuin.
dan juga saya lihat package qrscan sudah lumayan lama tidak diupdate. Jadi lebih baik kamu mencari package lain saja yang masih aktif diupdate sama developernya.Saya barusan coba search dan menemukan package yang lebih baru dan lebih bagus dari package yang kamu pakai nih, bisa dicoba
https://pub.dev/packages/qr_code_scanner -
AuthorPosts
- You must be logged in to reply to this topic.