ByteNote LogoByteNote

Navigation

  • Blog
  • 工具

    © 2025 ByteNote. All rights reserved.

    How to change background color and elevation of Alertdialog

    Jul 20, 20225 min read
    AlertDialog(
                title: Text('Welcome'),
                content: Text('Do you wanna learn flutter?'),
                actions: [
                  TextButton(
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    child: Text('YES', style: TextStyle(color: Colors.black),),
                  ),
                  TextButton(
                    onPressed: () {
                      Navigator.of(context).pop();
                    },
                    child: Text('NO', style: TextStyle(color: Colors.black),),
                  ),
                ],
                elevation: 10,
                backgroundColor: Colors.green,
              ),
    

    相关文章

    Flutter 如何打开 指定页面的URL?

    在Flutter中,通过添加`url_launcher`插件并遵循一系列步骤,可以实现在应用中打开指定页面的URL。

    安卓播放器无法挂载 ASS 字幕,请问如何解决?

    确保播放器支持ASS字幕,文件名一致并放在同一文件夹,设置中开启字幕选项,使用UTF-8编码,必要时修改后缀名或使用第三方软件加载字幕。

    Shell脚本中的set指令,比如set -x 和 set -e

    总结:Shell脚本中的set指令,如set -x和set -e,用于设置shell的执行方式,包括调试输出和错误立即退出等功能。

    SwiftUI 如何获取当前屏幕的高度和宽度?

    在 SwiftUI 中,通过 GeometryReader 和 GeometryProxy 可以获取并利用屏幕的布局信息,如宽度和高度。

    Flutter Unable to find a target named RunnerTests in project Runner.xcodeproj, did find Runner.

    To resolve an error in a Flutter project's tests when using Xcode, add a "RunnerTests" target by following specific steps in Xcode.