Skip to main content

plate_keypad 0.1.2 copy "plate_keypad: ^0.1.2" to clipboard
plate_keypad: ^0.1.2 copied to clipboard

The optional on-screen keypad and slot picker for the plate_core library — a soft keyboard for hosts that do not render their own.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:plate_core/plate_core.dart';
import 'package:plate_keypad/plate_keypad.dart';

void main() => runApp(const ExampleApp());

class ExampleApp extends StatefulWidget {
  const ExampleApp({super.key});

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  String _typed = '';

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.end,
            children: [
              Expanded(
                child: Center(child: Text(_typed.isEmpty ? '—' : _typed)),
              ),
              PlateKeypad(
                highlightedKey: null,
                digitAlphabet: PlateAlphabet.latinDigits,
                letterAlphabet: PlateAlphabet.latinUppercase,
                onKey: (key) => setState(() {
                  _typed = key == kPlateBackspaceKey
                      ? _typed.substring(
                          0,
                          _typed.isEmpty ? 0 : _typed.length - 1,
                        )
                      : _typed + key;
                }),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
1
likes
150
points
457
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

The optional on-screen keypad and slot picker for the plate_core library — a soft keyboard for hosts that do not render their own.

License

MIT (license)

Dependencies

flutter, plate_core

More

Packages that depend on plate_keypad