flutter_common 0.5.0
Flutter Common #
include common Utils and Widgets
Utils #
1. CommonApp #
get app info, like: label, packageName, versionName, versionCode
2. CommonCrypto #
- toMd5() : MD5加密
- encodeB64() : Base64编码
- decodeB64() : Base64解码
- aesEncrypt() : AES加密
- aesDecrypt() : AES解密
3. CommonDevice #
- model() : 型号
- releaseVersion() : 固件版本
- identifier() : 设备Id
3. CommonFile #
- strSize() : 格式化显示文件大小
4. CommonSp #
使用shared_preferences进行轻量数据存取
- getInt() : 通过key 获取int 数据
- putInt() : 储存int 数据
5. CommonSystem #
- copyToClipboard() : copy文本到剪贴板
- screenWidth() : 获取当前设备屏幕宽度
- screenHeight() : 获取当前设备屏幕高度
- statusBarHeight() : 获取当前设备屏幕状态栏高度
6. CommonTime #
- currentMillisecondsTimeStamp() : 获取当前时间的毫秒时间戳
- currentTimeStamp() : 获取当前时间的秒时间戳
- parseDateTimeStr() : 将指定格式字符转换为Date
- dateTimeToStr() : 将Date转换为指定格式字符中
- timeStampToStr() : 将指定时间戳转换为时间字符串
- timeStampToStrWrapped() : 将指定时间戳转换为标准格式字符串
- diffDays() : 计算2个date之间相差的天数
7. CommonColor #
- fromStr() : 根据不同字符串生成不同颜色
Widgets #
1. loading view #
2. network image view #
3. file selector #
4. bottom menu #
5. bottom modal #
6. dialog #
[0.0.1] - 2019.07.04
- initial release.
[0.0.2] - 2019.07.09
- add common widget.
[0.0.3] - 2019.07.09
- update example.
[0.0.4] - 2019.07.09
- update common sp.
[0.0.5] - 2019.07.11
- add common arc clip.
[0.0.6] - 2019.07.11
- update common arc clip.
[0.0.7] - 2019.07.11
- update common arc clip.
[0.0.8] - 2019.07.11
- add common load more view.
[0.0.9] - 2019.07.11
- update common load more view.
[0.1.0] - 2019.07.11
- add common web view.
[0.1.1] - 2019.07.11
- update common web view.
[0.1.2] - 2019.07.11
- add common slide view.
[0.1.3] - 2019.07.11
- update common slide view.
- add common launch.
[0.1.4] - 2019.07.11
- update common web view.
[0.1.5] - 2019.07.12
- update common load more view.
[0.1.6] - 2019.07.12
- update common list filter.
[0.1.7] - 2019.07.12
- update common sp, setXXX change to putXXX.
[0.1.8] - 2019.07.12
- add common log
[0.1.9] - 2019.07.12
- update common log
[0.2.0] - 2019.07.12
- add common nav
[0.2.2] - 2019.07.12
- update common biometrics
[0.2.3] - 2019.07.31
- update common time
[0.2.4] - 2019.08.05
- update common time
[0.2.5] - 2019.08.08
- update common list menu
[0.2.6] - 2019.08.23
- update common list menu
[0.2.7] - 2019.08.26
- update common list menu
[0.2.8] - 2019.08.26
- update common log
[0.2.9] - 2019.08.29
- update common list menu
[0.3.0] - 2019.08.29
- update common slide view
[0.3.1] - 2019.09.24
- add CommonNavigatorBar
[0.3.2] - 2019.09.24
- update dependencies
[0.3.3] - 2019.09.26
- update dependencies
[0.3.4] - 2019.09.26
- update dependencies
[0.3.5] - 2019.09.26
- update common device
[0.3.6] - 2019.09.30
- update common web view
[0.3.7] - 2019.10.12
- update common list menu
[0.3.8] - 2019.10.14
- update dependencies
[0.3.9] - 2019.10.15
- update common network image view
[0.4.0] - 2019.10.15
- update common network image view
[0.4.1] - 2019.10.15
- update common network image view
[0.4.2] - 2019.10.16
- add common toast
[0.4.3] - 2019.10.16
- update common toast
[0.4.4] - 2019.10.16
- update common toast
[0.4.5] - 2019.10.16
- update common web view
[0.4.6] - 2019.10.16
- update common slide view
[0.4.7] - 2019.10.16
- update common network image view
[0.4.8] - 2019.12.05
- add common network
[0.4.9] - 2019.12.05
- update local translations
[0.5.0] - 2019.12.05
- update dependencies
Use this package as a library
1. Depend on it
Add this to your package's pubspec.yaml file:
dependencies:
flutter_common: ^0.5.0
2. Install it
You can install packages from the command line:
with Flutter:
$ flutter pub get
Alternatively, your editor might support flutter pub get
.
Check the docs for your editor to learn more.
3. Import it
Now in your Dart code, you can use:
import 'package:flutter_common/flutter_common.dart';
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
60
|
Health:
Code health derived from static analysis.
[more]
|
99
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
40
|
Overall:
Weighted score of the above.
[more]
|
68
|
We analyzed this package on Dec 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
- Dart: 2.6.1
- pana: 0.12.21
- Flutter: 1.9.1+hotfix.6
Platforms
Detected platforms: Flutter
References Flutter, and has no conflicting libraries.
Health suggestions
Fix lib/common/common_log.dart
. (-0.50 points)
Analysis of lib/common/common_log.dart
reported 1 hint:
line 4 col 8: Unused import: 'package:logger/logger.dart'.
Fix lib/widget/page_screenshotable.dart
. (-0.50 points)
Analysis of lib/widget/page_screenshotable.dart
reported 1 hint:
line 24 col 21: The declaration '_capture' isn't referenced.
Format lib/common/common_app.dart
.
Run flutter format
to format lib/common/common_app.dart
.
Fix additional 33 files with analysis or formatting issues.
Additional issues in the following files:
lib/common/common_aspect_ratio.dart
(Runflutter format
to formatlib/common/common_aspect_ratio.dart
.)lib/common/common_biometrics.dart
(Runflutter format
to formatlib/common/common_biometrics.dart
.)lib/common/common_color.dart
(Runflutter format
to formatlib/common/common_color.dart
.)lib/common/common_crypto.dart
(Runflutter format
to formatlib/common/common_crypto.dart
.)lib/common/common_device.dart
(Runflutter format
to formatlib/common/common_device.dart
.)lib/common/common_file.dart
(Runflutter format
to formatlib/common/common_file.dart
.)lib/common/common_http.dart
(Runflutter format
to formatlib/common/common_http.dart
.)lib/common/common_launch.dart
(Runflutter format
to formatlib/common/common_launch.dart
.)lib/common/common_nav.dart
(Runflutter format
to formatlib/common/common_nav.dart
.)lib/common/common_network.dart
(Runflutter format
to formatlib/common/common_network.dart
.)lib/common/common_sp.dart
(Runflutter format
to formatlib/common/common_sp.dart
.)lib/common/common_system.dart
(Runflutter format
to formatlib/common/common_system.dart
.)lib/common/common_time.dart
(Runflutter format
to formatlib/common/common_time.dart
.)lib/common_constant.dart
(Runflutter format
to formatlib/common_constant.dart
.)lib/flutter_common.dart
(Runflutter format
to formatlib/flutter_common.dart
.)lib/generated/i18n.dart
(Runflutter format
to formatlib/generated/i18n.dart
.)lib/locale/translations.dart
(Runflutter format
to formatlib/locale/translations.dart
.)lib/widget/common_arc_clip.dart
(Runflutter format
to formatlib/widget/common_arc_clip.dart
.)lib/widget/common_bottom_menu.dart
(Runflutter format
to formatlib/widget/common_bottom_menu.dart
.)lib/widget/common_bottom_modal.dart
(Runflutter format
to formatlib/widget/common_bottom_modal.dart
.)lib/widget/common_dialog.dart
(Runflutter format
to formatlib/widget/common_dialog.dart
.)lib/widget/common_file_selector.dart
(Runflutter format
to formatlib/widget/common_file_selector.dart
.)lib/widget/common_list_filter.dart
(Runflutter format
to formatlib/widget/common_list_filter.dart
.)lib/widget/common_list_menu.dart
(Runflutter format
to formatlib/widget/common_list_menu.dart
.)lib/widget/common_load_more_view.dart
(Runflutter format
to formatlib/widget/common_load_more_view.dart
.)lib/widget/common_loading_view.dart
(Runflutter format
to formatlib/widget/common_loading_view.dart
.)lib/widget/common_navigator_bar.dart
(Runflutter format
to formatlib/widget/common_navigator_bar.dart
.)lib/widget/common_network_image_view.dart
(Runflutter format
to formatlib/widget/common_network_image_view.dart
.)lib/widget/common_slide_view.dart
(Runflutter format
to formatlib/widget/common_slide_view.dart
.)lib/widget/common_toast.dart
(Runflutter format
to formatlib/widget/common_toast.dart
.)lib/widget/common_web_view.dart
(Runflutter format
to formatlib/widget/common_web_view.dart
.)lib/widget/page_screenshot.dart
(Runflutter format
to formatlib/widget/page_screenshot.dart
.)lib/widget/page_t1.dart
(Runflutter format
to formatlib/widget/page_t1.dart
.)
Maintenance issues and suggestions
Support latest dependencies. (-30 points)
The version constraint in pubspec.yaml
does not support the latest published versions for 3 dependencies (cached_network_image
, intl
, rxdart
).
The package description is too short. (-20 points)
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.
Maintain an example. (-10 points)
Create a short demo in the example/
directory to show how to use this package.
Common filename patterns include main.dart
, example.dart
, and flutter_common.dart
. Packages with multiple examples should provide example/README.md
.
For more information see the pub package layout conventions.
Dependencies
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=2.1.0 <3.0.0 | ||
cached_network_image | ^1.1.3 | 1.1.3 | 2.0.0-rc.1 |
connectivity | ^0.4.5+7 | 0.4.6 | |
crypto | ^2.1.3 | 2.1.4 | |
cupertino_icons | ^0.1.2 | 0.1.3 | |
device_info | ^0.4.1+3 | 0.4.1+3 | |
dio | ^3.0.7 | 3.0.7 | |
encrypt | ^3.3.1 | 3.3.1 | |
flutter | 0.0.0 | ||
flutter_localizations | 0.0.0 | ||
flutter_slidable | ^0.5.4 | 0.5.4 | |
fluttertoast | ^3.1.3 | 3.1.3 | |
intl | ^0.15.8 | 0.15.8 | 0.16.0 |
json_annotation | ^3.0.0 | 3.0.0 | |
local_auth | ^0.6.1 | 0.6.1 | |
logger | ^0.7.0+2 | 0.7.0+2 | |
package_info | ^0.4.0+12 | 0.4.0+12 | |
path | ^1.6.4 | 1.6.4 | |
path_provider | ^1.4.5 | 1.5.0 | |
provide | ^1.0.2 | 1.0.2 | |
rxdart | ^0.22.6 | 0.22.6 | 0.23.0-dev.2 |
screen | ^0.0.5 | 0.0.5 | |
share | ^0.6.3+4 | 0.6.3+4 | |
shared_preferences | ^0.5.4+8 | 0.5.4+8 | |
sqflite | ^1.1.7+3 | 1.1.7+3 | |
url_launcher | ^5.2.7 | 5.2.7 | |
webview_flutter | ^0.3.17 | 0.3.17 | |
Transitive dependencies | |||
args | 1.5.2 | ||
asn1lib | 0.5.14 | ||
async | 2.4.0 | ||
charcode | 1.1.2 | ||
clock | 1.0.1 | ||
collection | 1.14.11 | 1.14.12 | |
convert | 2.1.1 | ||
flutter_cache_manager | 1.1.3 | ||
http | 0.12.0+2 | ||
http_parser | 3.1.3 | ||
meta | 1.1.7 | 1.1.8 | |
pedantic | 1.9.0 | ||
platform | 2.2.1 | ||
pointycastle | 1.0.2 | ||
shared_preferences_platform_interface | 1.0.0 | ||
sky_engine | 0.0.99 | ||
source_span | 1.5.5 | ||
string_scanner | 1.0.5 | ||
synchronized | 2.1.1 | ||
term_glyph | 1.1.0 | ||
typed_data | 1.1.6 | ||
url_launcher_platform_interface | 1.0.1 | ||
uuid | 2.0.4 | ||
vector_math | 2.0.8 | ||
Dev dependencies | |||
build_runner | ^1.0.0 | ||
flutter_test | |||
json_serializable | ^3.0.0 |