Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
6668786
feat(packages): add morse_tap package with gesture-based input
ProjectAJ14 Aug 10, 2025
0346792
refactor(morse_tap): remove visual feedback from MorseTapDetector
ProjectAJ14 Aug 22, 2025
2034f61
feat(examples): integrate onSequenceChange callback with real-time UI
ProjectAJ14 Aug 22, 2025
25483b5
docs(morse_tap): add screenshot and improve documentation
ProjectAJ14 Aug 22, 2025
0875956
refactor(morse_tap): clean up morse_text_input formatting
ProjectAJ14 Aug 22, 2025
2119d0a
feat(morse_tap): add haptic feedback system
ProjectAJ14 Aug 22, 2025
b16b4f4
feat(morse_tap): integrate haptic feedback and fix UI overflow
ProjectAJ14 Aug 22, 2025
8b5a526
docs(morse_tap): add haptic config modal and update documentation
ProjectAJ14 Aug 22, 2025
fafd82e
test(morse_tap): fix example widget test
ProjectAJ14 Aug 22, 2025
9dfe804
fix(morse_tap): resolve UI overflow in tap detector example
ProjectAJ14 Aug 22, 2025
5e7e8b7
refactor(morse_tap): update app title and improve layout with ListView
ProjectAJ14 Aug 22, 2025
57e8660
chore(release): publish packages
ProjectAJ14 Aug 22, 2025
0d39f34
docs: add morse_tap package to README files
ProjectAJ14 Aug 22, 2025
fb54ead
feat(morse_tap): add comprehensive platform support for web and desktop
ProjectAJ14 Aug 22, 2025
718535e
refactor(haptic_utils): improve import formatting and ensure newline …
ProjectAJ14 Aug 22, 2025
01c309d
chore(release): publish packages
ProjectAJ14 Aug 22, 2025
877abaf
Merge branch 'main' into morse_tap
ProjectAJ14 Aug 22, 2025
f493243
fix: remove test from morse_tap example
ProjectAJ14 Aug 27, 2025
75217ef
chore: update Flutter version to 3.35.0 in CI configuration
ProjectAJ14 Aug 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/dart.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [ "main" ]

env:
FLUTTER_VERSION: "3.32.3"
FLUTTER_VERSION: "3.35.0"

jobs:
discover:
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ A place where Flutter packages are crafted and built.
| [![ns_utils](https://img.shields.io/pub/v/ns_utils.svg?label=ns_utils&logo=dart&color=blue&style=for-the-badge)](https://pub.dev/packages/ns_utils) |
| [![ns_intl_phone_input](https://img.shields.io/pub/v/ns_intl_phone_input.svg?label=ns_intl_phone_input&logo=dart&color=blue&style=for-the-badge)](https://pub.dev/packages/ns_intl_phone_input) |
| [![dzod](https://img.shields.io/pub/v/dzod.svg?label=dzod&logo=dart&color=blue&style=for-the-badge)](https://pub.dev/packages/dzod) |
| [![html_rich_text](https://img.shields.io/pub/v/html_rich_text.svg?label=html_rich_text&logo=dart&color=blue&style=for-the-badge)](https://pub.dev/packages/html_rich_text) |
| [![html_rich_text](https://img.shields.io/pub/v/html_rich_text.svg?label=html_rich_text&logo=dart&color=blue&style=for-the-badge)](https://pub.dev/packages/html_rich_text) |
| [![morse_tap](https://img.shields.io/pub/v/morse_tap.svg?label=morse_tap&logo=dart&color=blue&style=for-the-badge)](https://pub.dev/packages/morse_tap) |

| Plugins |
|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Expand Down
1 change: 1 addition & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@
| ns_intl_phone_input | [![ns_intl_phone_input pub.dev badge](https://img.shields.io/pub/v/ns_intl_phone_input.svg)](https://pub.dev/packages/ns_intl_phone_input) | [`🔗`](ns_intl_phone_input/README.md) |
| html_rich_text | [![html_rich_text pub.dev badge](https://img.shields.io/pub/v/html_rich_text.svg)](https://pub.dev/packages/html_rich_text) | [`🔗`](html_rich_text/README.md) |
| dzod | [![dzod pub.dev badge](https://img.shields.io/pub/v/dzod.svg)](https://pub.dev/packages/dzod) | [`🔗`](dzod/README.md) |
| morse_tap | [![morse_tap pub.dev badge](https://img.shields.io/pub/v/morse_tap.svg)](https://pub.dev/packages/morse_tap) | [`🔗`](morse_tap/README.md) |
31 changes: 31 additions & 0 deletions packages/morse_tap/.gitignore
Original file line number Diff line number Diff line change
@@ -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/
10 changes: 10 additions & 0 deletions packages/morse_tap/.metadata
Original file line number Diff line number Diff line change
@@ -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: "d7b523b356d15fb81e7d340bbe52b47f93937323"
channel: "stable"

project_type: package
21 changes: 21 additions & 0 deletions packages/morse_tap/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## 0.0.3

- **REFACTOR**(haptic_utils): improve import formatting and ensure newline at EOF.
- **FEAT**(morse_tap): add comprehensive platform support for web and desktop.

## 0.0.2

- **REFACTOR**(morse_tap): update app title and improve layout with ListView.
- **REFACTOR**(morse_tap): clean up morse_text_input formatting.
- **REFACTOR**(morse_tap): remove visual feedback from MorseTapDetector.
- **FIX**(morse_tap): resolve UI overflow in tap detector example.
- **FEAT**(morse_tap): integrate haptic feedback and fix UI overflow.
- **FEAT**(morse_tap): add haptic feedback system.
- **FEAT**(examples): integrate onSequenceChange callback with real-time UI.
- **FEAT**(packages): add morse_tap package with gesture-based input.
- **DOCS**(morse_tap): add haptic config modal and update documentation.
- **DOCS**(morse_tap): add screenshot and improve documentation.

## 0.0.1

* TODO: Describe initial release.
21 changes: 21 additions & 0 deletions packages/morse_tap/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 NonStop IO

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
265 changes: 265 additions & 0 deletions packages/morse_tap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,265 @@
<p align="center">
<a href="https://nonstopio.com">
<img src="https://github.com/nonstopio.png" alt="Nonstop Logo" height="128" />
</a>
<h1 align="center">NonStop</h1>
<p align="center">Digital Product Development Experts for Startups & Enterprises</p>
<p align="center">
<a href="https://nonstopio.com/about-us">About</a> |
<a href="https://nonstopio.com">Website</a>
</p>
</p>

# morse_tap

[![Build Status](https://img.shields.io/pub/v/morse_tap.svg)](https://github.com/nonstopio/flutter_forge/tree/main/packages/morse_tap)
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)

A Flutter package that provides Morse code input functionality using intuitive gestures. Create interactive Morse code experiences with single taps for dots, double taps for dashes, and long presses for spaces.

![Morse Tap Demo](morse_tap.png)

## Features

✨ **MorseTapDetector** - Widget that detects specific Morse code patterns using gestures
🎯 **MorseTextInput** - Real-time gesture-to-text conversion widget
🔄 **String Extensions** - Convert any string to/from Morse code
⚡ **Fast Algorithm** - Efficient Morse code conversion with comprehensive character support
🎨 **Intuitive Gestures** - Single tap = dot, double tap = dash, long press = space
📳 **Haptic Feedback** - Customizable tactile feedback for enhanced user experience

## Usage Examples

### 1. MorseTapDetector - Pattern Detection

Detect when users input a specific Morse code pattern using gestures:

```dart
MorseTapDetector(
expectedMorseCode: "... --- ...", // SOS pattern
onCorrectSequence: () {
print("SOS detected!");
// Handle correct sequence
},
onIncorrectSequence: () {
print("Wrong pattern, try again");
},
onSequenceChange: (sequence) {
print("Current sequence: $sequence");
// Update UI with current input
},
onDotAdded: () => print("Dot added"),
onDashAdded: () => print("Dash added"),
onSpaceAdded: () => print("Space added"),
child: Container(
width: 200,
height: 200,
decoration: BoxDecoration(
color: Colors.blue,
borderRadius: BorderRadius.circular(12),
),
child: const Center(
child: Text(
'Use Gestures for SOS',
style: TextStyle(color: Colors.white, fontSize: 20),
),
),
),
)
```

### 2. MorseTextInput - Real-time Conversion

Convert tap input to text in real-time:

```dart
class MorseInputExample extends StatelessWidget {
final TextEditingController controller = TextEditingController();

@override
Widget build(BuildContext context) {
return Column(
children: [
MorseTextInput(
controller: controller,
autoConvertToText: true,
showMorsePreview: true,
onTextChanged: (text) {
print("Converted text: $text");
},
decoration: const InputDecoration(
labelText: 'Tap to input text',
border: OutlineInputBorder(),
),
),
// Your converted text appears in the controller
TextField(
controller: controller,
readOnly: true,
decoration: const InputDecoration(
labelText: 'Output',
),
),
],
);
}
}
```

### 3. String Extensions

Easy string to Morse code conversion:

```dart
// Convert text to Morse code
String morse = "HELLO WORLD".toMorseCode();
print(morse); // ".... . .-.. .-.. --- / .-- --- .-. .-.. -.."

// Convert Morse code back to text
String text = "... --- ...".fromMorseCode();
print(text); // "SOS"

// Validate Morse input
bool isValid = "... --- ...".isValidMorseSequence();
print(isValid); // true

// Check if string contains only Morse characters
bool isMorseInput = "... abc".isValidMorseInput();
print(isMorseInput); // false
```

## Configuration

### Timing Configuration

Customize the input timeout:

```dart
MorseTapDetector(
expectedMorseCode: "... --- ...",
inputTimeout: Duration(seconds: 5), // Time allowed for next input
onCorrectSequence: () => print("Correct!"),
child: MyButton(),
)
```

Note: The timeout resets after each input, allowing users to take their time
with long sequences as long as they keep entering characters.

### Haptic Feedback

Provide tactile feedback for gestures:

```dart
MorseTapDetector(
expectedMorseCode: "... --- ...",
hapticConfig: HapticConfig.defaultConfig, // Enable haptic feedback
onCorrectSequence: () => print("Correct!"),
child: MyButton(),
)
```

**Preset configurations:**
```dart
// Different preset options
HapticConfig.disabled // No haptic feedback
HapticConfig.light // Subtle feedback
HapticConfig.defaultConfig // Moderate feedback
HapticConfig.strong // Intense feedback

// Custom configuration
HapticConfig(
enabled: true,
dotIntensity: HapticFeedbackType.lightImpact,
dashIntensity: HapticFeedbackType.mediumImpact,
correctSequenceIntensity: HapticFeedbackType.heavyImpact,
)
```

### Visual Feedback

Control visual feedback options:

```dart
MorseTextInput(
controller: controller,
showMorsePreview: true, // Show Morse preview
feedbackColor: Colors.green, // Tap feedback color
tapAreaHeight: 150.0, // Height of tap area
autoConvertToText: false, // Keep as Morse code
)
```

## Supported Characters

The package supports:
- **Letters**: A-Z (26 letters)
- **Numbers**: 0-9 (10 digits)
- **Punctuation**: . , ? ' ! / ( ) & : ; = + - _ " $ @

*See the complete mapping in `MorseCodec` class documentation.*

## Advanced Usage

### Custom Morse Patterns

Create custom pattern detection:

```dart
final customPattern = "HELP".toMorseCode();

MorseTapDetector(
expectedMorseCode: customPattern,
onCorrectSequence: () => showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text("Help Requested!"),
content: Text("Someone needs assistance."),
),
),
child: EmergencyButton(),
)
```

## Contributing

We welcome contributions in various forms:

- Proposing new features or enhancements.
- Reporting and fixing bugs.
- Engaging in discussions to help make decisions.
- Improving documentation, as it is essential.
- Sending Pull Requests is greatly appreciated!

---


<div align="center">

**Stay connected and get the latest updates!**

[![LinkedIn](https://img.shields.io/badge/LinkedIn-0077B5?style=for-the-badge&logo=linkedin&logoColor=white)](https://www.linkedin.com/company/nonstop-io)
[![X.com](https://img.shields.io/badge/X-000000?style=for-the-badge&logo=x&logoColor=white)](https://x.com/NonStopio)
[![Instagram](https://img.shields.io/badge/Instagram-E4405F?style=for-the-badge&logo=instagram&logoColor=white)](https://www.instagram.com/nonstopio_technologies/)
[![YouTube](https://img.shields.io/badge/YouTube-FF0000?style=for-the-badge&logo=youtube&logoColor=white)](https://www.youtube.com/@NonStopioTechnology)
[![Email](https://img.shields.io/badge/Email-D14836?style=for-the-badge&logo=gmail&logoColor=white)](mailto:contact@nonstopio.com)

</div>

---

<div align="center">

⭐ Star us on [GitHub](https://github.com/nonstopio/flutter_forge) if this helped you!

</div>

## 📜 License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

<div align="center">

🎉 [Founded by Ajay Kumar](https://github.com/ProjectAJ14) 🎉**

</div>
Loading