tappy_keyboard 2.0.0 copy "tappy_keyboard: ^2.0.0" to clipboard
tappy_keyboard: ^2.0.0 copied to clipboard

Embedded Screen Keyboard

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:tappy_keyboard/tappy_keyboard.dart';
import 'package:tappy_keyboard/tappy_keyboard/type/keyboard_type.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Tappy Keyboard',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.blueAccent),
        useMaterial3: true,
      ),
      home: HomeScreen(),
    );
  }
}

class HomeScreen extends StatelessWidget {
  const HomeScreen({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (c) => NumericKeyboardExample(),
                  ),
                );
              },
              child: Text("Numeric"),
            ),
            SizedBox(height: 16),
            ElevatedButton(
              onPressed: () {
                Navigator.push(
                  context,
                  MaterialPageRoute(
                    builder: (c) => AlphaNumericKeyboardExample(),
                  ),
                );
              },
              child: Text("Alphanumeric"),
            ),
          ],
        ),
      ),
    );
  }
}

class AlphaNumericKeyboardExample extends StatelessWidget {
  const AlphaNumericKeyboardExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Alpha Numeric Keyboard"),
      ),
      body: TappyKeyboard(
        type: TappyKeyboardType.alphanumeric,
        showAtSymbol: true,
        onTap: (key) {},
        child: Padding(
          padding: const EdgeInsets.all(40.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              for (int i = 1; i <= 15; i++)
                TextField(
                  decoration: InputDecoration(
                    label: Text("Input Field $i"),
                  ),
                ),
            ],
          ),
        ),
      ),
    );
  }
}

class NumericKeyboardExample extends StatelessWidget {
  const NumericKeyboardExample({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Numeric Keyboard"),
      ),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          children: [
            TextField(
              decoration: InputDecoration(
                label: Text("Editable"),
              ),
            ),
            IntrinsicWidth(
              child: TappyKeyboard(
                type: TappyKeyboardType.numeric,
                showOnFocus: false,
              ),
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
0
points
100
downloads

Publisher

unverified uploader

Weekly Downloads

Embedded Screen Keyboard

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

auto_size_text, flutter, provider

More

Packages that depend on tappy_keyboard