File tree Expand file tree Collapse file tree 4 files changed +6
-19
lines changed
lib/workspace/presentation Expand file tree Collapse file tree 4 files changed +6
-19
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class NewAppButton extends StatelessWidget {
2020 hoverColor: Colors .transparent,
2121 fontColor: Theme .of (context).colorScheme.onSurfaceVariant,
2222 onPressed: () async => await _showCreateAppDialog (context),
23- heading: svgWithSize ("home/new_app" , const Size (16 , 16 )),
23+ heading: svgWidget ("home/new_app" , size : const Size (16 , 16 )),
2424 padding: EdgeInsets .symmetric (horizontal: Insets .l, vertical: 20 ),
2525 );
2626
Original file line number Diff line number Diff line change @@ -207,8 +207,8 @@ class MenuTopBar extends StatelessWidget {
207207 return Container ();
208208 }
209209 return (Theme .of (context).brightness == Brightness .dark
210- ? svgWithSize ("flowy_logo_dark_mode" , const Size (92 , 17 ))
211- : svgWithSize ("flowy_logo_with_text" , const Size (92 , 17 )));
210+ ? svgWidget ("flowy_logo_dark_mode" , size : const Size (92 , 17 ))
211+ : svgWidget ("flowy_logo_with_text" , size : const Size (92 , 17 )));
212212 }
213213
214214 @override
Original file line number Diff line number Diff line change @@ -118,7 +118,7 @@ class _CurrentIcon extends StatelessWidget {
118118 margin: const EdgeInsets .all (5.0 ),
119119 decoration:
120120 BoxDecoration (border: Border .all (color: Colors .grey)),
121- child: svgWithSize ('emoji/$iconUrl ' , const Size (60 , 60 )),
121+ child: svgWidget ('emoji/$iconUrl ' , size : const Size (60 , 60 )),
122122 )),
123123 ])),
124124 );
Original file line number Diff line number Diff line change 11import 'package:flutter/widgets.dart' ;
22import 'package:flutter_svg/flutter_svg.dart' ;
33
4- Widget svgWithSize (String name, Size size) {
5- return SizedBox .fromSize (
6- size: size,
7- child: svgWidget (name),
8- );
9- }
10-
114Widget svgWidget (String name, {Size ? size, Color ? color}) {
125 if (size != null ) {
136 return SizedBox .fromSize (
147 size: size,
15- child: _svgWidget ( name, color: color),
8+ child: SvgPicture . asset ( 'assets/images/$ name .svg' , color: color),
169 );
1710 } else {
18- return _svgWidget ( name, color: color);
11+ return SvgPicture . asset ( 'assets/images/$ name .svg' , color: color);
1912 }
2013}
21-
22- Widget _svgWidget (String name, {Color ? color}) {
23- final Widget svg = SvgPicture .asset ('assets/images/$name .svg' , color: color);
24-
25- return svg;
26- }
You can’t perform that action at this time.
0 commit comments