reveal_search_bar 0.2.1 copy "reveal_search_bar: ^0.2.1" to clipboard
reveal_search_bar: ^0.2.1 copied to clipboard

outdated

simple appbar transition to appbar with textField.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:reveal_search_bar/RevealSearchBar.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Directionality(
      textDirection: TextDirection.ltr,
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'Flutter Demo',
        theme: ThemeData(
          primarySwatch: Colors.blue,
          accentColor: Colors.amber,
          // visualDensity: VisualDensity.adaptivePlatformDensity,
        ),
        home: MyHomePage(title: 'Flutter Demo Home Page'),
      ),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;
  TextEditingController controller;
  bool isRTL = false;

  @override
  void initState() {
    controller = TextEditingController();
    super.initState();
  }

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Directionality(
      textDirection: isRTL ? TextDirection.rtl : TextDirection.ltr,
      child: Scaffold(
        appBar: RevealAppBar(
          searchController: controller,
          title: Text(widget.title),
        ),
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text(
                'You have pushed the button this many times:',
              ),
              Text(
                '$_counter',
                style: Theme.of(context).textTheme.headline4,
              ),
              FlatButton(
                child: Text(isRTL ? 'rtl' : 'ltr'),
                onPressed: () {
                  setState(() {
                    isRTL = !isRTL;
                  });
                },
              )
            ],
          ),
        ),
        floatingActionButton: FloatingActionButton(
          onPressed: _incrementCounter,
          tooltip: 'Increment',
          child: Icon(Icons.add),
        ),
      ),
    );
  }
}
7
likes
40
points
30
downloads

Publisher

unverified uploader

Weekly Downloads

simple appbar transition to appbar with textField.

Homepage
Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, pedantic

More

Packages that depend on reveal_search_bar