zoukankan      html  css  js  c++  java
  • Flutter 导航栏上添加搜索按钮

    代码:

    Widget build(BuildContext context) {
    return Scaffold(
    appBar: AppBar(
    title: Text('搜索条'),
    actions: <Widget>[//导航条右方 类似rightBarItem
    IconButton(
    icon: Icon(Icons.search),
    onPressed: (){
    print('点击了搜索');
    },
    )
    ],
     
    ),
    );
    }
    总结:
     

    //导航栏上的搜索条

    AppBar(

    actions:<widget>{//类似于OC的rightBarItem

    IconButton(

    icon:Icon(Icons.xx)

    Onpress(){

    print(‘xxx’)//控制台输出

    }

    )

     

    }

     

    )

  • 相关阅读:
    c++教程目录
    ANDROID教程目录
    ArrayBuffer
    读懂 ECMAScript 规格
    编程风格
    Module 的加载实现
    Module 的语法
    修饰器Decorator
    Class 的继承
    SQL Server 2008 R2导出数据脚本的方法
  • 原文地址:https://www.cnblogs.com/pp-pping/p/12187162.html
Copyright © 2011-2022 走看看