Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

oleksandrakovalova
Copy link

No description provided.

import 'package:flutter_svg/flutter_svg.dart';

class SvgIcon extends StatelessWidget {
const SvgIcon(
Copy link
Member

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
);

Copy link
Member

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 Show resolved Hide resolved
Comment on lines 12 to 17
Widget build(BuildContext context) {
return SvgPicture.asset(
iconPath,
color: IconTheme.of(context).color,
width: IconTheme.of(context).size,
height: IconTheme.of(context).size,
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants