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

Dialog that moves up automaticly when soft keyboard shows. Contains three variants.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_keyboard_aware_dialog/flutter_keyboard_aware_dialog.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: 'Demo',
      home: HomePage(),
    );
  }
}

class HomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<HomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Keyboard Aware Dialog"),
      ),
      body: Center(
        child: RaisedButton(
          child: Text("Show Dialog!"),
          onPressed: () {
            showDialog(
              context: context,
              builder: (context) => KeyboardAwareDialog(
                // This line
                child: Padding(
                  padding: const EdgeInsets.only(top: 16, left: 16, right: 16),
                  child: Column(
                    mainAxisSize: MainAxisSize.min,
                    crossAxisAlignment: CrossAxisAlignment.start,
                    children: <Widget>[
                      Text(
                        "Title",
                        style: Theme.of(context).textTheme.headline6,
                      ),
                      TextField(),
                      ButtonBar(
                        children: <Widget>[
                          FlatButton(
                            child: Text("Nice!"),
                            onPressed: () => Navigator.pop(context),
                          ),
                        ],
                      ),
                    ],
                  ),
                ),
              ),
            );
          },
        ),
      ),
    );
  }
}
8
likes
35
pub points
42%
popularity

Publisher

unverified uploader

Dialog that moves up automaticly when soft keyboard shows. Contains three variants.

Repository (GitHub)
View/report issues

License

WTFPL, BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on flutter_keyboard_aware_dialog