swipe_path_typer 1.1.0

SDKflutter
Platformandroidioswindowslinuxmacosweb

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'],
  onWordCompleted: (word) {
    print('User typed: $word');
  },
)

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

ParameterTypeDescription
tilesList<String>The list of characters to render as tiles
onWordCompletedValueChanged<String>Called when a word is completed via swipe or tap
tileBuilderTileBuilder?Optional builder to customize tile UI
columnCountintNumber of tiles per row (default: 5)
simpleTapModeboolTaps immediately complete a word (default: true)
horizontalTileSpacingdoubleHorizontal space between tiles
verticalTileSpacingdoubleVertical space between tile rows
paddingEdgeInsetsPadding around the entire widget
onPanUpdateFunction(DragUpdateDetails)?Called during a swipe
onPanEndFunction(DragEndDetails)?Called when a swipe ends
onPanStartFunction(DragEndDetails)?Called when a swipe starts
onTapDownFunction(int)?Called when a tile is tapped down
onTapUpFunction(int)?Called when a tile is tapped up
widgetHitTestBehaviorHitTestBehaviorBehavior for the gesture container
tileHitTestBehaviorHitTestBehaviorBehavior for mouse hover on tiles
tileCursorSystemMouseCursorCursor to use on hover (e.g., click)
swipeTrailColorColorColor of the swipe trail
swipeTrailStrokeWidthdoubleThickness 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.0

📄 License

MIT © 2025 [Your Name or Studio]