我必须在 Agora 的帮助下创建通话应用程序。当应用程序位于前台时,这是可以的,但我想在应用程序处于后台或终止时接受呼叫。我正在尝试使用 Callkeep 插件来接受后台呼叫我找到了一种通过 FCM 后台消息的方法,但我不知道如何为 IOS 实现解决方案,它没有 FCM 后台消息我尝试使用 VOIP 通知,但我不知道如何要将它们发送到我的 flutter 应用程序,我使用 Firebase 作为后端,我需要适用于 Android 和 IOS 的解决方案,谢谢
我想用通用回调定义一个冻结类 [https://pub.dev/packages/freezed]。
冷冻类:
import 'package:freezed_annotation/freezed_annotation.dart';
part 'foo.freezed.dart';
@freezed
abstract class Foo<T> with _$Foo {
factory Foo({
// String Function() callBackOne,
String Function(T) callBackTwo,
}) = _Foo;
}
Run Code Online (Sandbox Code Playgroud)
使用 Freezed 类的小部件:
class MyHomePage extends StatelessWidget {
// final fooOne = Foo<int>(callBackOne: () => 'Result: 42');
final fooTwo = Foo<int>(callBackTwo: (value) => 'Result: ${value * 3}');
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text(fooTwo.callBackTwo(14)),
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
错误:
lib/foo.freezed.dart:128:26: Error: The return type of the method '_Foo.callBackTwo' is …Run Code Online (Sandbox Code Playgroud) 这是什么意思?启用它们有什么好处吗?
我收到的消息是:
Unable to connect to VM service at http://127.0.0.1:53932/pq_PklwHCMK=/:
getDartDevelopmentServiceVersio: (-32601)
Method not found,
getDartDevelopmentServiceVersio: (-32601)
Method not found
Run Code Online (Sandbox Code Playgroud)
我尝试过的:
直到现在,这已经工作了很多年,而且我确实在 VScode 中看到 VScode 的 Dar 和 Flutter 已于 1 小时前更新到 3.19.0,所以我降级了,但我仍然遇到同样的问题。
我希望 BottomAppBar 是透明的并显示正在发生的情况\xef\xbc\x8cso 这是我的代码。
\nclass BottomTabNavigation extends StatefulWidget {\n @override\n _BottomTabNavigationState createState() => _BottomTabNavigationState();\n}\n\nclass _BottomTabNavigationState extends State<BottomTabNavigation>\n with AutomaticKeepAliveClientMixin, SingleTickerProviderStateMixin {\n PageController _pageController;\n int _currentIndex = 0;\n\n @override\n void initState() {\n super.initState();\n _pageController = PageController(\n initialPage: 0,\n );\n }\n\n @override\n void dispose() {\n super.dispose();\n _pageController.dispose();\n }\n\n @override\n Widget build(BuildContext context) {\n super.build(context);\n return Container(\n child: Stack(\n fit: StackFit.expand,\n children: [\n Container(\n color: Colors.transparent,\n ),\n _buildScaffold(),\n ],\n ),\n );\n }\n\n Scaffold _buildScaffold() {\n return Scaffold(\n backgroundColor: Colors.transparent,\n body: PageView(\n controller: …Run Code Online (Sandbox Code Playgroud) 我想从用户卡直接转账到关联帐户。为此,我必须指示 source_transaction 字段。
await stripe.transfers.create({
amount: amount,
currency: "eur",
destination: "{connected_account1}",
transfer_group: "{ORDER1}",
source_transaction: // How to get this information ?
});
Run Code Online (Sandbox Code Playgroud)
这是我从我的应用程序(PaymentMethod)获得的信息:
我需要做什么才能获取source_transaction我在 PaymentMethod 对象上获得的信息?
当我尝试在 Spring Boot 后端应用程序中验证 Firebase jwt 令牌时,出现以下错误:
无法验证 Firebase ID 令牌的签名。有关如何检索 ID 令牌的详细信息,请参阅 https://firebase.google.com/docs/auth/admin/verify-id-tokens 。
在客户端(Flutter)中,我按如下方式记录 jwt:
GoogleSignInAccount googleSignInAccount = await _googleSignIn.signIn();
GoogleSignInAuthentication googleSignInAuthentication = await googleSignInAccount.authentication;
AuthCredential credential = GoogleAuthProvider.credential(
accessToken: googleSignInAuthentication.accessToken,
idToken: googleSignInAuthentication.idToken,
);
UserCredential authResult = await _auth.signInWithCredential(credential);
_user = authResult.user;
logger.i(await _user.getIdToken()); // Print jwt
Run Code Online (Sandbox Code Playgroud)
我通过授权标头将记录到后端的 jwt 作为不记名令牌发送。
使用 Spring security(没关系),我只需执行以下检查:
FirebaseToken decoded = FirebaseAuth.getInstance().verifyIdToken(token);
Run Code Online (Sandbox Code Playgroud)
我的 firebase 应用程序初始化配置非常标准(设置了指向 config.json 的 env 变量):
@Primary
@Bean
public void firebaseInit() throws IOException {
FirebaseOptions options = FirebaseOptions.builder()
.setCredentials(GoogleCredentials.getApplicationDefault())
.build(); …Run Code Online (Sandbox Code Playgroud) 基本上我想在这里完成的是拥有一个水平类别列表(可以是 TabBar)和一个垂直类别列表,每个类别中都有项目列表。
当您单击某个类别时,它应该滚动到类别垂直列表中的某个位置。当您滚动垂直列表时,顶部的活动类别也应该更新当前的活动类别。
我在 FoodPanda 应用程序中看到过此功能,但无法复制它。
关于如何实现此功能有什么建议吗?
我在 Visual Studio Code 中有一个 flutter 项目,也上传到 git 中。现在我想通过更改现有项目来创建一个具有不同包和 AppName 的新项目。我怎样才能做到这一点?希望你们明白我在说什么。提前致谢
flutter ×10
dart ×3
agora.io ×1
android ×1
bottomappbar ×1
firebase ×1
freezed ×1
generics ×1
ios ×1
java ×1
new-project ×1
node.js ×1
pushkit ×1
spring-boot ×1
transparent ×1
voip ×1