Search Layout in Flutter

Search Layout in Flutter: This flutter tutorial post is search layout how to create in flutter. This common use mobile application. For example, ListView search perticular data.

  • RawMaterialButton search button
    RawMaterialButton(
    constraints: BoxConstraints.tight(Size(42, 42)),
    onPressed: null,
    child: Icon(Icons.search, size: 21, color: Colors.white),
    shape: new CircleBorder(),
    elevation: 0.0,
    fillColor: Colors.blueAccent,

Screenshot :

Search Layout in Flutter

main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        title: 'Flutter Tutorial',
        theme: ThemeData(
          primarySwatch: Colors.blue,
        ),
        home: MyHomePage(title: 'Flutter Search Layout'));
  }
}

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(
        appBar: AppBar(title: Text(widget.title)),
        body: Center(
          child: Container(
            decoration: BoxDecoration(
              color: Colors.grey.withOpacity(0.1),
              borderRadius: BorderRadius.circular(32.5),
            ),
            height: 55,
            child: Stack(
              children: <Widget>[
                Padding(
                  padding: EdgeInsets.only(top: 17, left: 20),
                  child: Text("Search for flutter tutorial",
                      style: TextStyle(fontSize: 16, color: Colors.black)),
                ),
                Padding(
                    padding: EdgeInsets.only(left: 260, top: 4, right: 5),
                    child: RawMaterialButton(
                      constraints: BoxConstraints.tight(Size(42, 42)),
                      onPressed: null,
                      child: Icon(Icons.search, size: 21, color: Colors.white),
                      shape: new CircleBorder(),
                      elevation: 0.0,
                      fillColor: Colors.blueAccent,
                    ))
              ],
            ),
          ),
        ));
  }
}

The flutter tutorial  is a website that bring you the latest and amazing resources of code. All the languages codes are included in this website. The languages like flutter, android, java,kotlin etc.with the help of this languages any user can develop the beautiful application

For more information about Flutter. visit www.fluttertutorial.in