我相信这个问题会重复这个问题:
但那个问题并没有足够清楚地回答我的问题,所以我又问了一次。
我有一个应用程序,我想测试应用程序内支付功能,并且我读到应用程序内产品只有在应用程序发布到至少测试版或 Alpha 版后才能使用。
我想将应用程序发布到测试版或 Alpha 版,但似乎为了获得选择加入的 URL,您至少需要一个版本的应用程序向公众发布(Playstore),如果我没记错的话,我不想这样做,因为该应用程序仍在开发中。
有没有办法在将应用程序的任何版本发布到 Playstore 之前进行 alpha 测试?
编辑:为什么我在这里没有看到选择加入的 URL?
当图像上传到Firebase的云存储中时,我想创建一个方形缩略图。我只想将图像的中心裁剪为正方形,然后将其大小调整为150px x 150px。像这样:
我想要这个
当它上传时
我想要这个
我想在Firebase中做到这一点,但他们不只是使用Imagemagick,而是使用spawn,而且我无法弄清楚这两者如何结合在一起。
对于代码,我几乎从这里复制并粘贴了代码:https : //github.com/firebase/functions-samples/blob/master/quickstarts/thumbnails/functions/index.js
我什至无法成功获取图像的尺寸,那么如何才能首先获得尺寸并实现我想要的功能?
/**
* Copyright 2016 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on …
Run Code Online (Sandbox Code Playgroud) 我正在使用 Flutter 开发一个应用程序,并使用 FCM 和 firebase_messaging Flutter 插件来实现推送通知:
https://pub.dartlang.org/packages/firebase_messaging
在这个插件的Readme.md上,它说当Android设备在应用程序终止时收到数据消息时,该消息将丢失,但是当设备收到通知消息时,该消息将显示在应用程序托盘上该应用程序已终止或只是在后台运行。
我已经实现了这个插件,但它的行为与 Readme.md 描述的方式不同。当应用程序终止时,通知消息在我的 Android 设备上丢失。
这是我发送到设备的示例有效负载:
var payload = {
notification: {
title: `message from somebody`,
body: `message text here`,
}
}
Run Code Online (Sandbox Code Playgroud)
我可能做错了什么?我是否在有效负载中遗漏了某些内容,或者是其他内容?
android android-notifications flutter firebase-cloud-messaging
在 Flutter 中,很难找出哪些主题属性改变了应用程序的哪个部分。例如,AppBar 的背景颜色默认为正在使用的主题的primaryColor。我没有在 AppBar 的文档中的任何地方看到这个
https://docs.flutter.io/flutter/material/AppBar-class.html
我们应该如何知道哪个主题属性会改变我们小部件的哪些部分?
我有一个Flutter应用程序,正在使用远程配置来检索一些信息,但是代码在获取数据时会引发异常。
这是我设置远程配置的方法。
Future<RemoteConfig> setupRemoteConfig() async {
final RemoteConfig remoteConfig = await RemoteConfig.instance;
// Enable developer mode to relax fetch throttling
remoteConfig.setConfigSettings(RemoteConfigSettings(debugMode: true));
remoteConfig.setDefaults(<String, dynamic>{
'categories': "food,drink",
});
await remoteConfig.fetch(expiration: const Duration(hours: 5));
await remoteConfig.activateFetched();
return remoteConfig;
}
Run Code Online (Sandbox Code Playgroud)
此代码引发以下异常:
Exception: Unable to fetch remote config
Run Code Online (Sandbox Code Playgroud)
在我的控制台中说:
W/FirebaseRemoteConfig(10456): IPC failure: 6503:NOT_AVAILABLE
Run Code Online (Sandbox Code Playgroud)
我怎样才能解决这个问题?
我是Flutter的新手,我想知道(对我来说)如何解决如何将变量var int counter = 0转换为解决方案有多困难?放入变量var String $ counter =“ 0”;
我进行了很多搜索,但根本没有发现类似var myInt = int.parse('12345');的内容。
不适用于var myInt = int.parse(counter);
特别感谢您的建议
我是 Flutter 和 Firebase 的新手,我正在尝试验证表单中的用户输入并针对 firebase 集合运行它。
我要求用户创建一个用户名,并希望验证我的 Firebase 目录中不存在现有用户名。
我从Check if Field Already Existing in Flutter Firestore 的讨论中得到了这个验证方法。我想为该方法提供一个名称,构建具有该名称的文档列表,并确认不存在。
Future<bool> doesNameAlreadyExist(String name) async {
final QuerySnapshot result = await Firestore.instance
.collection('user')
.where('user_id', isEqualTo: name)
.limit(1)
.getDocuments();
final List<DocumentSnapshot> documents = result.documents;
return documents.length == 1;
}
Run Code Online (Sandbox Code Playgroud)
我希望能够在文本表单字段的验证器中调用此方法,如下所示。
new TextFormField(
decoration: new InputDecoration(labelText: 'Username'),
validator: (value) => doesNameAlreadyExist(value) ? "Username already taken" : null,
onSaved: (value) => _username = value,
),
Run Code Online (Sandbox Code Playgroud)
但是,这会引发一个错误,即我必须为验证器提供静态 bool 类型。
我的问题:我如何(1)创建一个能够搜索 Firebase 的静态布尔方法或(2)如何通过异步调用获得相同的功能(理想情况下,无需构建另一个小部件)?
我正在使用包含背景图像和标题的SliverAppBar。标题文本为白色,我需要在AppBar上将颜色更改为黑色(“减少”)(因为标签栏也为白色)。
怎么做 ?
NestedScrollView(
headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled) {;
return <Widget>[
SliverAppBar(
expandedHeight: 200.0,
floating: false,
pinned: true,
backgroundColor: Colors.white,
flexibleSpace: FlexibleSpaceBar(
centerTitle: true,
title: Text(_event.name,
style: TextStyle(
color: Colors.white,
fontSize: 16.0,
)),
background: CachedNetworkImage(
imageUrl: _event?.imageMediumUrl ??
'http://preprod.tibib-live.com/medias/cached-media/medium/5bea5964109aa-c827b05facc3781485e584dac2f4dddc.png',
fit: BoxFit.cover,
)),
),
SliverPersistentHeader(
delegate: _SliverAppBarDelegate(
TabBar(
labelColor: Colors.white,
indicatorColor: Colors.red,
unselectedLabelColor: Colors.grey,
tabs: [
Tab(icon: Icon(Icons.info), text: "Info"),
Tab(icon: Icon(Icons.people), text: "Courses"),
],
),
),
pinned: true,
),
];
},
body: TabBarView(
children: <Widget>[_buildInfo(), _buildTrials()],
),
),
Run Code Online (Sandbox Code Playgroud) 语境:
我正在发现 flutter 和 dart。我做应用程序只是为了我自己的乐趣。
我的目标
我想制作一个愚蠢的应用程序,每天显示一个随机图标(如每日一词)。
但我现在不确定如何继续。在所有示例中,代码直接引用在各自的类中声明的 IconData 字段,例如FontAwesomeIcons
或Icons
材质图标。
这些字段被声明为static const
. 访问这些字段的最正确方法是什么,以便将它们放入可以随机选择索引的列表中?
library font_awesome_flutter;
import 'package:flutter/widgets.dart';
import 'package:font_awesome_flutter/icon_data.dart';
// THIS FILE IS AUTOMATICALLY GENERATED!
class FontAwesomeIcons {
static const IconData fiveHundredPx = const IconDataBrands(0xf26e);
static const IconData accessibleIcon = const IconDataBrands(0xf368);
static const IconData accusoft = const IconDataBrands(0xf369);
Run Code Online (Sandbox Code Playgroud)
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can …
Run Code Online (Sandbox Code Playgroud) 在这种情况下,我正在遍历 Cloud Firestore 集合中的文档,如何获取文档的路径?
children: snapshot.data.documents.map((document) {
return new ListTile(
//want to get the document path here
title: new Text(document.path),
);
Run Code Online (Sandbox Code Playgroud)
显然,您可以访问路径数据,但是我在 github 上找到的解释非常不清楚 https://github.com/flutter/plugins/pull/244