import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget
{
Widget build(BuildContext context)
{
const bgColor = const[Colors.red, Colors.green, Colors.blue];
return MaterialApp
(
title: "flutter Demo",
theme: ThemeData
(
primarySwatch: Colors.deepOrange,
),
home: Scaffold
(
appBar: AppBar
(
title: Text("这是APP的标题"),
),
body: Container
(
child: Wrap
(
children:
[
Chip
(
label: Text("C"),
backgroundColor: Colors.orange,
deleteIconColor: Colors.grey,
// 使用图标, 必须加上onDeleted()函数
onDeleted: ()
{
},
),
Chip
(
label: Text("C++"),
backgroundColor: Colors.pink,
),
Chip
(
label: Text("Java"),
backgroundColor: Colors.blue,
),
Chip
(
label: Text("JavaScript"),
backgroundColor: Colors.green,
),
Chip
(
label: Text("熟练使用各种语言编写HelloWorld"),
backgroundColor: Colors.orange,
// 图标
avatar: Icon(Icons.clear, color: Colors.white),
),
],
),
),
),
);
}
}