flutter_keyboard_size 1.0.1 copy "flutter_keyboard_size: ^1.0.1" to clipboard
flutter_keyboard_size: ^1.0.1 copied to clipboard

A straightforward and convenient provider that helps get info about - keyboard height, is it open or not, set bool value is screen small or not.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_keyboard_size/flutter_keyboard_size.dart';

import 'body_of_main_screen.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    Key? key,
    required this.title,
  }) : super(key: key);

  final String title;

  @override
  MyHomePageState createState() => MyHomePageState();
}

class MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return KeyboardSizeProvider(
      smallSize: 500.0,
      child: Scaffold(
        appBar: AppBar(
          title: Text(widget.title),
        ),
        body: BodyOfMainScreen(counter: _counter),
      ),
    );
  }
}
63
likes
160
pub points
93%
popularity

Publisher

verified publisheragoradesk.com

A straightforward and convenient provider that helps get info about - keyboard height, is it open or not, set bool value is screen small or not.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, provider

More

Packages that depend on flutter_keyboard_size