Advertisement
AnoTest

SearchBar_2

Mar 7th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 1.24 KB | None | 0 0
  1. //Made by Samir
  2.  
  3.  
  4.         //title: Text('PAYS'),
  5.         //centerTitle: true,
  6.         title: !isSearching
  7.             ? Text('Statistiques')
  8.             : TextField(
  9.                 decoration: InputDecoration(
  10.                     icon: Icon(
  11.                       Icons.search,
  12.                       color: Colors.white,
  13.                     ),
  14.                     hintText: 'Nom du pays',
  15.                     hintStyle: TextStyle(
  16.                       color: Colors.white,
  17.                     )),
  18.               ),
  19.         centerTitle: true,
  20.         actions: [
  21.           isSearching
  22.               ? IconButton(
  23.                   icon: Icon(Icons.cancel),
  24.                   onPressed: () {
  25.                     setState(() {
  26.                       this.isSearching = false;
  27.                     });
  28.                   })
  29.               : IconButton(
  30.                   icon: Icon(Icons.search),
  31.                   onPressed: () {
  32.                     showSearch(
  33.                         context: null,
  34.                         delegate: NameSearch(covidAllDataCountries));
  35.                     setState(() {
  36.                       this.isSearching = true;
  37.                     });
  38.                   },
  39.                 ),
  40.         ],
  41.       ),
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement