我正在使用 path_drawing 包从 Flutter 中的 SVG 获取路径。从 SVG 数据中提取路径后,它将其返回给 ClipPath 小部件,后者使用该路径来剪辑容器。之后,我增加了 Container 的宽度和高度,这不会增加 SVG 的大小。如何更改 SVG 的大小?
import 'package:flutter/material.dart';
import 'package:path_drawing/path_drawing.dart';
void main() => runApp(MaterialApp(
home: MyApp(),
));
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
//Container enclosed in ClipPath which uses Practice Clip as a clipper
child: ClipPath(
clipper: PracticeClip(),
child: Container(
//Container color
color: Colors.red,
//width and height of …Run Code Online (Sandbox Code Playgroud)