Skip to content

Commit

Permalink
adds features paragraph
Browse files Browse the repository at this point in the history
  • Loading branch information
drogel committed Apr 19, 2020
1 parent 39954fa commit 8e82eff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ A Flutter package to build widgets that can be attached to the soft keyboard.

## Features

* An alternative to Scaffold's `resizeToAvoidBottomInset`, with animations.
* Animate the shrinkage and expansion of the page when the soft keyboard is shown and hidden, matching the platform soft keyboard animation.
* Easily add permanent page footers that can be attached to the top of the soft keyboard.

## Usage

Expand Down
6 changes: 3 additions & 3 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ class KeyboardAttachablePage extends StatelessWidget {
class KeyboardAttachableFooter extends StatelessWidget {
@override
Widget build(BuildContext context) => KeyboardAttachable(
backgroundColor: Colors.blueAccent[700],
backgroundColor: Colors.blue,
child: Container(
padding: const EdgeInsets.all(16),
color: Colors.blueAccent[700],
color: Colors.blue,
child: TextField(
decoration: InputDecoration(
hintText: "Tap me!",
Expand All @@ -50,9 +50,9 @@ class KeyboardAttachableFooter extends StatelessWidget {
class ColorsList extends StatelessWidget {
@override
Widget build(BuildContext context) => ListView.builder(
itemExtent: 66,
itemCount: Colors.primaries.length,
itemBuilder: (_, i) => Container(
height: 88,
color: Colors.primaries[i].withOpacity(0.2),
),
);
Expand Down
2 changes: 1 addition & 1 deletion example/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ packages:
path: ".."
relative: true
source: path
version: "0.0.1"
version: "1.0.0"
keyboard_visibility:
dependency: transitive
description:
Expand Down
8 changes: 6 additions & 2 deletions lib/src/keyboard_attachable.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:keyboard_attachable/keyboard_attachable.dart';
import 'package:keyboard_attachable/src/controller/keyboard_attachable_controller.dart';
import 'package:keyboard_attachable/src/controller/keyboard_attachable_injector.dart';
import 'package:keyboard_visibility/keyboard_visibility.dart';
Expand All @@ -9,9 +10,12 @@ import 'package:keyboard_visibility/keyboard_visibility.dart';
/// This widget can be used to animate its child when the soft keyboard is shown
/// or hidden, so that the child widget appears to be attached to the keyboard.
///
/// If no child widget is passed to the [KeyboardAttachable], it can still be
/// Even if no child widget is passed to [KeyboardAttachable], it can still be
/// used to animate the shrinkage and expansion of the layout when the keyboard
/// is shown an hidden, respectively.
/// is shown an hidden, respectively. In order for this to work, this widget
/// has to be attached to the bottom of the page, for example, by using a
/// [FooterLayout], and the [Scaffold.resizeToAvoidBottomInset] parameter of
/// the [Scaffold] above the page has to be set to false.
class KeyboardAttachable extends StatefulWidget {
/// Creates a widget that smoothly adds space below its child when the
/// keyboard is shown or hidden.
Expand Down

0 comments on commit 8e82eff

Please sign in to comment.