小编Tab*_*aba的帖子

在 NDK 工具链文件夹中找不到带有前缀:arm-linux-androideabi 的 ABI 工具链

我当时正在开发一个Flutter项目,一切都工作正常,直到我更新了 My Android Studio和一些SDK 工具。然后,当我尝试运行我的项目时,出现以下错误:

FAILURE: Build failed with an exception.

*   What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.

> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

*   Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

*   Get more help at [https://help.gradle.org](https://help.gradle.org)

BUILD FAILED in 1m 4s
Exception: …
Run Code Online (Sandbox Code Playgroud)

flutter

43
推荐指数
3
解决办法
5万
查看次数

如何在 Flutter 中水平居中 Positioned()

我目前正在为我的应用程序构建一个验证码屏幕,并使用带有一些 Positioned() 小部件的堆栈,因为验证码表单也应该很好地定位,但如何使其水平居中?

我的代码如下:

    @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        child: Stack(
          children: [
            Image.asset(verificationImage),
            Positioned(
              left: MediaQuery.of(context).size.width * 0.075,
              top: MediaQuery.of(context).size.height * 0.32,
              width: MediaQuery.of(context).size.width * 0.6,
              child: Text(
                'We have send you an email with a verification code at ${generatedCode[0]}${generatedCode[1]}***',
                style: TextStyle(
                    color: Colors.white,
                    fontWeight: FontWeight.bold,
                    fontSize: MediaQuery.of(context).size.height * 0.025),
              ),
            ),
            //Later the
            // Mail Adress
            Positioned(
              child: Form(
                key: formKey,
                child: CodeFields(
                  length: codeLength,
                  validator: validateCode,
                  fieldWidth: MediaQuery.of(context).size.width * 0.1,
                  fieldHeight: MediaQuery.of(context).size.width * …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

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

如何设置onLongPress的持续时间

我知道onLongPress会在一段时间后触发(比如 500 毫秒左右)。但我想做的是当用户按下按钮 3 秒左右时触发一些操作。实际上我想设置 的持续时间onLongPress

ElevatedButton(
  onPressed: () => print('ok I\'m just fine'),
  onLongPress: () => print('Trigger me when user presses me for like 3 seconds'),
  style: ElevatedButton.styleFrom(
  primary: Colors.red,
  elevation: 4,
),
Run Code Online (Sandbox Code Playgroud)

dart flutter

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

如何检测小部件中的溢出

我想知道是否有办法检测小部件中发生的溢出并返回一个布尔值以根据trueorfalse值进行一些更改。

例如,我有一个里面有文字的容器。我想检测文本何时溢出容器,之后我将在某些条件下使容器变大。我知道有一些方法,auto_size_text但这里的重点是检测溢出

flutter flutter-layout flutter-widget

5
推荐指数
2
解决办法
1884
查看次数

如何更改 ElevatedButton 颜色或阴影 Flutter

我一直在使用RaisedButton直到 Flutter 弃用它,我们不能再使用它了。有一个建议说“ElevatedButton改用”。所以,我想使用它,但我不能看到这样的属性colorelevationfocusColor等。

那么我怎样才能个性化一个ElevatedButton

flutter flutter-layout

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

如何更改 ElevatedButton Flutter 中的 onPressed 高度

2.0.1flutter版本之前,我使用的是RaisedButton并且有一个属性被调用focusElevation来改变按钮被按下时的高度。因此,在 Flutter 弃用它之后,根据文档,我们应该改用它ElevatedButton。但是现在我找不到用style:属性来改变它的方法。

我知道如何更改高度,但我想更改用户按下时的onPressed 高度。从它的文档来看,它有一些默认值:

按钮的高程是相对于高程参数定义的。禁用的仰角与参数值相同,当按钮悬停或聚焦时使用仰角+2,按下按钮时使用仰角+6。

因此,任何想法如何定制onPressed抬高ElevatedButton

flutter flutter-layout

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

flutter中如何构建无键发布模式——Flutter调试模式好慢

每当我尝试使用命令测试我的应用程序时,flutter run它都非常缓慢且缓慢,并且我无法确定我的应用程序在发布模式下的性能如何。然而,为了构建 Android 应用程序,release mode我们需要为应用程序创建一个密钥,它不会显示大部分日志文件打印

所以问题是,有没有办法以发布模式格式运行应用程序,但具有调试功能?

flutter flutter-test flutter-build

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

如何检测用户最后滚动的方向

我有下面的代码,可以更改用户向下或向上滚动时的工厂不透明度。但为了它,我setState()多次调用该方法。有没有什么方法可以检测用户滚动的最后一个方向,以便我可以setState()在那一刻调用一次?或者,如果您可以为此定义一个新的增强功能,我将不胜感激。

@override
void initState() {
super.initState();
_controller = ScrollController()
  ..addListener(() {
    upDirection = _controller.position.userScrollDirection == ScrollDirection.forward;
    upDirection = _controller.position.userScrollDirection == ScrollDirection.reverse;


      if (upDirection)
        setState(() {
          _scrolled = 0.5;
          flag = false;
        });
      else if (!upDirection) {
        setState(() {
          _scrolled = 1.0;
        });
        flag = false;
      }

  });
}
Run Code Online (Sandbox Code Playgroud)

这是清单

    return Scaffold(
    body:
    SingleChildScrollView(
      controller: _controller,
      child: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Container(),
            Container(),
            Container(),
            Container(),
            Container(),
            Container(),
          ],
        ),
      ),
    ),

  floatingActionButton: …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout flutter-animation

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

如何禁用 AlertDialog 颤动的 onBackPressed()

我有一个AlertDialog()barrierDismissible已设置为false。但是,当用户按下 Android 设备上的后退按钮时,AlertDialog 将关闭。如何才能完全阻止用户关闭AlertDialog()?

这是我到目前为止所做的:

          return showDialog<bool>(
            context: context,
            barrierDismissible: false,
            builder: (BuildContext context) {
              return AlertDialog(
                title: Text('Title'),
                content: Text('This is the alert dialog content'),
                actions: <Widget>[
                  FlatButton(
                    child: Text('ok'),
                    onPressed: () {
                      Navigator.of(context).pop();
                      print('ok you win');
                    },
                  ),
                ],
              );
            },
          );
Run Code Online (Sandbox Code Playgroud)

flutter flutter-layout

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