Skip to content

Commit 96dde4a

Browse files
chore: 🔨 Docs updates and Code improvement
- Updated CONTRIBUTING.md and fixed the link in pull_request_template.md - Fixed link for build status in README.md - Added topics in README.md - Removed inactive contributors from README.md - Fixed incorrect import in credit_card_form.dart.
1 parent 19160cb commit 96dde4a

File tree

7 files changed

+185
-21
lines changed

7 files changed

+185
-21
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@ Closes #1234
4545
!-->
4646

4747
<!-- Links -->
48-
[Contributor Guide]: https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/blob/master/CONTRIBUTING.md
48+
[Contributor Guide]: https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/blob/master/CONTRIBUTING.md
4949
[Conventional Commit]: https://conventionalcommits.org

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# [4.0.2](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.0.2)
1+
# [4.1.0](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.1.0)
22

33
- Fixed floating event stream bad state exception [#157](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/157).
44
- Fixed Gyroscope initialization issue [#173](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/173).

CONTRIBUTING.md

Lines changed: 168 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,168 @@
1-
# Way to contribute
2-
3-
1. Fork the repo and create your branch from `master`.
4-
2. Clone the project to your own machine.
5-
3. Commit changes to your own branch
6-
4. Make sure your code lints.
7-
5. Push your work back up to your fork.
8-
6. Issue that pull request!
1+
# Contribution Guidelines
2+
3+
**Note:** If these contribution guidelines are not followed your issue or PR might be closed, so
4+
please read these instructions carefully.
5+
6+
## Contribution types
7+
8+
9+
### Bug Reports
10+
11+
- If you find a bug, please first report it using [Github issues].
12+
- First check if there is not already an issue for it; duplicated issues will be closed.
13+
14+
15+
### Bug Fix
16+
17+
- If you'd like to submit a fix for a bug, please read the [How To](#how-to-contribute) for how to
18+
send a Pull Request.
19+
- Indicate on the open issue that you are working on fixing the bug and the issue will be assigned
20+
to you.
21+
- Write `Fixes #xxxx` in your PR text, where xxxx is the issue number (if there is one).
22+
- Include a test that isolates the bug and verifies that it was fixed.
23+
24+
25+
### New Features
26+
27+
- If you'd like to add a feature to the library that doesn't already exist, feel free to describe
28+
the feature in a new [GitHub issue][GitHub issues].
29+
- If you'd like to implement the new feature, please wait for feedback from the library maintainers
30+
before spending too much time writing the code. In some cases, enhancements may not align well
31+
with the library's future development direction.
32+
- Implement the code for the new feature and please read the [How To](#how-to-contribute).
33+
34+
35+
### Documentation & Miscellaneous
36+
37+
- If you have suggestions for improvements to the documentation, tutorial or examples (or something
38+
else), we would love to hear about it.
39+
- As always first file a [Github issue][GitHub issues].
40+
- Implement the changes to the documentation, please read the [How To](#how-to-contribute).
41+
42+
43+
## How To Contribute
44+
45+
46+
### Requirements
47+
48+
For a contribution to be accepted:
49+
50+
- Follow the [Style Guide] when writing the code.
51+
- Format the code using `flutter format .`.
52+
- Documentation should always be updated or added (if applicable).
53+
- Examples should always be updated or added (if applicable).
54+
- Tests should always be updated or added (if applicable) -- check the [Test writing guide] for
55+
more details.
56+
- The PR title should start with a [conventional commit] prefix (`feat:`, `fix:` etc).
57+
58+
If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the issue
59+
or PR. You can still continue to add more commits to the branch you have sent the Pull Request from
60+
and it will be automatically reflected in the PR.
61+
62+
63+
## Open an issue and fork the repository
64+
65+
- If it is a bigger change or a new feature, first of all
66+
[file a bug or feature report][GitHub issues], so that we can discuss what direction to follow.
67+
- [Fork the project][fork guide] on GitHub.
68+
- Clone the forked repository to your local development machine
69+
(e.g. `git clone [email protected]:<YOUR_GITHUB_USER>/flutter_credit_card.git`).
70+
71+
72+
### Performing changes
73+
74+
- Create a new local branch from `main` (e.g. `git checkout -b my-new-feature`)
75+
- Make your changes (try to split them up with one PR per feature/fix).
76+
- When committing your changes, make sure that each commit message is clear
77+
(e.g. `git commit -m 'Fixes duplicate key found in example'`).
78+
- Push your new branch to your own fork into the same remote branch
79+
(e.g. `git push origin my-username.my-new-feature`, replace `origin` if you use another remote.)
80+
81+
82+
### Breaking changes
83+
84+
When doing breaking changes a deprecation tag should be added when possible and contain a message
85+
that conveys to the user what which version that the deprecated method/field will be removed in and
86+
what method they should use instead to perform the task. The version specified should be at least
87+
two versions after the current one, such that there will be at least one stable release where the
88+
users get to see the deprecation warning and in the version after that (or a later version) the
89+
deprecated entity should be removed.
90+
91+
Example (if the current version is v1.3.0):
92+
93+
```dart
94+
@Deprecated('Will be removed in v1.5.0, use nonDeprecatedFeature() instead')
95+
void deprecatedFeature() {}
96+
```
97+
98+
99+
### Open a pull request
100+
101+
Go to the [pull request page][PRs] and you will asked you if you want to open a pull request from
102+
your newly created branch right at the top of the page.
103+
104+
The title of the pull request should start with a [conventional commit] type.
105+
Use [gitmoji] for commit message.
106+
107+
Allowed types are:
108+
109+
- `fix:` -- patches a bug and is not a new feature;
110+
- `feat:` -- introduces a new feature;
111+
- `docs:` -- updates or adds documentation or examples;
112+
- `test:` -- updates or adds tests;
113+
- `refactor:` -- refactors code but doesn't introduce any changes or additions to the public API;
114+
- `perf:` -- code change that improves performance;
115+
- `build:` -- code change that affects the build system or external dependencies;
116+
- `ci:` -- changes to the CI configuration files and scripts;
117+
- `chore:` -- other changes that don't modify source or test files;
118+
- `revert:` -- reverts a previous commit.
119+
120+
If you introduce a **breaking change** the conventional commit type MUST end with an exclamation
121+
mark (e.g. `feat!: Remove a card provider type`).
122+
123+
Examples of PR titles:
124+
125+
- feat: :sparkles: Add input decoration class
126+
- fix: :bug: Safe guard adding new Floating events
127+
- docs: :pencil: Update README.md for preview url
128+
- test: :rotating_light: Add unit test for `CreditCardForm`
129+
- refactor: :hammer: Package Structure and Code Improvement
130+
131+
132+
## Maintainers
133+
134+
The following instructions are for the maintainers of this package.
135+
136+
137+
### Merging a pull request
138+
139+
When merging a pull request, make sure that the title of the merge commit has the correct
140+
conventional commit tag and a descriptive title. This is extra important since sometimes the title
141+
of the PR doesn't reflect what GitHub defaults to for the merge commit title (if the title has been
142+
changed during the life time of the PR for example).
143+
144+
All the default text should be removed from the commit message and the PR description and the
145+
instructions from the "Migration instruction" (if the PR is breaking) should be copied into the
146+
commit message.
147+
148+
149+
### Creating a release
150+
151+
There are a few things to think about when doing a release:
152+
153+
- Search through the codebase for `@Deprecated` methods/fields and remove the ones that are marked
154+
for removal in the version that you are intending to release.
155+
- Create a PR containing the changes for removing the deprecated entities.
156+
- Go through the PRs with breaking changes and add migration documentation to the changelog.
157+
There should be migration docs on each PR, if they haven't been copied to the commit message.
158+
- Create a PR containing the updated changelog and `pubspec.yaml` files.
159+
160+
161+
[GitHub issues]: https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/new
162+
[style guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
163+
[test writing guide]: https://docs.flutter.dev/cookbook/testing/unit/introduction
164+
[pubspec doc]: https://dart.dev/tools/pub/pubspec
165+
[conventional commit]: https://www.conventionalcommits.org
166+
[fork guide]: https://guides.github.com/activities/forking/#fork
167+
[PRs]: https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/pulls
168+
[gitmoji]: https://gist.github.com/parmentf/035de27d6ed1dce0b36a

README.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Flutter Credit Card
44

5-
![build](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/workflows/Build/badge.svg?branch=master)
5+
![build](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/actions/workflows/flutter.yml/badge.svg?branch=master)
66
[![flutter_credit_card](https://img.shields.io/pub/v/flutter_credit_card?label=flutter_credit_card)](https://pub.dev/packages/flutter_credit_card)
77

88
A Flutter package allows you to easily implement the Credit card's UI easily with the Card detection.
@@ -270,11 +270,7 @@ Check out the **example** app in the [example](example) directory or the 'Exampl
270270
<table>
271271
<tr>
272272
<td align="center"><a href="https://github.com/vatsaltanna"><img src="https://avatars.githubusercontent.com/u/25323183?s=100" width="100px;" alt=""/><br /><sub><b>Vatsal Tanna</b></sub></a></td>
273-
<td align="center"><a href="https://github.com/DevarshRanpara"><img src="https://avatars.githubusercontent.com/u/26064415?s=100" width="100px;" alt=""/><br /><sub><b>Devarsh Ranpara</b></sub></a></td>
274-
<td align="center"><a href="https://github.com/Kashifalaliwala"><img src="https://avatars.githubusercontent.com/u/30998350?s=100" width="100px;" alt=""/><br /><sub><b>Kashifa Laliwala</b></sub></a></td>
275273
<td align="center"><a href="https://github.com/SanketKachhela"><img src="https://avatars.githubusercontent.com/u/20923896?s=100" width="100px;" alt=""/><br /><sub><b>Sanket Kachchela</b></sub></a></td>
276-
<td align="center"><a href="https://github.com/meetjanani"><img src="https://avatars.githubusercontent.com/u/32095359?s=100" width="100px;" alt=""/><br /><sub><b>Meet Janani</b></sub></a></td>
277-
<td align="center"><a href="https://github.com/shwetachauhan-simform"><img src="https://avatars.githubusercontent.com/u/63042002?s=100" width="100px;" alt=""/><br /><sub><b>Shweta Chauhan</b></sub></a></td>
278274
<td align="center"><a href="https://github.com/kavantrivedi"><img src="https://avatars.githubusercontent.com/u/97207242?s=100" width="100px;" alt=""/><br /><sub><b>Kavan Trivedi</b></sub></a></td>
279275
<td align="center"><a href="https://github.com/Ujas-Majithiya"><img src="https://avatars.githubusercontent.com/u/56400956?v=4" width="100px;" alt=""/><br /><sub><b>Ujas Majithiya</b></sub></a></td>
280276
<td align="center"><a href="https://github.com/aditya-chavda"><img src="https://avatars.githubusercontent.com/u/41247722?v=4" width="100px;" alt=""/><br /><sub><b>Aditya Chavda</b></sub></a></td>

lib/src/credit_card_form.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'package:flutter/material.dart';
2-
import 'package:flutter/src/services/text_formatter.dart';
2+
import 'package:flutter/services.dart';
33

44
import '../flutter_credit_card.dart';
55
import 'masked_text_controller.dart';
@@ -308,9 +308,7 @@ class _CreditCardFormState extends State<CreditCardForm> {
308308
? TextCapitalization.characters
309309
: TextCapitalization.none,
310310
inputFormatters: widget.isCardHolderNameUpperCase
311-
? <TextInputFormatter>[
312-
UpperCaseTextFormatter(),
313-
]
311+
? const <TextInputFormatter>[UpperCaseTextFormatter()]
314312
: null,
315313
validator: widget.cardHolderValidator,
316314
),

lib/src/utils/helpers.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@ Widget getCardTypeImage({
9090
}
9191

9292
class UpperCaseTextFormatter extends TextInputFormatter {
93+
const UpperCaseTextFormatter();
94+
9395
@override
9496
TextEditingValue formatEditUpdate(
95-
TextEditingValue oldValue, TextEditingValue newValue) {
97+
TextEditingValue oldValue,
98+
TextEditingValue newValue,
99+
) {
96100
return TextEditingValue(
97101
text: newValue.text.toUpperCase(),
98102
selection: newValue.selection,

pubspec.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
name: flutter_credit_card
22
description: A Credit Card widget package with support of entering card details, and animations like card flip
33
and float.
4-
version: 4.0.2
4+
version: 4.1.0
55
homepage: https://github.com/simformsolutions/flutter_credit_card
66
issue_tracker: https://github.com/simformsolutions/flutter_credit_card/issues
7+
topics:
8+
- credit-card
9+
- auto-detect-card
10+
- card-ui
11+
- card-animations
12+
- credit-card-form
713

814
environment:
915
sdk: '>=2.17.0 <4.0.0'

0 commit comments

Comments
 (0)