flutter-基本功能总结

发布时间:2024年01月16日

一、启动图标设置

flutter_launcher_icons | Dart Packageflutter_launcher_icons

flutter_launcher_icons | Dart Package

flutter pub run flutter_launcher_icons

二、使用get库

get | Flutter Package

三、静态资源处理

使用?flutter_gen配置本地静态资源

flutter_gen | Dart Package

颜色xml 需要父级包裹

<colors>
    <color name="milk_tea">#F5CB84</color>
    <color name="cinnamon" type="material">#955E1C</color>
    <color name="yellow_ocher" type="material material-accent">#DF9527</color>
</colors>

新增配置

flutter_launcher_icons: # flutter pub run flutter_launcher_icons
  android: "launcher_icon"
  ios: true
  image_path: "assets/icon/icon.png"
  min_sdk_android: 21 # android min sdk min:16, default 21


flutter_gen:
  output: lib/gen/ # Optional (default: lib/gen/)
  line_length: 80 # Optional (default: 80)

  # Optional
  integrations:
    flutter_svg: true
    flare_flutter: true
    rive: true
    lottie: true

  colors:
    inputs:
      - assets/color/colors.xml

注意 flutter 下还需要指明assets的路径

flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true

  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/image/
    - assets/icon/

四、不同屏幕之间的尺寸适配

flutter_screenutil

flutter_screenutil | Flutter Package

https://github.com/OpenFlutter/flutter_screenutil/blob/master/README_CN.md

三、权限管理

四、

六、网络检查

dart-ping包

dart_ping | Dart Package

文章来源:https://blog.csdn.net/weixin_43575775/article/details/131487223
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。