I have a chat screen text box and a button. I want user to be able to select gif offered by keyboard and then insert into chat screen.
TextFormField does not allow user to select GIF. Code is as follows:
video link is https://imgur.com/MKJNH1A
Error - testapp doesn't support image insertion here.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Container(
child: TextFormField(),
),
),
),
);
}
}
In this flutter example tutorial we are going to learn load gif images in flutter application. Gif images are used to display animated graphics with multiple objects. Normally animate images will display in web browsers. in this we will show you load gif images in flutter application.
Flutter's TextField
, TextFormField
or any text input boxes do not accept characters other than the ones specified in Unicode.
To use GIFs, images or any other widgets in a TextField, try using extended_text_field
package.This is NOT an official package but it was planed to be endorsed by the flutter team according to #30688 (comment).
extended_text_field provides a widget named SpecialText
. You could use the ImageSpan
widget to add images in the text field (which includes GIFs).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With