美文网首页
Flutter笔记

Flutter笔记

作者: 致青春_bf42 | 来源:发表于2020-11-09 11:23 被阅读0次

    一、 as 、 hide 、show

     import 'package:http/http.dart' as http;
    

    as:其中as是为了解决方法名冲突的问题!通过重命名。方法名 调用
    hide:隐藏某个不要导入的方法
    show:只导入某些内容

    二、在pubspec里面的配置

    #项目名称
    name: wechat_flutter_demo
    #项目描述
    description: A new Flutter application.
    
    # The following line prevents the package from being accidentally published to
    # pub.dev using `pub publish`. This is preferred for private packages.
    publish_to: 'none' # Remove this line if you wish to publish to pub.dev
    
    # The following defines the version and build number for your application.
    # A version number is three numbers separated by dots, like 1.2.43
    # followed by an optional build number separated by a +.
    # Both the version and the builder number may be overridden in flutter
    # build by specifying --build-name and --build-number, respectively.
    # In Android, build-name is used as versionName while build-number used as versionCode.
    # Read more about Android versioning at https://developer.android.com/studio/publish/versioning
    # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
    # Read more about iOS versioning at
    # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
    #项目版本号
    version: 1.0.0+1
    
    environment:
      sdk: ">=2.7.0 <3.0.0"
    
    #打包的时候回添加进去,项目第三方插件
    dependencies:
      flutter:
        sdk: flutter
    
    
      # The following adds the Cupertino Icons font to your application.
      # Use with the CupertinoIcons class for iOS style icons.
      cupertino_icons: ^1.0.0
      http: 0.12.2
      dio: ^3.0.9
      # dio: ^3.0.9 ->表示大版本不变的区间写法,相当于'>=3.0.9 < 4.0.0'
      # dio: 3.0.9 -> 指定版本
      # dio: any -> 任意版本
      # dio: ">=3.0.9 <4.0.0" 大于等于 小于
    
    

    相关文章

      网友评论

          本文标题:Flutter笔记

          本文链接:https://www.haomeiwen.com/subject/gnqlbktx.html