39 lines
828 B
Markdown
39 lines
828 B
Markdown
# floating_search_bar_example
|
|
|
|
Demonstrates how to use the floating_search_bar plugin.
|
|
|
|
``` dart
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:floating_search_bar/floating_search_bar.dart';
|
|
|
|
void main() => runApp(MyApp());
|
|
|
|
class MyApp extends StatefulWidget {
|
|
@override
|
|
_MyAppState createState() => _MyAppState();
|
|
}
|
|
|
|
class _MyAppState extends State<MyApp> {
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return MaterialApp(
|
|
home: FloatingSearchBar.builder(
|
|
itemCount: 100,
|
|
itemBuilder: (BuildContext context, int index) {
|
|
return ListTile(
|
|
leading: Text(index.toString()),
|
|
);
|
|
},
|
|
trailing: CircleAvatar(
|
|
child: Text("RD"),
|
|
),
|
|
drawer: Drawer(
|
|
child: Container(),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
``` |