Created
May 27, 2020 13:55
-
-
Save dangngocduc/27f10cb0860ede6c8da6d280b4f917b9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'dart:developer' as developer; | |
class SearchBarWidget extends StatefulWidget implements PreferredSizeWidget { | |
static const ROUTE_NAME = 'SearchBarWidget'; | |
@override | |
_SearchBarWidgetState createState() => _SearchBarWidgetState(); | |
@override | |
Size get preferredSize => Size.fromHeight(kToolbarHeight); | |
} | |
class _SearchBarWidgetState extends State<SearchBarWidget> { | |
static const TAG = 'SearchBarWidget'; | |
@override | |
Widget build(BuildContext context) { | |
return Material( | |
color: Colors.black, | |
child: SafeArea(child: Container( | |
child: Row( | |
children: <Widget>[ | |
Expanded( | |
child: Container( | |
margin: EdgeInsets.all(8.0), | |
decoration: BoxDecoration( | |
border: Border.all(color: Colors.grey, width: 1), | |
borderRadius: BorderRadius.all(Radius.circular(12.0)), | |
), | |
child: TextField( | |
autofocus: false, | |
keyboardType: TextInputType.text, | |
decoration: InputDecoration( | |
hintText: "Search", | |
prefixIcon: Icon(Icons.search), | |
border: InputBorder.none), | |
), | |
), | |
), | |
Text("search") | |
], | |
), | |
)), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment