小编cip*_*nat的帖子

在一个小部件子列表中多次使用全局键

关闭应用程序后,当我再次尝试打开它时,出现以下错误,但仅在 iOS 平台上,Android 运行良好。

在此处输入图片说明

我环顾四周,有几个关于这个问题的问题和问题,但我无法解决它。我也在使用bloc模式来管理状态。

GlobalKey<FormState>在我的AuthenticateForm.

import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:low_code/blocs/authentication/authentication_bloc.dart';
import 'package:low_code/blocs/authentication/authentication_event.dart';
import 'package:low_code/helpers/app_localization/app_localizations.dart';

class AuthenticateForm extends StatefulWidget {
  @override
  _AuthenticateFormState createState() => _AuthenticateFormState();
}

class _AuthenticateFormState extends State<AuthenticateForm> {
  GlobalKey<FormState> _formKey = GlobalKey<FormState>();

  String username;

  String password;

  @override
  Widget build(BuildContext context) {
    AppLocalizations appLocalizations = AppLocalizations.of(context);
    return Form(
      key: _formKey,
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.stretch,
        children: <Widget>[
          TextFormField(
            onSaved: (String value) => username = value,
            initialValue: 'dms-bpm',
            decoration: InputDecoration(
                labelText: appLocalizations.translate('username')),
            // …
Run Code Online (Sandbox Code Playgroud)

dart flutter bloc

7
推荐指数
2
解决办法
9771
查看次数

边界半径不适用于容器小部件

边框半径不适用于子级内部Container。尝试了SizedBoxStack小部件。我需要容器内的边框视图。

Scaffold(
  appBar: AppBar(
    title: new Text("ListView"),
  ),
  body: Center(
      child: Padding(
        padding: EdgeInsets.all(15.0),
        child: Container(
            decoration: BoxDecoration(
                borderRadius: BorderRadius.circular(15.0),
                border: Border.all(
                    color: Colors.green,
                    width: 2.0
                )
            ),
            child: Container(
              color: Colors.red,
            )
        ),
      )
  )
)
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

flutter

5
推荐指数
7
解决办法
6869
查看次数

更改场景时,如何在“它所依赖的应用程序”之前删除我的 Auth 对象?

因此,在我的 AR 应用程序中使用 Firebase 身份验证和存储。完成登录和资产包下载后,我的脚本将用户引导到下一个场景(通过 SceneManager.LoadScene()),在那里他们可以与其内容进行交互。

但是,在场景转换时,此错误会导致在编辑器中以不一致的方式暂停:

“ApplicationException: Auth object 0x7586a0f0 应该在它依赖的 App 0x77b799a0 之前被删除。Firebase.FirebaseApp.ReleaseReferenceInternal (Firebase.FirebaseApp app)(在 Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unityApp/proxy/Firebase .cs:998) Firebase.FirebaseApp.RemoveReference ()(在 Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:293) Firebase.FirebaseApp.Dispose ()(在 Z: /tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy/FirebaseApp.cs:51) Firebase.FirebaseApp.Finalize () (在 Z:/tmp/tmp.n6hJS53AxW/firebase/app/client/unity/proxy /FirebaseApp.cs:47) UnityEngine.UnhandledExceptionHandler:m__0(Object, UnhandledExceptionEventArgs)"

如何在场景转换之前删除我的 Auth 对象?我试过auth.Dispose()auth.SignOut(),没有运气。

unity-game-engine firebase firebase-authentication firebase-storage

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

CupertinoTabBar 阻止当前 Tab 底部部分如何避免这种情况还是默认行为

我改变了我BottomNavigatorBarCupertinoTabBar,它不会压缩当前的Tab

换句话说,我将无法显示当前选项卡底部的一些信息,因为CupertinoTabBar它会阻止它。

我不知道这是Cupertino样式的默认行为,但我需要解决它。我尝试用CupertinoTabView和/或包装我的页面CupertinoPageScaffold,两者都不起作用。

你有什么建议吗?

在此处输入图片说明 在此处输入图片说明

这是我的相关代码:

    return CupertinoTabScaffold(
      tabBar: CupertinoTabBar(currentIndex: 2, items: [
        BottomNavigationBarItem(
            icon: Icon(Icons.explore), title: Text('Explore')),
        BottomNavigationBarItem(
            icon: Icon(Icons.card_travel), title: Text('Adventure')),
        BottomNavigationBarItem(
            icon: Icon(Icons.search), title: Text('Search')),
        BottomNavigationBarItem(
            icon: Icon(Icons.map), title: Text('Create Tour')),
        BottomNavigationBarItem(
            icon: Icon(Icons.person), title: Text('Profile')),
      ]),
      tabBuilder: (context, index) {
        switch (index) {
          case 0:
            return CupertinoTabView(
              builder: (context) => ExplorePage(),
            );
            break;
          case 1:
            return AdventurePage();
            break;
          case 2:
            return CupertinoTabView(
              builder: …
Run Code Online (Sandbox Code Playgroud)

dart flutter flutter-layout

3
推荐指数
1
解决办法
1184
查看次数

Flutter - 使滑动面板看起来像抽屉

我想做一个从右边滑动的小面板onPress来显示一些信息。我已经有一个Drawer在我Scaffold的显示菜单。

我正在寻找这样的东西:

在此处输入图片说明

我还没有找到任何东西,除了 Drawer

slider flutter

2
推荐指数
1
解决办法
2200
查看次数