Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Commit a0eef54

Browse files
committed
feat: Initial commit
0 parents  commit a0eef54

13 files changed

+818
-0
lines changed

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Miscellaneous
2+
*.class
3+
*.log
4+
*.pyc
5+
*.swp
6+
.DS_Store
7+
.atom/
8+
.buildlog/
9+
.history
10+
.svn/
11+
migrate_working_dir/
12+
13+
# IntelliJ related
14+
*.iml
15+
*.ipr
16+
*.iws
17+
.idea/
18+
19+
# The .vscode folder contains launch configuration and tasks you configure in
20+
# VS Code which you may wish to be included in version control, so this line
21+
# is commented out by default.
22+
.vscode/
23+
24+
# Flutter/Dart/Pub related
25+
# Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock.
26+
/pubspec.lock
27+
**/doc/api/
28+
.dart_tool/
29+
.packages
30+
build/
31+
32+
example/android/
33+
example/ios/
34+
example/macos/
35+
example/web/
36+
example/windows/
37+
example/linux/
38+
example/.metadata
39+
example/pubspec.lock

.metadata

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This file tracks properties of this Flutter project.
2+
# Used by Flutter tool to assess capabilities and perform upgrades etc.
3+
#
4+
# This file should be version controlled and should not be manually edited.
5+
6+
version:
7+
revision: 4f9d92fbbdf072a70a70d2179a9f87392b94104c
8+
channel: stable
9+
10+
project_type: package

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
## 0.0.1
2+
3+
* TODO: Describe initial release.

CONTRIBUTING.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# Contributing
2+
First off, thanks for taking the time to contribute! ❤️
3+
4+
All types of contributions are encouraged and valued.
5+
See the [Table of Contents](#table-of-contents) for different ways to help and details about how we handle them.
6+
Please make sure to read the relevant section before making your contribution.
7+
It will make it a lot easier for us maintainers and smooth out the experience for all involved.
8+
Iconica looks forward to your contributions. 🎉
9+
10+
## Table of contents
11+
- [Code of conduct](#code-of-conduct)
12+
- [I Have a Question](#i-have-a-question)
13+
- [I Want To Contribute](#i-want-to-contribute)
14+
- [Reporting Bugs](#reporting-bugs)
15+
- [Contributing code](#contributing-code)
16+
17+
## Code of conduct
18+
19+
### Legal notice
20+
When contributing to this project, you must agree that you have authored 100% of the content, that you have the necessary rights to the content and that the content you contribute may be provided under the project license.
21+
All accepted pull requests and other additions to this project will be considered intellectual property of Iconica.
22+
23+
All repositories should be kept clean of jokes, easter eggs and other unnecessary additions.
24+
25+
## I have a question
26+
27+
If you want to ask a question, we assume that you have read the available documentation found within the code.
28+
Before you ask a question, it is best to search for existing issues that might help you.
29+
In case you have found a suitable issue but still need clarification, you can ask your question
30+
It is also advisable to search the internet for answers first.
31+
32+
If you then still feel the need to ask a question and need clarification, we recommend the following:
33+
34+
- Open an issue.
35+
- Provide as much context as you can about what you're running into.
36+
37+
We will then take care of the issue as soon as possible.
38+
39+
## I want to contribute
40+
41+
### Reporting bugs
42+
43+
<!-- omit in toc -->
44+
**Before submitting a bug report**
45+
46+
A good bug report shouldn't leave others needing to chase you up for more information.
47+
Therefore, we ask you to investigate carefully, collect information and describe the issue in detail in your report.
48+
Please complete the following steps in advance to help us fix any potential bug as fast as possible.
49+
50+
- Make sure that you are using the latest version.
51+
- Determine if your bug is really a bug and not an error on your side e.g. using incompatible environment components/versions (If you are looking for support, you might want to check [this section](#i-have-a-question)).
52+
- To see if other users have experienced (and potentially already solved) the same issue you are having, check if there is not already a bug report existing for your bug or error.
53+
- Also make sure to search the internet (including Stack Overflow) to see if users outside of Iconica have discussed the issue.
54+
- Collect information about the bug:
55+
- Stack trace (Traceback)
56+
- OS, Platform and Version (Windows, Linux, macOS, x86, ARM)
57+
- Version of the interpreter, compiler, SDK, runtime environment, package manager, depending on what seems relevant.
58+
- Time and date of occurance
59+
- Describe the expected result and actual result
60+
- Can you reliably reproduce the issue? And can you also reproduce it with older versions? Describe all steps that lead to the bug.
61+
62+
Once it's filed:
63+
64+
- The project team will label the issue accordingly.
65+
- A team member will try to reproduce the issue with your provided steps.
66+
If there are no reproduction steps or no obvious way to reproduce the issue, the team will ask you for additional information.
67+
- If the team is able to reproduce the issue, it will be moved into the backlog, as well as marked with a priority, and the issue will be left to be [implemented by someone](#contributing-code).
68+
69+
### Contributing code
70+
71+
When you start working on your contribution, make sure you are aware of the relevant documentation and the functionality of the component you are working on.
72+
73+
When writing code, follow the style guidelines set by Dart: [Effective Dart](https://Dart.dev/guides/language/effective-Dart). This contains most information you will need to write clean Dart code that is well documented.
74+
75+
**Documentation**
76+
77+
As Effective Dart indicates, documenting your public methods with Dart doc comments is recommended.
78+
Aside from Effective Dart, we require specific information in the documentation of a method:
79+
80+
At the very least, your documentation should first name what the code does, then followed below by requirements for calling the method, the result of the method.
81+
Any references to internal variables or other methods should be done through [var] to indicate a reference.
82+
83+
If the method or class is complex enough (determined by the reviewers) an example is required.
84+
If unsure, add an example in the docs using code blocks.
85+
86+
For classes and methods, document the individual parameters with their implications.
87+
88+
> Tip: Remember that the shortest documentation can be written by having good descriptive names in the first place.
89+
90+
An example:
91+
```Dart
92+
library iconica_utilities.bidirectional_sorter;
93+
94+
part 'sorter.Dart';
95+
part 'enum.Dart';
96+
97+
/// Generic sort method, allow sorting of list with primitives or complex types.
98+
/// Uses [SortDirection] to determine the direction, either Ascending or Descending,
99+
/// Gets called on [List] toSort of type [T] which cannot be shorter than 2.
100+
/// Optionally for complex types a [Comparable] [Function] can be given to compare complex types.
101+
/// ```
102+
/// List<TestObject> objects = [];
103+
/// for (int i = 0; i < 10; i++) {
104+
/// objects.add(TestObject(name: "name", id: i));
105+
/// }
106+
///
107+
/// sort<TestObject>(
108+
/// SortDirection.descending, objects, (object) => object.id);
109+
///
110+
/// ```
111+
/// In the above example a list of TestObjects is created, and then sorted in descending order.
112+
/// If the implementation of TestObject is as following:
113+
/// ```
114+
/// class TestObject {
115+
/// final String name;
116+
/// final int id;
117+
///
118+
/// TestObject({required this.name, required this.id});
119+
/// }
120+
/// ```
121+
/// And the list is logged to the console, the following will appear:
122+
/// ```
123+
/// [name9, name8, name7, name6, name5, name4, name3, name2, name1, name0]
124+
/// ```
125+
126+
void sort<T>(
127+
/// Determines the sorting direction, can be either Ascending or Descending
128+
SortDirection sortDirection,
129+
130+
/// Incoming list, which gets sorted
131+
List<T> toSort, [
132+
133+
/// Optional comparable, which is only necessary for complex types
134+
SortFieldGetter<T>? sortValueCallback,
135+
]) {
136+
if (toSort.length < 2) return;
137+
assert(
138+
toSort.whereType<Comparable>().isNotEmpty || sortValueCallback != null);
139+
BidirectionalSorter<T>(
140+
sortInstructions: <SortInstruction<T>>[
141+
SortInstruction(
142+
sortValueCallback ?? (t) => t as Comparable, sortDirection),
143+
],
144+
).sort(toSort);
145+
}
146+
147+
/// same functionality as [sort] but with the added functionality
148+
/// of sorting multiple values
149+
void sortMulti<T>(
150+
/// Incoming list, which gets sorted
151+
List<T> toSort,
152+
153+
/// list of comparables to sort multiple values at once,
154+
/// priority based on index
155+
List<SortInstruction<T>> sortValueCallbacks,
156+
) {
157+
if (toSort.length < 2) return;
158+
assert(sortValueCallbacks.isNotEmpty);
159+
BidirectionalSorter<T>(
160+
sortInstructions: sortValueCallbacks,
161+
).sort(toSort);
162+
}
163+
164+
```
165+
166+
167+
168+
**Tests**
169+
170+
For each public method that was created, excluding widgets, which contains any form of logic (e.g. Calculations, predicates or major side-effects) tests are required.
171+
172+
A set of tests is written for each method, covering at least each path within the method. For example:
173+
174+
```Dart
175+
void foo() {
176+
try {
177+
var bar = doSomething();
178+
if (bar) {
179+
doSomethingElse();
180+
} else {
181+
doSomethingCool();
182+
}
183+
} catch (_) {
184+
displayError();
185+
}
186+
}
187+
```
188+
The method above should result in 3 tests:
189+
190+
1. A test for the path leading to displayError by the cause of an exception
191+
2. A test for if bar is true, resulting in doSomethingElse()
192+
3. A test for if bar is false, resulting in the doSomethingCool() method being called.
193+
194+
This means that we require 100% coverage of each method you test.

README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
[![pub package](https://img.shields.io/pub/v/[PACKAGE NAME ON PUB].svg)](https://github.com/Iconica-Development) [![Build status](URL TO REPO)](URL TO GITHUB ACTIONS) [![style: effective dart](https://img.shields.io/badge/style-effective_dart-40c4ff.svg)](https://github.com/tenhobi/effective_dart)
2+
3+
Short description of what your package is, why you created it. What issues it fixes and how it works. Also mention the available platforms
4+
5+
## Setup
6+
7+
What setup steps are neccesarry and why>
8+
9+
<details>
10+
<summary>PLATFORM</summary>
11+
12+
specific platform steps
13+
14+
</details>
15+
16+
## How to use
17+
18+
How can we use the package descibe the most common ways with examples in
19+
```dart
20+
codeblocks
21+
```
22+
23+
## Issues
24+
25+
Please file any issues, bugs or feature request as an issue on our [GitHub](https://github.com/Iconica-Development/flutter_introduction_widget) page. Commercial support is available if you need help with integration with your app or services. You can contact us at [support@iconica.nl](mailto:support@iconica.nl).
26+
27+
## Want to contribute
28+
29+
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our [contribution guide](./CONTRIBUTING.md) and send us your [pull request](https://github.com/Iconica-Development/flutter_introduction_widget/pulls).
30+
31+
## Author
32+
33+
This flutter_introduction_widget for Flutter is developed by [Iconica](https://iconica.nl). You can contact us at <support@iconica.nl>

0 commit comments

Comments
 (0)