container boxdecoration

Posted braveheart007

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了container boxdecoration相关的知识,希望对你有一定的参考价值。

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的主要内容,如果未能解决你的问题,请参考以下文章

Bootstrap .container 和 .container-fluid 类有啥区别?

HashSet的contains()和ArrayList的contains()方法哪个更快一些?

.Container与.container_fluid区别

如何登录到Docker的container中

.container_fluid 与 .container 的区别

Java AWT 图形界面编程Container 容器 ① ( Container 容器类子类 | Component 组件类常用 API | Container 容器类常用 API )