We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ist<Map<String, dynamic>> data1 = [];
class Mentions extends StatefulWidget { const Mentions({ Key? key, this.width, this.height, }) : super(key: key);
final double? width; final double? height;
@OverRide _MentionsState createState() => _MentionsState(); }
class _MentionsState extends State { GlobalKey key = GlobalKey(); Future apicall() async { http.Response response; var url = "https://7J8Y54OD18-dsn.algolia.net/1/indexes/users"; response = await http.get(Uri.parse(url), headers: { 'X-Algolia-API-Key': '841e31106f80e21b89b0d2b9ec7cd561', 'X-Algolia-Application-Id': '7J8Y54OD18' }); if (response.statusCode == 200) { setState(() { jsonMap = json.decode(response.body); (jsonMap['hits'] as List).forEach((x) => {data.add(Map.from(x))}); for (int i = 0; i < data.length; i++) { data1 .add({'id': data[i]["objectID"], 'display': data[i]["username"]}); } }); } else { string = "fsfwe"; } }
void generatedata() {}
@OverRide void initState() { apicall();
super.initState();
}
@OverRide Widget build(BuildContext context) { return Portal( child: Scaffold( appBar: AppBar( title: Text("flutter mention"), ), body: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ Text(data1.length.toString()), Container( child: FlutterMentions( key: key, suggestionPosition: SuggestionPosition.Top, maxLines: 5, minLines: 3, decoration: InputDecoration(hintText: 'hello'), mentions: [ Mention( trigger: '@', style: TextStyle( color: Colors.amber, ), data: data1, matchAll: false, suggestionBuilder: (data1) { return Container( padding: EdgeInsets.all(10.0), child: Row( children: [ SizedBox( width: 20.0, ),
The text was updated successfully, but these errors were encountered:
No branches or pull requests
ist<Map<String, dynamic>> data1 = [];
class Mentions extends StatefulWidget {
const Mentions({
Key? key,
this.width,
this.height,
}) : super(key: key);
final double? width;
final double? height;
@OverRide
_MentionsState createState() => _MentionsState();
}
class _MentionsState extends State {
GlobalKey key = GlobalKey();
Future apicall() async {
http.Response response;
var url = "https://7J8Y54OD18-dsn.algolia.net/1/indexes/users";
response = await http.get(Uri.parse(url), headers: {
'X-Algolia-API-Key': '841e31106f80e21b89b0d2b9ec7cd561',
'X-Algolia-Application-Id': '7J8Y54OD18'
});
if (response.statusCode == 200) {
setState(() {
jsonMap = json.decode(response.body);
(jsonMap['hits'] as List).forEach((x) => {data.add(Map.from(x))});
for (int i = 0; i < data.length; i++) {
data1
.add({'id': data[i]["objectID"], 'display': data[i]["username"]});
}
});
} else {
string = "fsfwe";
}
}
void generatedata() {}
@OverRide
void initState() {
apicall();
}
@OverRide
Widget build(BuildContext context) {
return Portal(
child: Scaffold(
appBar: AppBar(
title: Text("flutter mention"),
),
body: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Text(data1.length.toString()),
Container(
child: FlutterMentions(
key: key,
suggestionPosition: SuggestionPosition.Top,
maxLines: 5,
minLines: 3,
decoration: InputDecoration(hintText: 'hello'),
mentions: [
Mention(
trigger: '@',
style: TextStyle(
color: Colors.amber,
),
data: data1,
matchAll: false,
suggestionBuilder: (data1) {
return Container(
padding: EdgeInsets.all(10.0),
child: Row(
children: [
SizedBox(
width: 20.0,
),
The text was updated successfully, but these errors were encountered: