Skip to content

Instantly share code, notes, and snippets.

@furkantoptass
Last active April 13, 2021 09:33
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 furkantoptass/b225c2133037aff34af3abe4d5f66bb1 to your computer and use it in GitHub Desktop.
Save furkantoptass/b225c2133037aff34af3abe4d5f66bb1 to your computer and use it in GitHub Desktop.
AnimSearchBar kullnımı
import 'package:anim_search_bar/anim_search_bar.dart';
import 'package:flutter/material.dart';
void main() async {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Anim search bar Example',
home: App(),
);
}
}
class App extends StatefulWidget {
@override
_AppState createState() => _AppState();
}
class _AppState extends State<App> {
TextEditingController textController = TextEditingController();
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.only(top: 58.0, right: 10, left: 10),
/// In AnimSearchBar widget, the width, textController, onSuffixTap are required properties.
/// You have also control over the suffixIcon, prefixIcon, helpText and animationDurationInMilli
child: AnimSearchBar(
width: 400,
textController: textController,
onSuffixTap: () {
setState(() {
textController.clear();
});
},
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment