pub package all in one

best practice

The pubspec file

https://dart.dev/tools/pub/pubspec

demo

name: dart_library_package
# name: dart-library-package
description: A dart-library-package for Flutter application. homepage: https://github.com/xgqfrms/dart-library-package # 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.2 environment:
sdk: ">=2.7.0 <3.0.0" dependencies:
# flutter:
# sdk: flutter
async: ^2.0.7
path: ^1.0.0 # The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
# cupertino_icons: ^0.1.3 dev_dependencies:
# flutter_test:
# sdk: flutter
test: ^1.3.4 # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # The following section is specific to Flutter.
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:
- images/icon.png
# - images/a_dot_burr.jpeg
# - images/a_dot_ham.jpeg # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # For details regarding adding assets from package dependencies, see
# https://flutter.dev/assets-and-images/#from-packages # To add custom fonts to your application, add a fonts section here,
# in this "flutter" section. Each entry in this list should have a
# "family" key with the font family name, and a "fonts" key with a
# list giving the asset and other descriptors for the font. For
# example:
# fonts:
# - family: Schyler
# fonts:
# - asset: fonts/Schyler-Regular.ttf
# - asset: fonts/Schyler-Italic.ttf
# style: italic
# - family: Trajan Pro
# fonts:
# - asset: fonts/TrajanPro.ttf
# - asset: fonts/TrajanPro_Bold.ttf
# weight: 700
#
# For details regarding fonts from package dependencies,
# see https://flutter.dev/custom-fonts/#from-packages

dart_library_package score

https://pub.dev/packages/dart_library_package/score

0/10 points: Provide a valid pubspec.yaml

The package description is too short.

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

description: A dart-library-package for Flutter application. full platform support, including `package:dart_library_package/math.dart`, `package:dart_library_package/math_io.dart`, `package:dart_library_package/math_html.dart`

0/10 points: 20% or more of the public API has dartdoc comments

0 out of 7 API elements (0.0 %) have documentation comments.

Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API. Document at least 20% of the public API elements.

Support multiple platforms

10/20 points: Supports 1 of 2 possible platforms (native, js)

Consider supporting multiple platforms:

Package not compatible with runtime js

Because:

package:dart_library_package/math_io.dart that imports:

dart:io

Pass static analysis

20/30 points: code has no errors, warnings, lints, or formatting issues

Found 13 issues. Showing the first 2:

INFO: Unused import: 'dart:io'.

lib/math_io.dart:13:8



13 │ import 'dart:io';

│ ^^^^^^^^^



To reproduce make sure you are using pedantic and run dartanalyzer lib/math_io.dart

lib/math.dart is not formatted according to dartfmt

To format your files run: dartfmt -w .

refs



xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


pub package all in one的更多相关文章

  1. Dependabot 开始支持 pub package 版本检测

    今年年初,我们发布了 Flutter 2022 产品路线图,其中「基础设施建设」这部分提到:2022 年 Flutter 团队将增加对供应链的安全的投入,目的是达到符合基础设施 SLSA 4 级别中描 ...

  2. Dart 基础重点截取 Dart 2 20180417

    官网教程 https://www.dartlang.org/guides/language/language-tour dart是一个单线程的语言,没有多线程 Final and const If y ...

  3. CentOS6.8环境下搭建yum网络仓库

    CentOS6.8环境下搭建yum网络仓库 本文利用ftp服务,在CentOS6.8系统下搭建一个yum仓库,然后用另一台虚拟机访问该仓库.并安装程序包 安装ftp服务 查询ftp服务是否安装 [ro ...

  4. 9.Libraries and visibility 库和可见性

    import和liabrary指令可以帮助你创建模块化,可复用的代码.库不仅仅提供API,也是一个私有化单元:库中已下划线(_)开头的类都是对外不可访问的.每个Dart的应用也是一个包,尽管它没有使用 ...

  5. Fedora 26/27/28网易云音乐安装

    信息从 https://www.southcity-oldboy.com/1474.html获取,感谢站长南城旧少年! 以下为前辈网页上的内容 1.安装 RPM Fusion 源 (free): ht ...

  6. Fedora 28 系统基础配置以及常用软件安装方式

    实验说明: 很多人说Linux很难用,很难上手,其实不然,倘若不玩游戏,其实很多发行版Linux都可以成为主力系统,就比如本章要讲的 Fedora 28.本章会从镜像来源.系统安装.基础配置和常用软件 ...

  7. Dart语法学习

    Dart语法学习 目录 参考资料 语言特性 关键字 变量与常量 数据类型 运算符 operators 控制流程语句 异常 Exceptions 函数 Function 类 Class 类-方法 类-抽 ...

  8. Dart 学习

    语言特性 Dart所有的东西都是对象, 即使是数字numbers.函数function.null也都是对象,所有的对象都继承自Object类. Dart动态类型语言, 尽量给变量定义一个类型,会更安全 ...

  9. Dart 2.15 现已发布

    作者 / Michael Thomsen, Dart & Flutter Product Manager, Google 我们已经正式发布了 Dart SDK 的 2.15 版本,该版本新增了 ...

随机推荐

  1. 为什么 TCP 协议有粘包问题

    为什么 TCP 协议有粘包问题 这部分转载自draveness博客. TCP/IP 协议簇建立了互联网中通信协议的概念模型,该协议簇中的两个主要协议就是 TCP 和 IP 协议.TCP/ IP 协议簇 ...

  2. 策略模式 VS 状态模式

    策略模式 VS 状态模式 策略模式 VS 状态模式 | 菜鸟教程 https://www.runoob.com/w3cnote/state-vs-strategy.html

  3. socket 的使用

    基于TCP协议的socket tcp是基于链接的,必须先启动服务端,然后再启动客户端去链接服务端 server端 import socket sk = socket.socket() sk.bind( ...

  4. Language Guide (proto3) | proto3 语言指南(十三)JSON映射

    JSON Mapping - JSON映射 Proto3支持JSON中的规范编码,使得在系统之间共享数据更加容易.下表按类型对编码进行了描述. 如果JSON编码的数据中缺少一个值或者它的值为null, ...

  5. 一:优化Docker中的Spring Boot应用:单层镜像方法

    优化Docker中的Spring Boot应用:单层镜像方法 1.Docker关键概念 2.镜像层内容很重要 3.镜像层影响部署 4.Docker中的Spring Boot应用 5.单层方法 5.1 ...

  6. 向数据库添加100W 条数据 性能测试

    向数据库添加100W 条数据 性能测试 : 参考的相关网站目录: JDBC实现往MySQL插入百万级数据 https://www.cnblogs.com/fnz0/p/5713102.html MyS ...

  7. DEDECMS:DEDE整合(UEditor)百度编辑器以后,栏目内容、单页无法保存内容的bug处理方法

    已经整合过百度编辑器的站长们或许会发现,在编辑单页文档和栏目内容的时候,百度编辑器不能够保存新增或已修改数据,经过排查后发现问题出现在catalog_edit.htm.catalog_add.htm这 ...

  8. CCF CSP 202012-2 期末预测之最佳阈值

    202012-2 期末预测之最佳阈值 题目背景 考虑到安全指数是一个较大范围内的整数.小菜很可能搞不清楚自己是否真的安全,顿顿决定设置一个阈值 θ,以便将安全指数 y 转化为一个具体的预测结果--&q ...

  9. 深入理解Js中的this

    深入理解Js中的this JavaScript作用域为静态作用域static scope,但是在Js中的this却是一个例外,this的指向问题就类似于动态作用域,其并不关心函数和作用域是如何声明以及 ...

  10. 【算法】数据结构与算法基础总览(中)——刷Leetcode等算法题时一些很实用的jdk辅助方法锦集

    最近重新学习数据结构与算法以及刷leetcode算法题时,发现不少jdk自带的方法可以提升刷题的效率.这些小技巧不仅仅对刷算法题带来便利,对我们平时开发也是很有帮助的.本文以java语言为基础,记录了 ...