Skip to content

Commit

Permalink
feat: add notification dot to TransferHistory menu
Browse files Browse the repository at this point in the history
  • Loading branch information
sonle-geekyants committed May 13, 2022
1 parent 295e066 commit 2948525
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
4 changes: 4 additions & 0 deletions lib/screens/common_widgets/side_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ class _SideBarWidgetState extends State<SideBarWidget> {
_fileDownloadChecker.undownloadedFilesExist
? ColorConstants.orangeColor
: ColorConstants.fadedText,
showNotificationDot:
_fileDownloadChecker.undownloadedFilesExist
? true
: false,
);
},
),
Expand Down
37 changes: 29 additions & 8 deletions lib/screens/common_widgets/side_bar_list_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class SideBarItem extends StatelessWidget {
final WelcomeScreenProvider _welcomeScreenProvider = WelcomeScreenProvider();
final Color displayColor;
bool isScale;
final bool showNotificationDot;
SideBarItem(
{Key? key,
this.image,
Expand All @@ -22,6 +23,7 @@ class SideBarItem extends StatelessWidget {
this.showIconOnly = false,
this.isScale = false,
this.displayColor = ColorConstants.fadedText,
this.showNotificationDot = false,
this.isDesktop = false})
: super(key: key);
@override
Expand All @@ -42,15 +44,34 @@ class SideBarItem extends StatelessWidget {
height: 50,
child: Row(
children: [
Transform.scale(
scale: isScale ? 1.2 : 1,
child: Image.asset(
image!,
height: SizeConfig().isTablet(context) ? 24 : 22.toHeight,
color: displayColor,
),
Stack(
children: [
Container(
margin: EdgeInsets.only(right: isDesktop ? 20 : 10),
child: Transform.scale(
scale: isScale ? 1.2 : 1,
child: Image.asset(
image!,
height: SizeConfig().isTablet(context) ? 24 : 22.toHeight,
color: displayColor,
),
),
),
if (showNotificationDot)
Positioned(
top: 0,
right: (isDesktop ? 20 : 10) - 4.toWidth,
child: Container(
width: 8.toWidth,
height: 8.toWidth,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Colors.red,
),
),
)
],
),
SizedBox(width: isDesktop ? 20 : 10),
!showIconOnly
? Expanded(
child: Text(
Expand Down

0 comments on commit 2948525

Please sign in to comment.