美文网首页
Flutter 脚手架Scaffold

Flutter 脚手架Scaffold

作者: 喜剧收尾_XWX | 来源:发表于2020-07-28 12:39 被阅读0次

    1.基本内容

    import 'package:flutter/material.dart';
    
    void main() => runApp(Myapp());
    
    class Myapp extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
        return MaterialApp(
          title: 'MaterialApp',
          home: HomePage(),
        );
      }
    }
    
    class HomePage extends StatelessWidget {
      @override
      Widget build(BuildContext context) {
        // TODO: implement build
    
        return Scaffold(
          appBar: AppBar(
            title: Text('MaterialApp'),
          ),
          body: Center(
            child: Text('MaterialApp'),
          ),
          bottomNavigationBar: BottomAppBar(
            child: Container(
              height: 300,
            ),
          ),
          floatingActionButton: FloatingActionButton(
            onPressed: () {},
            tooltip: '增加',
            child: Icon(Icons.add),
          ),
          floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
        );
      }
    }
    
    
    

    相关文章

      网友评论

          本文标题:Flutter 脚手架Scaffold

          本文链接:https://www.haomeiwen.com/subject/bzoxrktx.html