小编jos*_*tef的帖子

当我使用带有自动焦点的文本字段时,Flutter 会引发错误

当我在 Flutter 中使用TextField小部件并将属性autoFocus的值设置为true 时

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: TextField(
          autofocus: true,
        ),
      ),
    );
  }
}
Run Code Online (Sandbox Code Playgroud)

颤振抛出错误

I/flutter (31721): ??? EXCEPTION CAUGHT BY FOUNDATION LIBRARY ?????????????????????????????????????????????????????????
I/flutter (31721): The following assertion was thrown while dispatching notifications for FocusNode:
I/flutter (31721): RenderBox was not laid out: RenderEditable#bf516 NEEDS-LAYOUT …
Run Code Online (Sandbox Code Playgroud)

input textfield dart flutter

7
推荐指数
1
解决办法
3658
查看次数

Dart 中整数变量的大小是多少

在 Dart 站点中,他们说整数大小是 64 位,这是整数的最大大小,还是任何整数的大小,即使整数是一个小数字,例如 12?

如果每个整数大小都是 64 位,这会影响应用程序的性能吗?

size int dart

4
推荐指数
1
解决办法
3453
查看次数

标签 统计

dart ×2

flutter ×1

input ×1

int ×1

size ×1

textfield ×1