Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

Commit

Permalink
redesign: home screen cards
Browse files Browse the repository at this point in the history
  • Loading branch information
reasje committed May 27, 2024
1 parent 337afc4 commit 9a6d0e2
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 23 deletions.
1 change: 0 additions & 1 deletion lib/features/dapps/presentation/dapps_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class DAppsPage extends HookConsumerWidget {
useContentPadding: false,
childrenPadding: const EdgeInsets.symmetric(
horizontal: Sizes.spaceSmall, vertical: Sizes.spaceNormal),
// backgroundColor: ColorsTheme.of(context).screenBackground,
backgroundGradient: const LinearGradient(
colors: [
Color(0xFF0E1629),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Widget buildCard(
void Function()? shatter,
bool animated = false,
}) {

final isMobile = mainAxisCount == CardMainAxisCount.mobile;
final imageRatioFactor = (isMobile ? 0.2 : 0.1);
String? image;
Expand Down Expand Up @@ -53,7 +54,7 @@ Widget buildCard(
clipBehavior: Clip.none,
children: [
Container(
padding: const EdgeInsets.all(Sizes.spaceXLarge),
padding: const EdgeInsets.all(Sizes.spaceLarge),
decoration: BoxDecoration(
borderRadius: const BorderRadius.all(Radius.circular(15)),
gradient: LinearGradient(
Expand Down Expand Up @@ -115,7 +116,7 @@ Widget buildCard(
],
),
const SizedBox(
height: Sizes.spaceXSmall,
height: Sizes.space2XSmall,
),
Text(
name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ class CardCrossAxisCount {
}

class CardMainAxisCount {
static const int mobile = 3;
static const int mobile = 4;
static const int tablet = 5;
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class DAppCard extends HookConsumerWidget {

final isMobile = mainAxisCount == CardMainAxisCount.mobile;
final imageRatioFactor = (isMobile ? 0.2 : 0.1);
final animatedSize = (isMobile ? 0.3 : 0.15);
final animatedSize = (isMobile ? 0.25 : 0.15);
final sizeLimit = (imageRatioFactor / animatedSize);

final animationController = useAnimationController(
Expand Down Expand Up @@ -90,21 +90,19 @@ class DAppCard extends HookConsumerWidget {
return SizedBox(
width: MediaQuery.of(context).size.width / (mainAxisCount),
height: MediaQuery.of(context).size.width / (mainAxisCount),
child: Center(
child: buildCard(
context,
dapp,
mainAxisCount,
onTap,
isEditMode,
width,
ratioFactor: animation.value < sizeLimit
? null
: (animatedSize * animation.value),
shatter: shatter,
actions: actions,
animated: animation.value != 0.0,
),
child: buildCard(
context,
dapp,
mainAxisCount,
onTap,
isEditMode,
width,
ratioFactor: animation.value < sizeLimit
? null
: (animatedSize * animation.value),
shatter: shatter,
actions: actions,
animated: animation.value != 0.0,
),
);
},
Expand Down
1 change: 1 addition & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ void main() {
final isLoggedIn = authUseCase.loggedIn;

await Biometric.load();
Paint.enableDithering = true;

final appVersionUseCase = container.read(appVersionUseCaseProvider);
await appVersionUseCase.checkLatestVersion();
Expand Down
4 changes: 2 additions & 2 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ packages:
dependency: "direct main"
description:
name: fl_shared_link
sha256: f9c0da5cdedccad1a51d570a57bc7a7289b345846fe7fab08738f397248f644d
sha256: "65ba4e86d2dc8563f626ed681354b980ef4cfb57fd68c4d7c3cb4fc3a27a4ea3"
url: "https://pub.dev"
source: hosted
version: "0.0.3"
version: "0.1.0"
flutter:
dependency: "direct main"
description: flutter
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ dependencies:
firebase_core: ^2.22.0
firebase_messaging: ^14.7.4
fl_chart: ^0.62.0
fl_shared_link: ^0.0.3
fl_shared_link: ^0.1.0
flutter:
sdk: flutter
flutter_app_update:
Expand Down

0 comments on commit 9a6d0e2

Please sign in to comment.