Skip to content

Commit

Permalink
Update donors card
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanSarwar45 committed May 13, 2024
1 parent 9f37fb5 commit fa84c5f
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 36 deletions.
92 changes: 60 additions & 32 deletions lib/settings/screens/donors.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:convert';
import 'dart:math';

import 'package:clock_app/common/widgets/card_container.dart';
import 'package:clock_app/navigation/widgets/app_top_bar.dart';
Expand Down Expand Up @@ -39,38 +40,7 @@ class DonorsScreen extends StatelessWidget {
return Column(
children: [
for (final contributor in contributors)
CardContainer(
// onTap: () async {
// if (contributor['profile_url'] != null) {
// await launchUrl(
// Uri.parse(contributor['profile_url']));
// }
// },
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 16.0),
child: Row(
children: [
// CardContainer(
// child: Image(
// width: 48,
// image:
// AssetImage(contributor['name']),
// ),
// ),
// const SizedBox(width: 8),
Expanded(
child: Text(
contributor['name'],
style: textTheme.headlineMedium,
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
),
),
],
),
),
),
DonorCard(contributor: contributor),
],
);
} else {
Expand All @@ -82,3 +52,61 @@ class DonorsScreen extends StatelessWidget {
);
}
}

class DonorCard extends StatelessWidget {
const DonorCard({
super.key,
required this.contributor,
});

final dynamic contributor;
@override
Widget build(BuildContext context) {
final ThemeData theme = Theme.of(context);
final TextTheme textTheme = theme.textTheme;
final Color color =
Color((Random().nextDouble() * 0xFFFFFF).toInt()).withOpacity(1.0);
return CardContainer(
// onTap: () async {
// if (contributor['profile_url'] != null) {
// await launchUrl(
// Uri.parse(contributor['profile_url']));
// }
// },
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 8.0, horizontal: 8.0),
child: Row(
children: [
CardContainer(
color: color,
alignment: Alignment.center,
child: SizedBox(
width: 40,
height: 40,
child: Container(
alignment: Alignment.center,
child: Text(contributor['name'].substring(0, 1),
style: textTheme.headlineMedium?.copyWith(
color: color.computeLuminance() > 0.179
? Colors.black
: Colors.white,
)),
),
),
),
const SizedBox(width: 8),
Expanded(
child: Text(
contributor['name'],
style: textTheme.headlineMedium,
maxLines: 1,
overflow: TextOverflow.ellipsis,
softWrap: false,
),
),
],
),
),
);
}
}
4 changes: 0 additions & 4 deletions patreons.csv

This file was deleted.

0 comments on commit fa84c5f

Please sign in to comment.