dart import的各种方式


import几种方式:

import 'package:flutter/material.dart';  这种package后不是跟工程名字的,表示自定义的dart文件
import 'package:xxx/xxx.dart'; 引入Pub仓库pub.dev(或者pub.flutter-io.cn)中的第三方库
import 'dart:xxx'; 引入Dart标准库
  • import 'xxx' show compute1,compute2 只导入compute1,compute2
  • import 'xxx' hide compute3 除了compute都引入
  • import 'xxx' as compute4 将库重命名,当有名字冲突时
  • library compute5; 定义库名称
  • part of compute6; 表示文件属于某个


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM