avoid_keyboard 0.1.1-alpha copy "avoid_keyboard: ^0.1.1-alpha" to clipboard
avoid_keyboard: ^0.1.1-alpha copied to clipboard

outdated

This package enables convenient keyboard avoidance. It can be used to enable keyboard avoidance for specific view regions, without compressing the entire view.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        appBar: AppBar(title: Text("Avoid Keyboard Example")),
        body: AvoidKeyboardExample(),
        resizeToAvoidBottomInset: false,
      ),
    );
  }
}

class AvoidKeyboardExample extends StatelessWidget {
  final focusNodes = [
    FocusNode(),
    FocusNode(),
    FocusNode(),
    FocusNode(),
    FocusNode(),
  ];

  @override
  Widget build(BuildContext context) {
    return AvoidKeyboard(
      focusNodes: focusNodes,
      child: Container(
        padding: EdgeInsets.all(30),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.spaceAround,
          children: focusNodes
              .map(
                (node) => TextField(
                  focusNode: node,
                ),
              )
              .toList(),
        ),
      ),
    );
  }
}
25
likes
0
points
989
downloads

Publisher

unverified uploader

Weekly Downloads

This package enables convenient keyboard avoidance. It can be used to enable keyboard avoidance for specific view regions, without compressing the entire view.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on avoid_keyboard