commit e0e47278e145ac9f4561bb7eb8bfdf298452a4b5 Author: wangliankun Date: Mon Oct 20 10:34:17 2025 +0800 feat(create):添加库 diff --git a/flutter_common/.gitignore b/flutter_common/.gitignore new file mode 100644 index 0000000..eb6c05c --- /dev/null +++ b/flutter_common/.gitignore @@ -0,0 +1,31 @@ +# Miscellaneous +*.class +*.log +*.pyc +*.swp +.DS_Store +.atom/ +.buildlog/ +.history +.svn/ +migrate_working_dir/ + +# IntelliJ related +*.iml +*.ipr +*.iws +.idea/ + +# The .vscode folder contains launch configuration and tasks you configure in +# VS Code which you may wish to be included in version control, so this line +# is commented out by default. +#.vscode/ + +# Flutter/Dart/Pub related +# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. +/pubspec.lock +**/doc/api/ +.dart_tool/ +.flutter-plugins +.flutter-plugins-dependencies +build/ diff --git a/flutter_common/.metadata b/flutter_common/.metadata new file mode 100644 index 0000000..e5309df --- /dev/null +++ b/flutter_common/.metadata @@ -0,0 +1,10 @@ +# This file tracks properties of this Flutter project. +# Used by Flutter tool to assess capabilities and perform upgrades etc. +# +# This file should be version controlled and should not be manually edited. + +version: + revision: "d8a9f9a52e5af486f80d932e838ee93861ffd863" + channel: "stable" + +project_type: package diff --git a/flutter_common/CHANGELOG.md b/flutter_common/CHANGELOG.md new file mode 100644 index 0000000..41cc7d8 --- /dev/null +++ b/flutter_common/CHANGELOG.md @@ -0,0 +1,3 @@ +## 0.0.1 + +* TODO: Describe initial release. diff --git a/flutter_common/LICENSE b/flutter_common/LICENSE new file mode 100644 index 0000000..ba75c69 --- /dev/null +++ b/flutter_common/LICENSE @@ -0,0 +1 @@ +TODO: Add your license here. diff --git a/flutter_common/README.md b/flutter_common/README.md new file mode 100644 index 0000000..4a260d8 --- /dev/null +++ b/flutter_common/README.md @@ -0,0 +1,39 @@ + + +TODO: Put a short description of the package here that helps potential users +know whether this package might be useful for them. + +## Features + +TODO: List what your package can do. Maybe include images, gifs, or videos. + +## Getting started + +TODO: List prerequisites and provide or point to information on how to +start using the package. + +## Usage + +TODO: Include short and useful examples for package users. Add longer examples +to `/example` folder. + +```dart +const like = 'sample'; +``` + +## Additional information + +TODO: Tell users more about the package: where to find more information, how to +contribute to the package, how to file issues, what response they can expect +from the package authors, and more. diff --git a/flutter_common/analysis_options.yaml b/flutter_common/analysis_options.yaml new file mode 100644 index 0000000..a5744c1 --- /dev/null +++ b/flutter_common/analysis_options.yaml @@ -0,0 +1,4 @@ +include: package:flutter_lints/flutter.yaml + +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/flutter_common/assets/images/noContainer.png b/flutter_common/assets/images/noContainer.png new file mode 100755 index 0000000..5bd8536 Binary files /dev/null and b/flutter_common/assets/images/noContainer.png differ diff --git a/flutter_common/lib/flutter_common.dart b/flutter_common/lib/flutter_common.dart new file mode 100644 index 0000000..298576d --- /dev/null +++ b/flutter_common/lib/flutter_common.dart @@ -0,0 +1,5 @@ +/// A Calculator. +class Calculator { + /// Returns [value] plus 1. + int addOne(int value) => value + 1; +} diff --git a/flutter_common/pubspec.yaml b/flutter_common/pubspec.yaml new file mode 100644 index 0000000..c078659 --- /dev/null +++ b/flutter_common/pubspec.yaml @@ -0,0 +1,82 @@ +name: flutter_common +description: "A new Flutter project." +version: 0.0.1 +homepage: + +environment: + sdk: ^3.6.2 + flutter: ">=1.17.0" + +dependencies: + flutter: + sdk: flutter + + dio: ^5.1.1 + flutter_easyloading: ^3.0.0 + sticky_headers: ^0.3.0+2 #日历需要 + get: ^4.6.5 + flutter_screenutil: ^5.9.0 + flustars_flutter3: ^3.0.0 #工具类 SpUtil,ScreenUtil, DirectoryUtil等等。 + pull_to_refresh: ^2.0.0 + permission_handler: ^12.0.1 + flutter_staggered_grid_view: ^0.7.0 #瀑布流 + image_picker: ^1.1.0 #相册单选 + # images_picker: ^1.2.11 #相册多选 + image_gallery_saver_plus: ^4.0.1 #保存到相册 + photo_view: ^0.15.0 #查看大图 + flutter_widget_from_html_core: ^0.16.0 #html + # flutter_html: ^3.0.0 + transparent_image: ^2.0.1 #图片懒加载 + # flutter_cached_pdfview: ^0.4.3 #pdf文件 + # webview_flutter: ^4.8.0 + video_player: ^2.6.1 #视频 + # perfect_volume_control: ^1.0.5 #声音 + screen_brightness: ^2.1.7 #亮度 + provider: ^6.0.3 + # wakelock: ^0.6.2 + wakelock_plus: ^1.2.5 + url_launcher: ^6.1.10 + flutter_inappwebview: ^6.1.5 + device_info_plus: ^11.3.0 + +dev_dependencies: + flutter_test: + sdk: flutter + flutter_lints: ^5.0.0 + +# 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 packages. +flutter: + + # To add assets to your package, add an assets section, like this: + assets: + - assets/images/ + # - images/a_dot_ham.jpeg + # + # For details regarding assets in packages, see + # https://flutter.dev/to/asset-from-package + # + # An image asset can refer to one or more resolution-specific "variants", see + # https://flutter.dev/to/resolution-aware-images + + # To add custom fonts to your package, 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 in packages, see + # https://flutter.dev/to/font-from-package diff --git a/flutter_common/test/flutter_common_test.dart b/flutter_common/test/flutter_common_test.dart new file mode 100644 index 0000000..e4946b1 --- /dev/null +++ b/flutter_common/test/flutter_common_test.dart @@ -0,0 +1,12 @@ +import 'package:flutter_test/flutter_test.dart'; + +import 'package:flutter_common/flutter_common.dart'; + +void main() { + test('adds one to input values', () { + final calculator = Calculator(); + expect(calculator.addOne(2), 3); + expect(calculator.addOne(-7), -6); + expect(calculator.addOne(0), 1); + }); +}