小编the*_*ene的帖子

更新 FirebaseUser DisplayName(电子邮件身份验证)不会更新实例 CurrentUser

这可能类似于:FirebaseUser's profile is not updated

但是,可以肯定的是,我对自己的 Flutter 技能没有信心。我正在尝试在 Firebase 中更新 DisplayName,然后将currentUser.displayName. updateProfile 似乎运行得很好,但即使在 reload() 调用之后 currentUser 也不会使用新的 displayName 进行更新。

我希望任何人都可以告诉我我做错了什么,或者将其归咎于 Firebase 中的错误。

我的代码:

Future _update(FirebaseUser user, String displayName) async {
  UserUpdateInfo _updateData= new UserUpdateInfo();
  _updateData.displayName = displayName;
  await user.updateProfile(_updateData);
  await user.reload();
  setState(() {
    _currentDisplayName = user.displayName;
  });
}
Run Code Online (Sandbox Code Playgroud)

dart firebase firebase-authentication flutter

5
推荐指数
1
解决办法
3128
查看次数

Flutter Slider无法移动或更新

我正在学习Flutter(以及一般的编码),但似乎找不到最新项目的问题。当我在模拟器中运行时,滑块会很好,单击拇指,标签会显示出来,但是拇指根本不会在轨道上移动,因此永远不会调用onChanged事件。

import 'resources.dart';
import 'package:flutter/material.dart';
import 'package:flutter/foundation.dart';

class ItemDetail extends StatefulWidget {
  final Item item;

  ItemDetail({Key key, @required this.item}) : super(key: key);

  @override
  _ItemDetailState createState() => new _ItemDetailState(item: item);
}

class _ItemDetailState extends State<ItemDetail> {
  Item item;

  _ItemDetailState({Key key, @required this.item});

  @override
  Widget build(BuildContext context) {
    double margin = ((item.listPrice - item.stdUnitCost)/item.listPrice)*100;
    return new Scaffold(
      appBar: AppBar(
        title: new Text('Item Detail'),
      ),
      body: new Column(
        children: <Widget>[
          new Padding(padding: EdgeInsets.symmetric(vertical: 20.0)),
          new Text(item.itemCode),
          new Text(item.itemDescription),
          new Text(item.itemExtendedDescription),
          new Divider(height: 40.0,), …
Run Code Online (Sandbox Code Playgroud)

flutter

2
推荐指数
4
解决办法
2189
查看次数

标签 统计

flutter ×2

dart ×1

firebase ×1

firebase-authentication ×1