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

container boxdecoration

时间:2019-06-06 22:40:07      阅读:160      评论:0      收藏:0      [点我收藏+]

标签:caff   icon   pread   app   sha   lis   border   text   import   

import ‘package:flutter/material.dart‘;

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: HomePage(),
);
}
}

class HomePage extends StatefulWidget {
@override
_HomePageState createState() => _HomePageState();
}

class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(‘DemoK‘),
),
body: Center(
child: Container(
width: 100,
height: 100,
decoration: BoxDecoration(
border: Border.all(color: Colors.green, width: 10),
shape: BoxShape.circle,
gradient: RadialGradient(colors: [Colors.redAccent,Colors.blueAccent]),
boxShadow: [
BoxShadow(
color: const Color(0xFFd0d0d0),
blurRadius: 1.0,
spreadRadius: 2.0,
offset: Offset(10.0, 10.0),
),
BoxShadow(
color: Colors.redAccent,
blurRadius: 2.0,
spreadRadius: 6.0,
offset: Offset(-20.0, -20.0),
),
]
),
child: InkWell(
onTap: () {
setState(() {
showDialog(
context: context,
builder: (data) {
return SimpleDialog(
backgroundColor: Colors.orange,
title: Text(‘我是对话框‘),
children: <Widget>[
ListTile(
title: Text(‘hello‘),
subtitle: Text(‘hi,lihua!‘),
),
],
);
});
});
},
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Icon(Icons.add),
Text(
‘hello‘,
),
],
),
),
),
),
),
);
}
}

container boxdecoration

标签:caff   icon   pread   app   sha   lis   border   text   import   

原文地址:https://www.cnblogs.com/braveheart007/p/10986978.html

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