- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
flutter firebase 的代码实验室我已经完成了一半
应用程序加载正常,接受输入,然后加载 Google 登录选项(如果尚未登录则添加帐户)。在此之后,应用程序卡住。
下面是一些抛出异常的截图:message_codecs.dart 第 514 行
throw new PlatformException(code: errorCode, message: errorMessage, details: errorDetails);
带有新 Flutter 插件运行模拟器的 Android Studio 截图:
这是 main.dart:
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';
import 'package:google_sign_in/google_sign_in.dart';
import 'dart:async';
const String _name = "GCom";
final googleSignIn = new GoogleSignIn();
final ThemeData kIOSTheme = new ThemeData(
primarySwatch: Colors.orange,
primaryColor: Colors.grey[100],
primaryColorBrightness: Brightness.light,
);
final ThemeData kDefaultTheme = new ThemeData(
primarySwatch: Colors.red,
accentColor: Colors.orangeAccent[400],
);
void main() {
runApp(new FriendlychatApp());
}
Future<Null> _ensureLoggedIn() async {
GoogleSignInAccount user = googleSignIn.currentUser;
if (user == null) user = await googleSignIn.signInSilently();
if (user == null) {
await googleSignIn.signIn();
}
}
class FriendlychatApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new MaterialApp(
title: "friendly chatty patch",
theme: defaultTargetPlatform == TargetPlatform.android
? kDefaultTheme
: kIOSTheme,
home: new ChatScreen(),
);
}
}
class ChatMessage extends StatelessWidget {
ChatMessage({this.text, this.animationController});
final String text;
final AnimationController animationController;
@override
Widget build(BuildContext context) {
return new SizeTransition(
sizeFactor: new CurvedAnimation(
parent: animationController, curve: Curves.easeOut),
axisAlignment: 0.0,
child: new Container(
margin: const EdgeInsets.symmetric(
vertical: 15.0), //10 vertical depth from top of screen. height.
child: new Row(
crossAxisAlignment:
CrossAxisAlignment.start, //distance vertical of avatar icon
children: <Widget>[
new Container(
margin: const EdgeInsets.only(
right: 16.0), //0-36- move r of Icon orig 16
child: new CircleAvatar(
backgroundImage:
new NetworkImage(googleSignIn.currentUser.photoUrl))),
new Column(
crossAxisAlignment: CrossAxisAlignment
.end, //.start brings _name end to end of text vertical
children: <Widget>[
new Text(googleSignIn.currentUser.displayName, //_name
style: Theme.of(context).textTheme.subhead), //headline
new Container(
margin: const EdgeInsets.only(
top: 5.0), //distance under _name 40
child: new Text(text +
" whenever") // style: Theme.of(context).textTheme.subhead),
),
],
),
],
),
));
}
}
class ChatScreen extends StatefulWidget {
@override
State createState() => new ChatScreenState();
}
class ChatScreenState extends State<ChatScreen> with TickerProviderStateMixin {
final List<ChatMessage> _messages = <ChatMessage>[];
final TextEditingController _textController = new TextEditingController();
bool _isComposing = false;
@override
Widget build(BuildContext context) {
return new Scaffold(
//can be different than title?
appBar: new AppBar(
title: new Text("friendly chatty patchy codelab."),
elevation:
Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0,
),
body: new Container(
child: new Column(children: <Widget>[
new Flexible(
child: new ListView.builder(
padding: new EdgeInsets.all(8.0),
reverse: false, //true to place at bottom of screen.
itemBuilder: (_, int index) => _messages[index],
itemCount: _messages.length,
)),
new Divider(height: 1.0),
new Container(
decoration: new BoxDecoration(color: Theme.of(context).cardColor),
child: _buildTextComposer(),
),
]))); //extra )?
}
@override
Widget _buildTextComposer() {
return new IconTheme(
data: new IconThemeData(color: Theme.of(context).accentColor),
child: new Container(
margin: const EdgeInsets.symmetric(horizontal: 8.0), //distance from r
child: new Row(children: <Widget>[
new Flexible(
child: new TextField(
controller: _textController,
onChanged: (String text) {
setState(() {
_isComposing = text.length > 2; //>0
});
},
onSubmitted: _handleSubmitted,
decoration: new InputDecoration.collapsed(
hintText: "send a message..."),
),
),
new Container(
margin: new EdgeInsets.symmetric(horizontal: 4.0),
child: Theme.of(context).platform == TargetPlatform.iOS
? new CupertinoButton(
child: new Text("Send"),
onPressed: _isComposing
? () => _handleSubmitted(_textController.text)
: null,
)
: new IconButton(
icon: new Icon(Icons.send), //whatever icon
onPressed: _isComposing
? () => _handleSubmitted(_textController.text)
: null,
)),
]),
decoration: Theme.of(context).platform == TargetPlatform.iOS
? new BoxDecoration(
border:
new Border(top: new BorderSide(color: Colors.grey[200])))
: null),
);
}
Future<Null> _handleSubmitted(String text) async {
_textController.clear();
setState(() {
_isComposing = false;
});
await _ensureLoggedIn();
// ignore: referenced_before_declaration
void _sendMessage({String text}) {
ChatMessage message = new ChatMessage(
text: text,
animationController: new AnimationController(
duration: new Duration(milliseconds: 1000),
vsync: this,
),
);
setState(() {
_messages.insert(0, message);
});
message.animationController.forward();
}
_sendMessage(text: text);
}
@override
void dispose() {
for (ChatMessage message in _messages)
message.animationController.dispose();
super.dispose();
}
}
Android 监视器显示应用程序正在加载,启动 Google 登录。只有当我点击谷歌帐户时,才会出现“未知缓冲区”。
20 13:15:39.403 3342-3367/? D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
10-20 13:15:39.468 3342-3367/? I/OpenGLRenderer: Initialized EGL, version 1.4
[ 10-20 13:15:39.469 3342: 3367 D/ ]
HostConnection::get() New Host Connection established 0x7f629efd1ea0, tid 3367
[ 10-20 13:15:39.470 3342: 3367 W/ ]
Unrecognized GLES max version string in extensions: ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1
10-20 13:15:39.470 3342-3367/? W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
10-20 13:15:39.482 3342-3367/? D/EGL_emulation: eglCreateContext: 0x7f629efe2220: maj 2 min 0 rcv 2
10-20 13:15:39.489 3342-3367/? D/EGL_emulation: eglMakeCurrent: 0x7f629efe2220: ver 2 0 (tinfo 0x7f629f08ec60)
10-20 13:15:39.504 3342-3367/? D/EGL_emulation: eglMakeCurrent: 0x7f629efe2220: ver 2 0 (tinfo 0x7f629f08ec60)
10-20 13:15:39.519 3342-3342/? D/EGL_emulation: eglCreateContext: 0x7f629b407b20: maj 2 min 0 rcv 2
10-20 13:15:39.533 3342-3342/? D/EGL_emulation: eglMakeCurrent: 0x7f629b407b20: ver 2 0 (tinfo 0x7f629b38bfa0)
10-20 13:15:39.632 3342-3361/? D/EGL_emulation: eglMakeCurrent: 0x7f629b407b20: ver 2 0 (tinfo 0x7f629b38bee0)
10-20 13:15:39.635 3342-3368/? I/flutter: Diagnostic server listening on http://127.0.0.1:35653/
10-20 13:15:39.719 3342-3368/? I/flutter: Observatory listening on http://127.0.0.1:45464/
10-20 13:16:16.163 3342-3367/com.yourcompany.gcodelab D/EGL_emulation: eglMakeCurrent: 0x7f629efe2220: ver 2 0 (tinfo 0x7f629f08ec60)
10-20 13:16:23.166 3342-3367/com.yourcompany.gcodelab D/EGL_emulation: eglMakeCurrent: 0x7f629efe2220: ver 2 0 (tinfo 0x7f629f08ec60)
10-20 13:16:23.166 3342-3367/com.yourcompany.gcodelab E/Surface: getSlotFromBufferLocked: unknown buffer: 0x7f629efe1640
最佳答案
我认为如果未启用 Google 登录(可以在 Firebase 控制台或 here 中完成),或者用于签署 APK 的公钥哈希未上传到 Firebase 控制台,或者如果应用程序标识符(例如 com.example.myapp)未在 Firebase 控制台中正确设置。我建议检查这三件事以确保它们已完成。不过,您没有看到任何有用的控制台日志,这有点奇怪。
关于firebase - Google 登录后发送消息后屏幕卡住(Flutter Firebase Codelab 友好聊天应用程序),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46848740/
我一直在读到,如果一个集合“被释放”,它也会释放它的所有对象。另一方面,我还读到,一旦集合被释放,集合就会释放它的对象。 但最后一件事可能并不总是发生,正如苹果所说。系统决定是否取消分配。在大多数情况
我有一个客户端-服务器应用程序,它使用 WCF 进行通信,并使用 NetDataContractSerializer 序列化对象图。 由于服务器和客户端之间传输了大量数据,因此我尝试通过微调数据成员的
我需要有关 JMS 队列和消息处理的帮助。 我有一个场景,需要针对特定属性组同步处理消息,但可以在不同属性组之间同时处理消息。 我了解了特定于每个属性的消息组和队列的一些知识。我的想法是,我想针对
我最近开始使用 C++,并且有一种强烈的冲动 #define print(msg) std::cout void print(T const& msg) { std::cout void
我已经为使用 JGroups 编写了简单的测试。有两个像这样的简单应用程序 import org.jgroups.*; import org.jgroups.conf.ConfiguratorFact
这个问题在这里已经有了答案: Firebase messaging is not supported in your browser how to solve this? (3 个回答) 7 个月前关
在我的 C# 控制台应用程序中,我正在尝试更新 CRM 2016 中的帐户。IsFaulted 不断返回 true。当我向下钻取时它返回的错误消息如下: EntityState must be set
我正在尝试通过 tcp 将以下 json 写入 graylog 服务器: {"facility":"GELF","file":"","full_message":"Test Message Tcp",
我正在使用 Django 的消息框架来指示成功的操作和失败的操作。 如何排除帐户登录和注销消息?目前,登录后登陆页面显示 已成功登录为“用户名”。我不希望显示此消息,但应显示所有其他成功消息。我的尝试
我通过编写禁用qDebug()消息 CONFIG(release, debug|release):DEFINES += QT_NO_DEBUG_OUTPUT 在.pro文件中。这很好。我想知道是否可以
我正在使用 ThrottleRequest 来限制登录尝试。 在 Kendler.php 我有 'throttle' => \Illuminate\Routing\Middleware\Throttl
我有一个脚本,它通过die引发异常。捕获异常时,我想输出不附加位置信息的消息。 该脚本: #! /usr/bin/perl -w use strict; eval { die "My erro
允许的消息类型有哪些(字符串、字节、整数等)? 消息的最大大小是多少? 队列和交换器的最大数量是多少? 最佳答案 理论上任何东西都可以作为消息存储/发送。实际上您不想在队列上存储任何内容。如果队列大部
基本上,我正在尝试创建一个简单的 GUI 来与 Robocopy 一起使用。我正在使用进程打开 Robocopy 并将输出重定向到文本框,如下所示: With MyProcess.StartI
我想将进入 MQ 队列的消息记录到数据库/文件或其他日志队列,并且我无法修改现有代码。是否有任何方法可以实现某种类似于 HTTP 嗅探器的消息记录实用程序?或者也许 MQ 有一些内置的功能来记录消息?
我得到了一个带有 single_selection 数据表和一个命令按钮的页面。命令按钮调用一个 bean 方法来验证是否进行了选择。如果不是,它应该显示一条消息警告用户。如果进行了选择,它将导航到另
我知道 MSVC 可以通过 pragma 消息做到这一点 -> http://support.microsoft.com/kb/155196 gcc 是否有办法打印用户创建的警告或消息? (我找不到谷
当存在大量节点或二进制数据时, native Erlang 消息能否提供合理的性能? 情况 1:有一个大约 50-200 台机器的动态池(erlang 节点)。它在不断变化,每 10 分钟大约添加或删
我想知道如何在用户登录后显示“欢迎用户,您已登录”的问候消息,并且该消息应在 5 秒内消失。 该消息将在用户成功登录后显示一次,但在同一 session 期间连续访问主页时不会再次显示。因为我在 ho
如果我仅使用Welcome消息,我的代码可以正常工作,但是当打印p->client_name指针时,消息不居中。 所以我的问题是如何将消息和客户端名称居中,就像它是一条消息一样。为什么它目前仅将消
我是一名优秀的程序员,十分优秀!