小编Dha*_*han的帖子

升级到 Flutter 3.16 后,应用栏、背景颜色、按钮大小和空格发生变化

我将 Flutter 版本升级到 3.16。当我运行我的应用程序时,我注意到用户界面发生了很多变化。

  1. 应用栏不再有阴影。当我滚动时,应用程序栏现在带有颜色并且显示时没有阴影。
  2. 原本身体的背景是白色的,现在却染上了一点颜色。
  3. 按钮和空间现在看起来更大了。
  4. 警报对话框、时间选择器、日期选择器和其他材料组件现在看起来有所不同。它们呈现浅紫色(或我正在使用的主题的颜色)。

升级到 Flutter 3.16 前后


如何获得与升级到 Flutter 3.16 之前相同的 UI 外观?

flutter flutter-theme flutter-upgrade flutter-material

28
推荐指数
1
解决办法
6039
查看次数

build_runner 显示错误未为类“ClassDeclaration”定义 getter“macroKeyword”

当我运行 build_runner 命令时,它显示以下错误:

Failed to build build_runner:build_runner:
../../.pub-cache/hosted/pub.dev/dart_style-2.3.5/lib/src/front_end/ast_node_visitor.dart:251:16: Error: The getter 'macroKeyword' isn't defined for the class 'ClassDeclaration'.
  - 'ClassDeclaration' is from 'package:analyzer/src/dart/ast/ast.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-6.2.0/lib/src/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'macroKeyword'.
          node.macroKeyword,
                ^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/dart_style-2.3.5/lib/src/source_visitor.dart:595:19: Error: The getter 'macroKeyword' isn't defined for the class 'ClassDeclaration'.
  - 'ClassDeclaration' is from 'package:analyzer/src/dart/ast/ast.dart' ('../../.pub-cache/hosted/pub.dev/analyzer-6.2.0/lib/src/dart/ast/ast.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named …
Run Code Online (Sandbox Code Playgroud)

dart flutter build-runner

11
推荐指数
3
解决办法
1139
查看次数

Unable to load tensorflow tflite model in android studio

I have trained a TensorFlow model and convert it to TensorFlow lite using the below code:

# Convert the model
import tensorflow as tf
import numpy as np
# path to the SavedModel directory is TFLITE_PATH
converter = tf.lite.TFLiteConverter.from_saved_model(TFLITE_PATH) 

tflite_model = converter.convert()

# Save the model.
with open('model_1.tflite', 'wb') as f:
  f.write(tflite_model)
Run Code Online (Sandbox Code Playgroud)

Attaching my model_1.tflite model in case you want to investigate. I have tested it inside my python environment, where it is producing output using the below script:

import …
Run Code Online (Sandbox Code Playgroud)

android dart flutter tensorflow-lite tensorflow2.0

9
推荐指数
0
解决办法
3441
查看次数

“错误:类型‘JSObject’不能用作超类型。” 将 flutter 应用程序部署到 vercel 时

出现错误:类型“JSObject”不能用作超类型。错误,但我没有在代码中的任何地方使用 dart.js,并且无法将我的应用程序部署到 vercel。

在此输入图像描述

以下是我的 pubspec:

name: appname
description: "A new Flutter project."
publish_to: 'none'
version: 0.1.0

environment:
  sdk: '>=3.2.5 <4.0.0'

dependencies:
  flutter:
    sdk: flutter
  get: ^4.6.6
  font_awesome_flutter: ^10.6.0
  http: ^1.2.0
  flutter_dotenv: ^5.1.0
  

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:
  uses-material-design: true

assets:
  - .env
Run Code Online (Sandbox Code Playgroud)

web-applications flutter vercel

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