码迷,mamicode.com
首页 > 其他好文 > 详细

flutter 局部文字更新

时间:2020-01-12 00:23:26      阅读:86      评论:0      收藏:0      [点我收藏+]

标签:override   column   style   col   ret   rri   color   child   oid   

 

import package:flutter/material.dart;

void main() {
  print("5hahahha");
  runApp(new MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    print("4hahahha");
    return new MaterialApp(
      home: new TestWidget(),
    );
  }
}

class TestWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    print("3hahahha");
    return _TestWidgetState();
  }
}

class _TestWidgetState extends State<TestWidget> {
  int _count=0;
  @override
  Widget build(BuildContext context) {
    print("0hahahha");
    return Center(
      child: Column(
        children: <Widget>[
          Text((_count).toString()),
          RaisedButton(
            onPressed: () {
              setState(() {
                print("1hahahha");
                _count++;
              });
            },
          )
        ],
      ),
    );
  }
}

 

flutter 局部文字更新

标签:override   column   style   col   ret   rri   color   child   oid   

原文地址:https://www.cnblogs.com/sea-stream/p/12181465.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!