Created
February 16, 2020 15:28
-
-
Save ryanlid/707941b06ee5fbdc557da402cd5ff9e5 to your computer and use it in GitHub Desktop.
ClipRRect 圆角矩形裁剪
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
void main() { | |
runApp((MyApp())); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: "ClipRRect圆角矩形裁剪示例", | |
home: Scaffold( | |
appBar: AppBar( | |
title: Text("ClipRRect圆角矩形裁剪示例"), | |
), | |
body: Center( | |
child: ClipRRect( | |
borderRadius: BorderRadius.all( | |
// 圆角弧度 | |
Radius.circular(60.0), | |
), | |
// 固定大小 | |
child: SizedBox( | |
width: 300.0, | |
height: 300.0, | |
child: Image.network( | |
"https://images.oonnnoo.com/appicons/alipay.png", | |
fit: BoxFit.fill, | |
), | |
), | |
), | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment