Giter Site home page Giter Site logo

Comments (15)

sososdk avatar sososdk commented on August 21, 2024 2

Hi @AymanProjects, Now the code is as expected. Maybe you need add autofocus: true in TextFormField or TextField.

Example:

    Form(
      child: TextFormField(
        controller: editingController,
        autofocus: true,
      ),
    )

from flash.

AymanProjects avatar AymanProjects commented on August 21, 2024 1

That solved the problem, Thanks β™₯

from flash.

sososdk avatar sososdk commented on August 21, 2024 1

@ming-chu try to remove barrierBlur and barrierColor, and set persistent: true.

barrierBlur and barrierColor will block the behind view.

from flash.

AymanProjects avatar AymanProjects commented on August 21, 2024

I modified the source code and it no longer hides the keyboard.
I just commented the unwanted code as shown in the image.
anyway this is not really elegant and the package is now stored locally with the my project files.
maybe you could make this feature optional ?
image

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

I have the same issue, how to prevent interrupt the typing when Flash appears?
Any help is appreciated!

from flash.

sososdk avatar sososdk commented on August 21, 2024

Hi @AymanProjects, Now the code is as expected. Maybe you need add autofocus: true in TextFormField or TextField.

Example:

    Form(
      child: TextFormField(
        controller: editingController,
        autofocus: true,
      ),
    )

@ming-chu example:

autofocus: true,

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

@sososdk Thanks for your reply.

Here is my case:
I use this lib for the top bar notification, maybe with frequency like 20 times/minutes.
when users typing and respond to the msg, this will interrupt the typing.

from flash.

sososdk avatar sososdk commented on August 21, 2024

@ming-chu which one interrupt the typing?

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

@sososdk
I am developing a chat app. I use this lib for showing new message notifications.
When Flash appears, it blocks the entire screen with overlay and closes the keyboard.
The input will focus again after the Flash is finished, but the process of typing was interrupted which cannot keep typing when the Flash show up.

It was fine on flash: ^1.3.1

from flash.

sososdk avatar sososdk commented on August 21, 2024

@ming-chu please show me the code about how to display the flash.

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

@sososdk Thanks for the reply and here is the code

showFlash(
  context: context,
  duration: const Duration(seconds: 2),
  persistent: true,
  builder: (_, controller) {
    return Flash(
      controller: controller,
      backgroundColor: Colors.white,
      brightness: Brightness.light,
      boxShadows: [BoxShadow(blurRadius: 4)],
      barrierBlur: 3.0,
      barrierColor: Colors.black38,
      barrierDismissible: true,
      behavior: FlashBehavior.floating,
      position: FlashPosition.top,
      child: FlashBar(
        title: Text('You have a new msg!'),
        content: Text('hello world~'),
      ),
    );
  },
);

from flash.

sososdk avatar sososdk commented on August 21, 2024

@ming-chu try to set persistent: false .

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

after I set persistent: false it got an exception πŸ€”

E/flutter ( 5759): [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: 'package:flash/flash.dart': Failed assertion: line 98 pos 14: 'overlay != rootOverlay': overlay can't be the root overlay when persistent is false
E/flutter ( 5759): #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
E/flutter ( 5759): #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
E/flutter ( 5759): #2      new FlashController (package:flash/flash.dart:98:14)
E/flutter ( 5759): #3      showFlash (package:flash/flash.dart:25:10)

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

@ming-chu try to remove barrierBlur and barrierColor, and set persistent: true.

barrierBlur and barrierColor will block the behind view.

Thanks for the advice, I will try itπŸ‘

from flash.

ming-chu avatar ming-chu commented on August 21, 2024

@sososdk
it works!!! Thank you very much!
You are my hero!

from flash.

Related Issues (20)

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.