-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated icons in BottomNavigationBar #11
base: master
Are you sure you want to change the base?
Conversation
lib/widgets/svg_icon.dart
Outdated
import 'package:flutter_svg/flutter_svg.dart'; | ||
|
||
class SvgIcon extends StatelessWidget { | ||
const SvgIcon( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add default parameters to this constructor, so it will be possible to control color and size not only with theme:
const SvgIcon(
this.iconPath,
this.iconColor = null,
this.iconWidth = null,
this.iconHeight = null
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or let's keep it as is, but rename to something like BottomBarIcon and use it only there?
lib/widgets/svg_icon.dart
Outdated
Widget build(BuildContext context) { | ||
return SvgPicture.asset( | ||
iconPath, | ||
color: IconTheme.of(context).color, | ||
width: IconTheme.of(context).size, | ||
height: IconTheme.of(context).size, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of 3 times call IconTheme.of(context) it would be nice to create local variable and retrieve properties from local object.
var iconThemeData = IconTheme.of(context);
And then in constructor - color = iconThemeData.color
No description provided.