StatelessWidget:flutter无状态组件 - Sat, Sep 21, 2019
StatelessWidget:flutter无状态组件
1. 概述
StatelessWidget
是flutter的无状态组件,是flutter的静态组件。
example代码位置: example
2. 代码模板
import 'package:flutter/material.dart';
class MyStatelessWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Stateless Widget'),
),
body: ListView(),
);
}
}