ClipRRect圆角矩形剪裁

2020-08-12  本文已影响0人  喜剧收尾_XWX
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return MaterialApp(
      title: "ClipRRect圆角矩形剪裁",
      theme: ThemeData(
        primaryColor: Colors.lightGreen,
      ),
      home: Scaffold(
          appBar: AppBar(
            title: Text('ClipRRect圆角矩形剪裁'),
          ),
          body: Center(
            //圆形剪裁
            child: ClipRRect(
              borderRadius: BorderRadius.all(Radius.circular(30.0)),
              child: SizedBox(
                width: 300,
                height: 300,
                child: Image.asset(
                  "images/8.jpeg",
                  fit: BoxFit.fill,
                ),
              ),
            ),
          )),
    );
  }
}
上一篇下一篇

猜你喜欢

热点阅读