Skip to content

updated icons in BottomNavigationBar#11

Open
oleksandrakovalova wants to merge 2 commits into
masterfrom
feature/bottom_bar_icons
Open

updated icons in BottomNavigationBar#11
oleksandrakovalova wants to merge 2 commits into
masterfrom
feature/bottom_bar_icons

Conversation

@oleksandrakovalova

Copy link
Copy Markdown

No description provided.

Comment thread lib/widgets/svg_icon.dart Outdated
import 'package:flutter_svg/flutter_svg.dart';

class SvgIcon extends StatelessWidget {
const SvgIcon(

Copy link
Copy Markdown
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
Copy Markdown
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?

Comment thread lib/widgets/svg_icon.dart Outdated
Comment thread lib/widgets/svg_icon.dart Outdated
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
Copy Markdown
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