flutter Clip剪裁处理圆形

2020-08-15  本文已影响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: "Clip剪裁处理",
      theme: ThemeData(
        primaryColor: Colors.lightGreen,
      ),
      home: Scaffold(
          appBar: AppBar(
            title: Text('Clip剪裁处理圆形'),
          ),
          body: Center(
            //圆形剪裁
            child: ClipOval(
              child: SizedBox(
                width: 300,
                height: 300,
                child: Image.asset(
                  "images/8.jpeg",
                  fit: BoxFit.fill,
                ),
              ),
            ),
          )),
    );
  }
}
上一篇 下一篇

猜你喜欢

热点阅读