Giter Club home page Giter Club logo

keyboard_attachable's People

Contributors

diegorogel avatar drogel avatar faiyyaz avatar jjagg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

keyboard_attachable's Issues

How to add floating button?

Hey thanks for the library.

But i want to use a floating button with this library but unable to do so. Can you guide me?

Exception when using KeyboardAttachable widget

Hey @drogel,
Thank you for your great efforts on this, really appreciate it!

I'm trying to use keyboard_attachable in my app and looks like I found the bug.

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building SizeTransition(animation: AnimationController#e3d5d(▶
flutter: 0.852)➩Interval(-2.1699839633447886⋯1.0), dirty, state: _AnimatedState#c78fd):
flutter: 'package:flutter/src/animation/curves.dart': Failed assertion: line 180 pos 12: 'begin >= 0.0': is
flutter: not true.

Looks like the problem is in this line: https://github.com/drogel/keyboard_attachable/blob/master/lib/src/keyboard_attachable.dart#L143

The _animationBegin is calculated to -2.1699839633447886 (that's why it fails), _bottomInset to 877.3479066666666.

This is the actual screenshot.
telegram-cloud-photo-size-2-5456393729662367016-y

And this is how it should be.
telegram-cloud-photo-size-2-5456393729662367018-y

Could you please take a look?

Thanks in advance.

Footer do not stick to iOS Keyboard

When I try the repo example on iOS physical device, I have the keyboard & footer that shows at a different speed.
How can I please fix this?

RPReplay_Final1650598264.mov

offset incorrect with `bottomNavigationBar` in scaffold

To reproduce:

  1. Clone the example

  2. add bottomNavigationBar: Container(height: 20,), to the scaffold

  3. observe the textbox floating 20 units above the keyboard (see screenshot)
    Screen Shot 2021-06-20 at 11 33 06 PM

  4. Notice that the added container is still on the bottom of the screen, where it should be - it's just for whatever reason, the KeyboardAttachable uses it's height (in this case, 20) to calculate it's position when the keyboard is up.

Intended behavior:

The keyboard goes over the bottom navigation bar and the text box is still stickied above the keyboard.

This is blocking me from using this (otherwise incredibly helpful!) package. I have a footer in my app and want to use this package to solve a bug where the text box is not stickied properly.

Add an example for transitionBuilder

Hey,

Thanks for the great library. Can you just add an example on how to use transitionBuilder, because currently i am trying to but it hides my ui instead of showing the beginning.

I used this for transitionBuilder

transitionBuilder: (
          Widget child,
          Animation<double> animation,
          double keyboardHeight,
        ) {
          return FadeTransition(
            child: child,
            opacity: animation,
          );
        },

Add builder suggestions

hi, I think this is very good, thank you very much, but I think the current use is limited, maybe it can be done like this:
KeyboardAttachable (builder: (double keyboardHeight) {
return someWidget (...);
})
What do you think?

[Question] Animation while sliding the keyboard out

I have a common messaging screen layout.

This package works expected. (Thanks!)

And I tried to enhance the behaviour with flutter_interactive_keyboard

ezgif com-resize

The result is not bad. But obviously what I need here is snapping the footer widget to the bottom while keyboard position updates rather than animated between two values when focus changed.

Is there any idea?

How can I reduce the space taken by the widget inside KeyboardAttachableFooter

I only have a TextField inside the KeyboardAttachableFooter widget:

  keyboardAttachableFooter() => KeyboardAttachable(
        child: Container(
          padding: const EdgeInsets.all(10),
          child: const TextField(
            decoration: InputDecoration(
              prefixIcon: Icon(Icons.search_rounded),
              hintText: 'Find',
              border: OutlineInputBorder(),
            ),
          ),
        ),
      );

This is how my scaffold looks like:

      Scaffold(
        appBar: _appBar(context),
        body: SafeArea(
          maintainBottomViewPadding: true,
          child: FooterLayout(
            footer: keyboardAttachableFooter(),
            child: body,
          ),
        ),
        persistentFooterButtons: _persistentFooter(context),
        bottomNavigationBar: _bottomToolBelt(context),
        resizeToAvoidBottomInset: false,
      );

On widget build, it looks fine (I see the TextField at the bottom, above the persistentFooterButtons and the bottomNavigationBar).

When I click/tap the text-field, the soft-keyboard shows up and the TextField transitions above it. However, there is too much space below the TextField. See this:

Screenshot 2023-03-30 at 13 08 02

Any idea what is causing it, and how can I remove the extra spacing? According to Flutter widget inspector, this space is occupied by the KeyboardAttachableFooter widget.

The child element is not rendered

My code:

Scaffold( resizeToAvoidBottomInset: false, body: FooterLayout( footer: Container( child: InputField(controller: null, placeholder: 'Type Here'), ), child: Text('PRUEBA'), ), ), );

The result:

image

The text widget with PRUEBA is not shown

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.5, on Microsoft Windows [Version 10.0.18363.1016], locale es-AR)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code, 64-bit edition (version 1.48.2)
[√] Connected device (2 available)

• No issues found!

KeyboardAttachable widget overlaps System Navigation Bar

Hi, I'm trying to use keyboard attachable in landscape orientation (left & right), but seems like the KeyboardAttachable widget overlaps the system navigation bar as below images:

image

image

This happens in both Android simulator & real device.

I have tried wrapping the FooterLayout & KeyboardAttachable inside a SafeArea, but no luck. Any chance I'm missing a configuration for the widget?

Thank you.

Ferry

KeyboardAttachable throws RenderBox exception on Navigator pop.

So basically I am using the using the package as so:

@override
  Widget build(BuildContext context) {
    final size = MediaQuery.of(context).size;
    return FooterLayout(
      footer: KeyboardAttachable(
        child: _backButton(context),
      ),
      child: SizedBox(
        height: size.height,
        width: size.width,
        child: const Body(),
      ),
    );
  }

  Widget _backButton(BuildContext context) {
    return TextButton(
      onPressed: () {
        FocusManager.instance.primaryFocus?.unfocus();
        Navigator.of(context).pop();
      },
      child: Text('Go back'),
    );
  }

For some reason, the ``Navigator.of(context).pop();` cause this exception to be thrown:

════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building KeyboardAttachable(dirty, dependencies: [MediaQuery], state: _KeyboardAttachableState#8173b(ticker inactive)):
RenderBox was not laid out: RenderFittedBox#193dd NEEDS-LAYOUT NEEDS-PAINT NEEDS-COMPOSITING-BITS-UPDATE
'package:flutter/src/rendering/box.dart':
package:flutter/…/rendering/box.dart:1
Failed assertion: line 1979 pos 12: 'hasSize'

2

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was
KeyboardAttachable

I am really not sure why this is occurring. I have tried to specify a size for the back button the error still occurs.

How can I fix this?

[Question]footer does not move when the keyboard moves up and down

hi
footer does not move when the keyboard moves up and down.

I don't know what's wrong
If you know anything, please tell me

class InputUserNameScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return StateNotifierProvider<InputUserNameScreenController, InputUserNameScreenState>(
        create: (_) => InputUserNameScreenController(),
        builder: (context, _) {
          return KeyboardDismisser(
            gestures: [GestureType.onTap],
            child: FooterLayout(
              child: Scaffold(
                backgroundColor: Colors.white,
                body: Column(
                  children: <Widget>[
                    SizedBox(height: 142),
                    Text(
                      '名前を教えて!',
                      textAlign: TextAlign.center,
                      style: TextStyle(
                          color: Color(0xFF102B7C),
                          fontWeight: FontWeight.bold,
                          fontSize: 22
                      ),
                    ),
                    SizedBox(height: 57),
                    Padding(
                      padding: const EdgeInsets.symmetric(horizontal: 34),
                      child: LargeTextField(
                        hintText: 'あなたの名前',
                        onChanged: (text) {
                          context.read<InputUserNameScreenController>()
                              .onChangeName(text);
                        },
                      ),
                    )
                  ],
                ),
              ),
              footer: Container(
                color: Colors.white,
                child: Padding(
                  padding: EdgeInsets.only(left: 92, bottom: 26, right: 92),
                  child: Button(
                    title: '次へ',
                    onPressed: () {
                      context.read<InputUserNameScreenController>().onTapNext(
                          onComplete: (draft) {
                            Navigator.of(context).push(
                              MaterialPageRoute(
                                  builder: (context) => InputAddressIDScreen(draft: draft)
                              ),
                            );
                          },
                          onError: (error) {
                            showDialog(
                              context: context,
                              builder: (_) {
                                return NormalDialog(
                                  title: '名前の入力',
                                  message: error,
                                  onOkPressed: () {
                                    Navigator.pop(context);
                                  },
                                );
                              },
                            );
                          },
                      );
                    },
                  ),
                ),
              ),
            ),
          );
        },
    );
  }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.