When I run my code the svg does not appear. I already added flutter_svg: ^0.19.0
to the dependencies.
How can i solve this?
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
class HomeScreen extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
leading: Builder(
builder: (BuildContext context) {
return IconButton(
icon: SvgPicture.asset('assets/icons/home.svg'),
onPressed: () { Scaffold.of(context).openDrawer(); },
tooltip: MaterialLocalizations.of(context).openAppDrawerTooltip,
);
},
),
)
);
} }
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments