Skip to content

Commit

Permalink
chore: add favourites section
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-hector committed Feb 2, 2024
1 parent 6846fab commit 53d6d69
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 5 deletions.
2 changes: 2 additions & 0 deletions lib/app/features/dapps/views/pages/dapps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:ice/app/extensions/theme_data.dart';
import 'package:ice/app/features/dapps/views/pages/mocks/mocked_apps.dart';
import 'package:ice/app/features/dapps/views/pages/widgets/apps.dart';
import 'package:ice/app/features/dapps/views/pages/widgets/categories.dart';
import 'package:ice/app/features/dapps/views/pages/widgets/favourites.dart';
import 'package:ice/app/features/dapps/views/pages/widgets/featured.dart';
import 'package:ice/app/shared/widgets/wallet_header/wallet_header.dart';

Expand All @@ -24,6 +25,7 @@ class DAppsPage extends HookConsumerWidget {
const Categories(),
Apps(title: 'Highest ranked', items: featured, onPress: () {}),
Apps(title: 'Recently added', items: featured, onPress: () {}),
const Favourites(),
],
),
),
Expand Down
73 changes: 73 additions & 0 deletions lib/app/features/dapps/views/pages/widgets/favourites.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import 'package:flutter/material.dart';
import 'package:ice/app/extensions/build_context.dart';
import 'package:ice/app/extensions/theme_data.dart';
import 'package:ice/app/shared/widgets/favourite_icon/favorite_icon.dart';
import 'package:ice/app/values/constants.dart';
import 'package:ice/generated/assets.gen.dart';

const double containerHeight = 60.0;

class Favourites extends StatelessWidget {
const Favourites({super.key});

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(
horizontal: kDefaultSidePadding,
vertical: 24,
),
child: GestureDetector(
onTap: () {},
child: Container(
height: containerHeight,
width: double.infinity,
padding: const EdgeInsets.symmetric(horizontal: kDefaultSidePadding),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
color: context.theme.appColors.tertararyBackground,
border: Border.all(
color: context.theme.appColors.onTerararyFill,
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
children: <Widget>[
const FavouriteIcon(),
const SizedBox(width: 8),
SizedBox(
height: 36,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Favourites',
style: context.theme.appTextThemes.body.copyWith(
color: context.theme.appColors.primaryText,
),
),
Text(
'17 added dApps',
style: context.theme.appTextThemes.caption3.copyWith(
color: context.theme.appColors.secondaryText,
),
),
],
),
),
],
),
Image.asset(
Assets.images.forwardArrow.path,
width: 12,
),
],
),
),
),
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@ import 'package:ice/generated/assets.gen.dart';

const double iconSideDimension = 36.0;

class FavoriteIcon extends StatelessWidget {
const FavoriteIcon({
class FavouriteIcon extends StatelessWidget {
const FavouriteIcon({
super.key,
this.isFavorite = false,
this.isFavourite = false,
this.backgroundColor,
});

final bool isFavorite;
final bool isFavourite;
final Color? backgroundColor;

@override
Widget build(BuildContext context) {
final String iconPath = isFavorite
final String iconPath = isFavourite
? Assets.images.bookmarksOn.path
: Assets.images.bookmarks.path;

Expand Down

0 comments on commit 53d6d69

Please sign in to comment.