Skip to content

Commit

Permalink
chore: 🔨 Docs updates and Code improvement
Browse files Browse the repository at this point in the history
- 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.
  • Loading branch information
aditya-css authored and vatsaltanna-simformsolutions committed Feb 24, 2025
1 parent 19160cb commit 96dde4a
Show file tree
Hide file tree
Showing 7 changed files with 185 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,5 @@ Closes #1234
!-->

<!-- Links -->
[Contributor Guide]: https://github.com/SimformSolutionsPvtLtd/flutter_showcaseview/blob/master/CONTRIBUTING.md
[Contributor Guide]: https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/blob/master/CONTRIBUTING.md
[Conventional Commit]: https://conventionalcommits.org
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# [4.0.2](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.0.2)
# [4.1.0](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/tree/4.1.0)

- Fixed floating event stream bad state exception [#157](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/157).
- Fixed Gyroscope initialization issue [#173](https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/173).
Expand Down
176 changes: 168 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,168 @@
# Way to contribute

1. Fork the repo and create your branch from `master`.
2. Clone the project to your own machine.
3. Commit changes to your own branch
4. Make sure your code lints.
5. Push your work back up to your fork.
6. Issue that pull request!
# Contribution Guidelines

**Note:** If these contribution guidelines are not followed your issue or PR might be closed, so
please read these instructions carefully.

## Contribution types


### Bug Reports

- If you find a bug, please first report it using [Github issues].
- First check if there is not already an issue for it; duplicated issues will be closed.


### Bug Fix

- If you'd like to submit a fix for a bug, please read the [How To](#how-to-contribute) for how to
send a Pull Request.
- Indicate on the open issue that you are working on fixing the bug and the issue will be assigned
to you.
- Write `Fixes #xxxx` in your PR text, where xxxx is the issue number (if there is one).
- Include a test that isolates the bug and verifies that it was fixed.


### New Features

- If you'd like to add a feature to the library that doesn't already exist, feel free to describe
the feature in a new [GitHub issue][GitHub issues].
- If you'd like to implement the new feature, please wait for feedback from the library maintainers
before spending too much time writing the code. In some cases, enhancements may not align well
with the library's future development direction.
- Implement the code for the new feature and please read the [How To](#how-to-contribute).


### Documentation & Miscellaneous

- If you have suggestions for improvements to the documentation, tutorial or examples (or something
else), we would love to hear about it.
- As always first file a [Github issue][GitHub issues].
- Implement the changes to the documentation, please read the [How To](#how-to-contribute).


## How To Contribute


### Requirements

For a contribution to be accepted:

- Follow the [Style Guide] when writing the code.
- Format the code using `flutter format .`.
- Documentation should always be updated or added (if applicable).
- Examples should always be updated or added (if applicable).
- Tests should always be updated or added (if applicable) -- check the [Test writing guide] for
more details.
- The PR title should start with a [conventional commit] prefix (`feat:`, `fix:` etc).

If the contribution doesn't meet these criteria, a maintainer will discuss it with you on the issue
or PR. You can still continue to add more commits to the branch you have sent the Pull Request from
and it will be automatically reflected in the PR.


## Open an issue and fork the repository

- If it is a bigger change or a new feature, first of all
[file a bug or feature report][GitHub issues], so that we can discuss what direction to follow.
- [Fork the project][fork guide] on GitHub.
- Clone the forked repository to your local development machine
(e.g. `git clone [email protected]:<YOUR_GITHUB_USER>/flutter_credit_card.git`).


### Performing changes

- Create a new local branch from `main` (e.g. `git checkout -b my-new-feature`)
- Make your changes (try to split them up with one PR per feature/fix).
- When committing your changes, make sure that each commit message is clear
(e.g. `git commit -m 'Fixes duplicate key found in example'`).
- Push your new branch to your own fork into the same remote branch
(e.g. `git push origin my-username.my-new-feature`, replace `origin` if you use another remote.)


### Breaking changes

When doing breaking changes a deprecation tag should be added when possible and contain a message
that conveys to the user what which version that the deprecated method/field will be removed in and
what method they should use instead to perform the task. The version specified should be at least
two versions after the current one, such that there will be at least one stable release where the
users get to see the deprecation warning and in the version after that (or a later version) the
deprecated entity should be removed.

Example (if the current version is v1.3.0):

```dart
@Deprecated('Will be removed in v1.5.0, use nonDeprecatedFeature() instead')
void deprecatedFeature() {}
```


### Open a pull request

Go to the [pull request page][PRs] and you will asked you if you want to open a pull request from
your newly created branch right at the top of the page.

The title of the pull request should start with a [conventional commit] type.
Use [gitmoji] for commit message.

Allowed types are:

- `fix:` -- patches a bug and is not a new feature;
- `feat:` -- introduces a new feature;
- `docs:` -- updates or adds documentation or examples;
- `test:` -- updates or adds tests;
- `refactor:` -- refactors code but doesn't introduce any changes or additions to the public API;
- `perf:` -- code change that improves performance;
- `build:` -- code change that affects the build system or external dependencies;
- `ci:` -- changes to the CI configuration files and scripts;
- `chore:` -- other changes that don't modify source or test files;
- `revert:` -- reverts a previous commit.

If you introduce a **breaking change** the conventional commit type MUST end with an exclamation
mark (e.g. `feat!: Remove a card provider type`).

Examples of PR titles:

- feat: :sparkles: Add input decoration class
- fix: :bug: Safe guard adding new Floating events
- docs: :pencil: Update README.md for preview url
- test: :rotating_light: Add unit test for `CreditCardForm`
- refactor: :hammer: Package Structure and Code Improvement


## Maintainers

The following instructions are for the maintainers of this package.


### Merging a pull request

When merging a pull request, make sure that the title of the merge commit has the correct
conventional commit tag and a descriptive title. This is extra important since sometimes the title
of the PR doesn't reflect what GitHub defaults to for the merge commit title (if the title has been
changed during the life time of the PR for example).

All the default text should be removed from the commit message and the PR description and the
instructions from the "Migration instruction" (if the PR is breaking) should be copied into the
commit message.


### Creating a release

There are a few things to think about when doing a release:

- Search through the codebase for `@Deprecated` methods/fields and remove the ones that are marked
for removal in the version that you are intending to release.
- Create a PR containing the changes for removing the deprecated entities.
- Go through the PRs with breaking changes and add migration documentation to the changelog.
There should be migration docs on each PR, if they haven't been copied to the commit message.
- Create a PR containing the updated changelog and `pubspec.yaml` files.


[GitHub issues]: https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/issues/new
[style guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[test writing guide]: https://docs.flutter.dev/cookbook/testing/unit/introduction
[pubspec doc]: https://dart.dev/tools/pub/pubspec
[conventional commit]: https://www.conventionalcommits.org
[fork guide]: https://guides.github.com/activities/forking/#fork
[PRs]: https://github.com/SimformSolutionsPvtLtd/flutter_credit_card/pulls
[gitmoji]: https://gist.github.com/parmentf/035de27d6ed1dce0b36a
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Flutter Credit Card

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

A Flutter package allows you to easily implement the Credit card's UI easily with the Card detection.
Expand Down Expand Up @@ -270,11 +270,7 @@ Check out the **example** app in the [example](example) directory or the 'Exampl
<table>
<tr>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
<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>
Expand Down
6 changes: 2 additions & 4 deletions lib/src/credit_card_form.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/material.dart';
import 'package:flutter/src/services/text_formatter.dart';
import 'package:flutter/services.dart';

import '../flutter_credit_card.dart';
import 'masked_text_controller.dart';
Expand Down Expand Up @@ -308,9 +308,7 @@ class _CreditCardFormState extends State<CreditCardForm> {
? TextCapitalization.characters
: TextCapitalization.none,
inputFormatters: widget.isCardHolderNameUpperCase
? <TextInputFormatter>[
UpperCaseTextFormatter(),
]
? const <TextInputFormatter>[UpperCaseTextFormatter()]
: null,
validator: widget.cardHolderValidator,
),
Expand Down
6 changes: 5 additions & 1 deletion lib/src/utils/helpers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,13 @@ Widget getCardTypeImage({
}

class UpperCaseTextFormatter extends TextInputFormatter {
const UpperCaseTextFormatter();

@override
TextEditingValue formatEditUpdate(
TextEditingValue oldValue, TextEditingValue newValue) {
TextEditingValue oldValue,
TextEditingValue newValue,
) {
return TextEditingValue(
text: newValue.text.toUpperCase(),
selection: newValue.selection,
Expand Down
8 changes: 7 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
name: flutter_credit_card
description: A Credit Card widget package with support of entering card details, and animations like card flip
and float.
version: 4.0.2
version: 4.1.0
homepage: https://github.com/simformsolutions/flutter_credit_card
issue_tracker: https://github.com/simformsolutions/flutter_credit_card/issues
topics:
- credit-card
- auto-detect-card
- card-ui
- card-animations
- credit-card-form

environment:
sdk: '>=2.17.0 <4.0.0'
Expand Down

0 comments on commit 96dde4a

Please sign in to comment.