flutter weight demo
  sA55qgboe2zL 2023年11月02日 58 0


flutter sdk:快速下载:​​https://github.com/flutter/flutter/releases​

翻译:

StatelessWidget                 无状态小部件

Stateful                               有状态
Scaffold                               脚手架
repair                                  修理

spec                                     规格
inspector                             检查员
Malformed lineFlutter:   线路格式错误  

Because flutter_app2 depends on flutter_test any from sdk which doesn't exist (the Flutter SDK is not available), version solving failed.

由于flutter_app2依赖于flutter_test任何不存在的sdk(flutter sdk不可用),版本求解失败。

 

Flutter users should run `flutter packages get` instead of `pub get`.

用户应该运行“Flutter packages get”而不是“pub get”。

 

import 'package:flutter/material.dart';

void main() {
runApp(new MaterialApp(
title: 'Flutter Tutorial',
home: new Counter(),
));
}
class MyButton extends StatelessWidget {
@override
Widget build(BuildContext context) {
return new GestureDetector(
onTap: () {
print('MyButton was tapped!');
},
child: new Container(
height: 36.0,
padding: const EdgeInsets.all(8.0),
margin: const EdgeInsets.symmetric(horizontal: 8.0),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(5.0),
color: Colors.lightGreen[500],
),
child: new Center(
child: new Text('Engage'),
),
),
);
}
}
class Counter extends StatefulWidget {
// This class is the configuration for the state. It holds the
// values (in this nothing) provided by the parent and used by the build
// method of the State. Fields in a Widget subclass are always marked "final".

@override
_CounterState createState() => new _CounterState();
}

class _CounterState extends State<Counter> {
int _counter = 0;

void _increment() {
setState(() {
// This call to setState tells the Flutter framework that
// something has changed in this State, which causes it to rerun
// the build method below so that the display can reflect the
// updated values. If we changed _counter without calling
// setState(), then the build method would not be called again,
// and so nothing would appear to happen.
_counter++;
});
}

@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance
// as done by the _increment method above.
// The Flutter framework has been optimized to make rerunning
// build methods fast, so that you can just rebuild anything that
// needs updating rather than having to individually change
// instances of widgets.
return new Row(
children: <Widget>[
new RaisedButton(
onPressed: _increment,
child: new Text('Increment'),
),
new Text('Count: $_counter'),
],
);
}
}
class MyButton1 extends StatelessWidget{
@override
Widget build(BuildContext context) {
// TODO: implement build
return new GestureDetector(
onTap: (){
print("on top");
},
child: new Container(
height: 55,
width: 33,
padding: EdgeInsets.all(6),
margin: EdgeInsets.all(3),
decoration: new BoxDecoration(
borderRadius: new BorderRadius.circular(433),
),
child: new Center(
child: new Text("ceshi"),
),
),
);
}
}
class Hone extends StatelessWidget{
@override
Widget build(BuildContext context) {
// TODO: implement build
return new Scaffold(
appBar: new AppBar(
// ignore: argument_type_not_assignable
leading: new IconButton(
icon: new Icon(Icons.menu),
onPressed: null),
),
body:new Center(
child: new Text("12"),
)
);
}
}

 

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  4koL3J55wyKx   2023年11月13日   38   0   0 icogitCentOS
  b1UHV4WKBb2S   2023年11月13日   40   0   0 ide抗锯齿
  b1UHV4WKBb2S   2023年11月13日   37   0   0 裁剪ideflutter
  b1UHV4WKBb2S   2023年11月13日   29   0   0 flutterDart
  zSWNgACtCQuP   2023年11月13日   32   0   0 ide
sA55qgboe2zL