Skip to content

Instantly share code, notes, and snippets.

@rofrankel
Created February 25, 2020 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rofrankel/c8307fcf994dddd4c3793b1ca2f92666 to your computer and use it in GitHub Desktop.
Save rofrankel/c8307fcf994dddd4c3793b1ca2f92666 to your computer and use it in GitHub Desktop.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:search_widget/search_widget.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'SearchWidget test',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'SearchWidget test'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: SearchWidget(
dataList: ['apple', 'banana', 'carrot'],
popupListItemBuilder: (item) => Text('$item'),
selectedItemBuilder: (item, del) => Text(item),
queryBuilder: null),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment