zoukankan      html  css  js  c++  java
  • 底部导航栏1

    代码

    import 'package:flutter/material.dart';

    class BottomNavigationWidget extends StatefulWidget {
    _BottomNavigationWidgetState createState() => _BottomNavigationWidgetState();
    }

    class _BottomNavigationWidgetState extends State<BottomNavigationWidget> {
    final _bottomNavColor = Colors.blue;
    @override
    Widget build(BuildContext context) {
    return Scaffold(
    bottomNavigationBar: BottomNavigationBar(
    items: [
    BottomNavigationBarItem(
    icon: Icon(
    Icons.home,
    color: _bottomNavColor,
    ),
    title: Text(
    'home',
    style: TextStyle(color: _bottomNavColor),
    )
    ),
    BottomNavigationBarItem(
    icon: Icon(
    Icons.email,
    color: _bottomNavColor,
    ),
    title: Text(
    'Email',
    style: TextStyle(color: _bottomNavColor),
    )
    ),
    BottomNavigationBarItem(
    icon: Icon(
    Icons.airplay,
    color: _bottomNavColor,
    ),
    title: Text(
    'Airplay',
    style: TextStyle(color: _bottomNavColor),
    )
    ),
    BottomNavigationBarItem(
    icon: Icon(
    Icons.scanner,
    color: _bottomNavColor,
    ),
    title: Text(
    'Scnner',
    style: TextStyle(color: _bottomNavColor),
    )
    )
     
    ],
    ),
    );
    }
    }
     
    总结:

    //底部导航栏

    final _变量名a = Color.bule;

    BottomNavigationBarItem(

    item:[

    BottomNavigationBarItem(

    icon:Icon(

    Icons.xxx //系统样式

    color:_变量名a

    )

    )

     

    ]

    )

     

    在当前目录下 例如 lib 新建一个dart文件 右键 file  xxx.dart

    引用其他文件 ,先import 文件 即可直接使用新文件下的class 

     

    继承Statefulwidge 动态继承 ????和 statlessWidget的区别 没搞明白

     

  • 相关阅读:
    mysql练习题
    转 -day19--form&modelform
    day20--注册功能及首页
    day19-form表单&auth模块、项目初识
    day15-pymysql模块的使用
    第14天jquery+bootstrap
    第13天-js+jquery
    iTween基础之Punch(摇晃)
    iTween基础之Audio(音量和音调的变化)
    iTween基础之Rotate(旋转角度)
  • 原文地址:https://www.cnblogs.com/pp-pping/p/12172612.html
Copyright © 2011-2022 走看看