Flutter 通过 ClipRRect 为图片添加圆角
效果图:
代码:
import 'package:flutter/material.dart'; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: Scaffold( appBar: AppBar( title: Text('Flutter 网络图片'), ), body: Container( padding: EdgeInsets.all(10.0), child: ClipRRect( borderRadius: BorderRadius.circular(10), child: Image.network( 'https://img2018.cnblogs.com/i-beta/1383776/202001/1383776-20200117095609236-1518371407.png' ), ), ) ), ); } }