我正在开发一个使用 qr_code_scanner 依赖项的 flutter 应用程序(https://pub.dev/packages/qr_code_scanner)。
我希望 QrView 自动对焦,但我找不到解决方案。如何自动对焦 qr_code_scanner 的相机?
qr-code autofocus android-camera flutter flutter-dependencies
我使用以下代码来检测用户更改的系统音量。
NotificationCenter.default.addObserver(self, selector: #selector(volumeChanged), name: NSNotification.Name(rawValue: "AVSystemController_SystemVolumeDidChangeNotification"), object: nil)
Run Code Online (Sandbox Code Playgroud)
当我更新到 iOS 15 时,我发现这段代码不起作用,但对于任何以前版本的 iOS 来说它都有效。
我也使用了一个addObserver函数,但没关系。
这是 iOS 15 的错误吗?如果是,我该如何修复它。
谢谢 :)
我正在使用CustomPainter.
有没有办法将图像或图标放在 StrokeCap 内?
这是我想要实现的目标:
这是我目前得到的:
这是我的代码:
import 'package:flutter/material.dart';
import 'dart:math';
class CircleProgress extends CustomPainter{
double currentProgress;
CircleProgress(this.currentProgress);
@override
void paint(Canvas canvas, Size size) {
Paint outerCircle = Paint()
..strokeWidth = 20
..color = Color.fromRGBO(10, 10, 10, 0.1)
..style = PaintingStyle.stroke;
Paint completeArc = Paint()
..strokeWidth = 20
..color = Colors.redAccent
..style = PaintingStyle.stroke
..strokeCap = StrokeCap.round;
Offset center = Offset(size.width/2, size.height/2);
double radius = min(size.width/2,size.height/2) - 10;
canvas.drawCircle(center, radius, outerCircle); // this draws main outer circle
double …Run Code Online (Sandbox Code Playgroud) 这是我的 base64 编码字符串:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uSWQiOiJkMjNiN2ViMy03MDgyLTRkZDktOGQ0OC1lMjU2YTM3OTNiOTciLCJyZWZyZXNoVG9rZW4iOiJiN2M3MTc4Yi04OWRjLTQxMDctYjUzNC1hOGZiOTNhMzEwNzAiLCJuYW1lIjoiTGVuIiwiaWF0IjoxNTczMDI4MjU2fQ
Run Code Online (Sandbox Code Playgroud)
使用https://jwt.io/它可以正确解码但是当尝试base64.decode('--Base64String--);在 Flutter 中使用时它给了我这些错误
FormatException: Invalid character (at character 37)
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uSWQiOiIzYWNiNzBjZS0wYzYxLT...
Run Code Online (Sandbox Code Playgroud)
当删除前面的字符串时.(我只需要后面的信息.)我收到这个错误
FormatException: Invalid length, must be multiple of four (at character 183)
...jLTQxMDctYjUzNC1hOGZiOTNhMzEwNzAiLCJuYW1lIjoiTGVuIiwiaWF0IjoxNTczMDI4MjU2fQ
Run Code Online (Sandbox Code Playgroud)
有没有其他方法可以为 Dart 解码 base64 编码的字符串