From 7f71c40d7bb8aecf196146aed18191b2f86957c2 Mon Sep 17 00:00:00 2001 From: Hamidreza Bayat Date: Sat, 30 Apr 2022 07:19:46 +0430 Subject: [PATCH] Add dart project --- source/dart/.gitignore | 10 ++++++ source/dart/CHANGELOG.md | 3 ++ source/dart/README.md | 39 ++++++++++++++++++++++ source/dart/analysis_options.yaml | 30 +++++++++++++++++ source/dart/example/astronomy_example.dart | 6 ++++ source/dart/lib/astronomy.dart | 8 +++++ source/dart/lib/src/astronomy_base.dart | 6 ++++ source/dart/pubspec.yaml | 15 +++++++++ source/dart/test/astronomy_test.dart | 16 +++++++++ 9 files changed, 133 insertions(+) create mode 100644 source/dart/.gitignore create mode 100644 source/dart/CHANGELOG.md create mode 100644 source/dart/README.md create mode 100644 source/dart/analysis_options.yaml create mode 100644 source/dart/example/astronomy_example.dart create mode 100644 source/dart/lib/astronomy.dart create mode 100644 source/dart/lib/src/astronomy_base.dart create mode 100644 source/dart/pubspec.yaml create mode 100644 source/dart/test/astronomy_test.dart diff --git a/source/dart/.gitignore b/source/dart/.gitignore new file mode 100644 index 00000000..65c34dc8 --- /dev/null +++ b/source/dart/.gitignore @@ -0,0 +1,10 @@ +# Files and directories created by pub. +.dart_tool/ +.packages + +# Conventional directory for build outputs. +build/ + +# Omit committing pubspec.lock for library packages; see +# https://dart.dev/guides/libraries/private-files#pubspeclock. +pubspec.lock diff --git a/source/dart/CHANGELOG.md b/source/dart/CHANGELOG.md new file mode 100644 index 00000000..effe43c8 --- /dev/null +++ b/source/dart/CHANGELOG.md @@ -0,0 +1,3 @@ +## 1.0.0 + +- Initial version. diff --git a/source/dart/README.md b/source/dart/README.md new file mode 100644 index 00000000..8b55e735 --- /dev/null +++ b/source/dart/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/source/dart/analysis_options.yaml b/source/dart/analysis_options.yaml new file mode 100644 index 00000000..dee8927a --- /dev/null +++ b/source/dart/analysis_options.yaml @@ -0,0 +1,30 @@ +# This file configures the static analysis results for your project (errors, +# warnings, and lints). +# +# This enables the 'recommended' set of lints from `package:lints`. +# This set helps identify many issues that may lead to problems when running +# or consuming Dart code, and enforces writing Dart using a single, idiomatic +# style and format. +# +# If you want a smaller set of lints you can change this to specify +# 'package:lints/core.yaml'. These are just the most critical lints +# (the recommended set includes the core lints). +# The core lints are also what is used by pub.dev for scoring packages. + +include: package:lints/recommended.yaml + +# Uncomment the following section to specify additional rules. + +# linter: +# rules: +# - camel_case_types + +# analyzer: +# exclude: +# - path/to/excluded/files/** + +# For more information about the core and recommended set of lints, see +# https://dart.dev/go/core-lints + +# For additional information about configuring this file, see +# https://dart.dev/guides/language/analysis-options diff --git a/source/dart/example/astronomy_example.dart b/source/dart/example/astronomy_example.dart new file mode 100644 index 00000000..e794846b --- /dev/null +++ b/source/dart/example/astronomy_example.dart @@ -0,0 +1,6 @@ +import 'package:astronomy/astronomy.dart'; + +void main() { + var awesome = Awesome(); + print('awesome: ${awesome.isAwesome}'); +} diff --git a/source/dart/lib/astronomy.dart b/source/dart/lib/astronomy.dart new file mode 100644 index 00000000..3f11c7d9 --- /dev/null +++ b/source/dart/lib/astronomy.dart @@ -0,0 +1,8 @@ +/// Support for doing something awesome. +/// +/// More dartdocs go here. +library astronomy; + +export 'src/astronomy_base.dart'; + +// TODO: Export any libraries intended for clients of this package. diff --git a/source/dart/lib/src/astronomy_base.dart b/source/dart/lib/src/astronomy_base.dart new file mode 100644 index 00000000..e8a6f159 --- /dev/null +++ b/source/dart/lib/src/astronomy_base.dart @@ -0,0 +1,6 @@ +// TODO: Put public facing types in this file. + +/// Checks if you are awesome. Spoiler: you are. +class Awesome { + bool get isAwesome => true; +} diff --git a/source/dart/pubspec.yaml b/source/dart/pubspec.yaml new file mode 100644 index 00000000..296cb8b5 --- /dev/null +++ b/source/dart/pubspec.yaml @@ -0,0 +1,15 @@ +name: astronomy +description: A starting point for Dart libraries or applications. +version: 1.0.0 +# homepage: https://www.example.com + +environment: + sdk: '>=2.16.2 <3.0.0' + + +# dependencies: +# path: ^1.8.0 + +dev_dependencies: + lints: ^1.0.0 + test: ^1.16.0 diff --git a/source/dart/test/astronomy_test.dart b/source/dart/test/astronomy_test.dart new file mode 100644 index 00000000..33da90bd --- /dev/null +++ b/source/dart/test/astronomy_test.dart @@ -0,0 +1,16 @@ +import 'package:astronomy/astronomy.dart'; +import 'package:test/test.dart'; + +void main() { + group('A group of tests', () { + final awesome = Awesome(); + + setUp(() { + // Additional setup goes here. + }); + + test('First Test', () { + expect(awesome.isAwesome, isTrue); + }); + }); +}