flutter_virtual_keyboard 0.0.3 flutter_virtual_keyboard: ^0.0.3 copied to clipboard
This package offers a customizable virtual keyboard, enabling easy integration for typing functionality in apps.
import 'package:flutter/material.dart';
import 'package:flutter_virtual_keyboard/virtual_keyboard.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
final TextEditingController _textEditingController = TextEditingController();
final TextEditingController _textEditingController2 = TextEditingController();
final ScrollController _scrollController = ScrollController();
final ScrollController _scrollController2 = ScrollController();
@override
Widget build(BuildContext context) {
return VirtualKeyboardScaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
SizedBox(
width: 300,
child: VirtualKeyboardInput(
inputController: _textEditingController,
scrollController: _scrollController,
),
),
// SizedBox(
// width: 300,
// child: VirtualKeyboardInput(
// inputController: _textEditingController2,
// scrollController: _scrollController2,
// ),
// ),
InkWell(
onTap: () {},
child: Container(
height: 50,
width: 50,
),
),
],
),
),
);
}
}