我的代码和结果
class WeatherScreen extends StatelessWidget {
const WeatherScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
centerTitle: true,
title: const Text(
'Weather App',
style: TextStyle(fontWeight: FontWeight.bold),
),
actions: [
IconButton(onPressed: () {}, icon: const Icon(Icons.refresh))
],
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child: Column(
children: [
//main card
SizedBox(
width: double.infinity,
child: Card(
elevation: 2,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(16),
),
child: BackdropFilter(
filter: ImageFilter.blur(sigmaX: 5, sigmaY: 5),
child: const Padding(
padding: EdgeInsets.all(16.0),
child: Column(
children: [
Text(
'20 °C',
style: TextStyle(
fontSize: 32, fontWeight: FontWeight.bold),
),
SizedBox(
height: 16,
),
Icon(
Icons.cloud,
size: 64,
),
SizedBox(
height: 16,
),
Text(
'Rain',
style: TextStyle(fontSize: 20),
),
],
),
),
),
),
),
SizedBox(
height: 20,
),
//weather cards
Placeholder(
fallbackHeight: 150,
),
SizedBox(
height: 20,
),
//additional information
Placeholder(
fallbackHeight: 150,
),
],
),
),
);
}
}
字符串
的数据
在作者的视频中,一切看起来都很好,我重复了他所有的动作,但由于某种原因看起来是这样的
1条答案
按热度按时间x0fgdtte1#
您可以在卡上包含
clipBehavior: Clip.antiAlias
以获得您想要的用户界面。默认值为Clip.none
字符串