swipe_path_typer 1.1.5
swipe_path_typer: ^1.1.5 copied to clipboard
A swipe-based typing widget for Flutter that mimics gesture typing on mobile keyboards. Ideal for games, word puzzles, or creative input mechanics.
swipe_path_typer #
A swipe-based typing widget for Flutter, mimicking the gesture typing experience of modern mobile keyboards like Gboard or SwiftKey.
Ideal for games, puzzles, and creative UIs that need swipe input on a grid of characters.
โจ Features #
- ๐ฑ Swipe over tiles to form words
- ๐ Sharp turn detection for smart letter selection
- ๐ Tap support (with optional auto-complete on tap)
- ๐จ Fully customizable tile UI
- ๐งฑ Adjustable layout, spacing, and interaction
- ๐๏ธ Painted swipe trail (customizable color and thickness)
- ๐ฑ๏ธ Desktop/web mouse support
๐ Usage #
Basic #
SwipePathTyper(
tiles: ['h', 'e', 'l', 'l', 'o'],
onSwipeCompleted: (word) {
print('User typed: $word');
},
onLetterSelected: (letter){
print('User selected $letter')
}
)
Custom Tile Example #
tileBuilder: (context, letter, isSelected) {
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: isSelected ? Colors.blue : Colors.grey[200],
borderRadius: BorderRadius.circular(10),
),
child: Text(
letter.toUpperCase(),
style: const TextStyle(fontSize: 24, fontWeight: FontWeight.bold),
),
);
},
โ๏ธ Parameters #
| Parameter | Type | Description |
|---|---|---|
tiles |
List<String> |
The list of characters to render as tiles |
onSwipeCompleted |
ValueChanged<String> |
Called when a word is completed via swipe |
onLetterSelected |
ValueChanged<String> |
Called when a letter is selected |
tileBuilder |
TileBuilder? |
Optional builder to customize tile UI |
columnCount |
int |
Number of tiles per row (default: 5) |
simpleTapMode |
bool |
Taps immediately complete a word (default: true) |
horizontalTileSpacing |
double |
Horizontal space between tiles |
verticalTileSpacing |
double |
Vertical space between tile rows |
padding |
EdgeInsets |
Padding around the entire widget |
onPanUpdate |
Function(DragUpdateDetails)? |
Called during a swipe |
onPanEnd |
Function(DragEndDetails)? |
Called when a swipe ends |
onPanStart |
Function(DragEndDetails)? |
Called when a swipe starts |
onTapDown |
Function(int)? |
Called when a tile is tapped down |
onTapUp |
Function(int)? |
Called when a tile is tapped up |
widgetHitTestBehavior |
HitTestBehavior |
Behavior for the gesture container |
tileHitTestBehavior |
HitTestBehavior |
Behavior for mouse hover on tiles |
tileCursor |
SystemMouseCursor |
Cursor to use on hover (e.g., click) |
swipeTrailColor |
Color |
Color of the swipe trail |
swipeTrailStrokeWidth |
double |
Thickness of the swipe trail line |
๐งช Example #
A working example is available in /example/main.dart.
๐ฆ Installation #
Add to your pubspec.yaml:
dependencies:
swipe_path_typer: ^1.1.5
๐ License #
MIT ยฉ 2025 [Your Name or Studio]