Skip to content

Commit

Permalink
adding gradient
Browse files Browse the repository at this point in the history
  • Loading branch information
DGoiana committed Dec 3, 2024
1 parent 04ca6aa commit a102c11
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 12 additions & 10 deletions packages/uni_ui/lib/cards/generic_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import 'package:figma_squircle/figma_squircle.dart';
import 'package:flutter/material.dart';

class GenericCard extends StatelessWidget {
const GenericCard({
super.key,
this.margin,
this.padding,
this.color,
this.shadowColor,
this.borderRadius,
this.onClick,
this.child,
});
const GenericCard(
{super.key,
this.margin,
this.padding,
this.color,
this.shadowColor,
this.borderRadius,
this.onClick,
this.child,
this.gradient});

final EdgeInsetsGeometry? margin;
final EdgeInsetsGeometry? padding;
Expand All @@ -20,6 +20,7 @@ class GenericCard extends StatelessWidget {
final double? borderRadius;
final Function? onClick;
final Widget? child;
final Gradient? gradient;

@override
Widget build(BuildContext context) {
Expand All @@ -40,6 +41,7 @@ class GenericCard extends StatelessWidget {
color: color ??
cardTheme.color ??
theme.colorScheme.surfaceContainer,
gradient: gradient,
boxShadow: [
BoxShadow(
color: shadowColor ??
Expand Down
11 changes: 9 additions & 2 deletions packages/uni_ui/lib/cards/schedule_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:phosphor_flutter/phosphor_flutter.dart';
import 'package:uni_ui/cards/generic_card.dart';
import 'package:uni_ui/theme.dart';

class ScheduleCard extends GenericCard {
class ScheduleCard extends StatelessWidget {
const ScheduleCard(
{super.key,
required this.name,
Expand All @@ -27,6 +27,14 @@ class ScheduleCard extends GenericCard {
@override
Widget build(BuildContext context) {
return GenericCard(
gradient: RadialGradient(
colors: [
Color(0xFF280709),
Color(0xFF511515),
],
center: Alignment.topLeft,
radius: 1.5,
stops: [0, 1]),
key: key,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Expand Down Expand Up @@ -118,7 +126,6 @@ class ScheduleCard extends GenericCard {
)
],
),
color: isActive ? Color.fromARGB(255, 40, 7, 9) : null,
);
}
}
2 changes: 2 additions & 0 deletions packages/uni_ui/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ dev_dependencies:
test: any

flutter:
assets:
- assets/images/
uses-material-design: true

0 comments on commit a102c11

Please sign in to comment.