Skip to content

Commit

Permalink
Merge branch 'ui/redesign' into ui/page-layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
thePeras committed Jan 19, 2025
2 parents feca9a6 + 581159a commit f8a4f55
Show file tree
Hide file tree
Showing 9 changed files with 189 additions and 642 deletions.
2 changes: 1 addition & 1 deletion packages/uni_app/app_version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.10.0-beta.53+358
1.10.0-beta.54+359
2 changes: 1 addition & 1 deletion packages/uni_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish_to: "none" # We do not publish to pub.dev
# To change it manually, override the value in app_version.txt.
# The app version code is automatically also bumped by CI.
# Do not change it manually.
version: 1.10.0-beta.53+358
version: 1.10.0-beta.54+359

environment:
sdk: ">=3.4.0 <4.0.0"
Expand Down
46 changes: 46 additions & 0 deletions packages/uni_ui/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Miscellaneous
*.class
*.log
*.pyc
*.swp
.DS_Store
.atom/
.buildlog/
.history
.svn/
migrate_working_dir/

# IntelliJ related
*.iml
*.ipr
*.iws
.idea/

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
# is commented out by default.
#.vscode/

# Flutter/Dart/Pub related
**/doc/api/
**/ios/Flutter/.last_build_id
.dart_tool/
.flutter-plugins
.flutter-plugins-dependencies
.pub-cache/
.pub/
/build/

# Symbolication related
app.*.symbols

# Obfuscation related
app.*.map.json

# Android Studio will place build artifacts here
/android/app/debug
/android/app/profile
/android/app/release

/lib/main.dart
pubspec.lock
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 15 additions & 11 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 All @@ -50,7 +52,9 @@ class GenericCard extends StatelessWidget {
],
),
child: Padding(
padding: padding ?? const EdgeInsets.all(10), child: child),
padding: padding ??
const EdgeInsets.symmetric(vertical: 15, horizontal: 25),
child: child),
),
),
),
Expand Down
117 changes: 117 additions & 0 deletions packages/uni_ui/lib/cards/schedule_card.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import 'package:flutter/material.dart';
import 'package:phosphor_flutter/phosphor_flutter.dart';
import 'package:uni_ui/cards/generic_card.dart';
import 'package:uni_ui/theme.dart';

class ScheduleCard extends StatelessWidget {
const ScheduleCard(
{super.key,
required this.name,
required this.acronym,
required this.room,
required this.type,
// required this.badgeColor,
this.isActive = false,
this.teacherName,
this.teacherPhoto});

final String name;
final String acronym;
final String room;
final String type;
// final BadgeColors badgeColor;
final bool isActive;
final String? teacherName;
final String? teacherPhoto;

@override
Widget build(BuildContext context) {
return GenericCard(
gradient: isActive
? RadialGradient(
colors: [
Color(0xFF280709),
Color(0xFF511515),
],
center: Alignment.topLeft,
radius: 1.5,
stops: [0, 1])
: null,
key: key,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
if (isActive) ...[
PhosphorIcon(
PhosphorIcons.clock(PhosphorIconsStyle.duotone),
color: Theme.of(context).colorScheme.secondary,
size: 20,
),
SizedBox(width: 5),
],
Text(
acronym,
overflow: TextOverflow.ellipsis,
style: isActive
? Theme.of(context).textTheme.titleLarge
: Theme.of(context).textTheme.headlineSmall,
),
const SizedBox(width: 8), //TODO: Create a custom Gap()?
Badge(
label: Text(type),
backgroundColor: BadgeColors.tp,
textColor: Theme.of(context).colorScheme.surface,
),
],
),
Text(
name,
overflow: TextOverflow.ellipsis,
style: isActive
? Theme.of(context).textTheme.titleSmall
: Theme.of(context).textTheme.bodySmall,
),
SizedBox(height: 5),
if (isActive)
Row(children: [
CircleAvatar(
radius: 15,
backgroundImage: AssetImage(
teacherPhoto ??
'assets/images/profile_placeholder.png', // to change
)),
const SizedBox(width: 8), //TODO: create gap()?
Text(teacherName!,
style: Theme.of(context).textTheme.titleSmall),
])
],
),
),
Column(
children: [
PhosphorIcon(
PhosphorIcons.mapPin(PhosphorIconsStyle.duotone),
color: isActive
? Theme.of(context).colorScheme.secondary
: Theme.of(context).iconTheme.color,
size: 35,
),
Text(room,
overflow: TextOverflow.ellipsis,
style: TextStyle(
color: isActive
? Theme.of(context).colorScheme.secondary
: Theme.of(context).colorScheme.primary)),
],
)
],
),
);
}
}
7 changes: 7 additions & 0 deletions packages/uni_ui/lib/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,13 @@ ThemeData lightTheme = ThemeData(
);

class BadgeColors {
static const te = Color(0xFFfbc11f);
static const tp = Color(0xFFd3944c);
static const p = Color(0xFFab4d39);
static const pl = Color(0xFF769c87);
static const ot = Color(0xFF7ca5b8);
static const tc = Color(0xFFcdbeb1);
static const s = Color(0xFF917c9b);
static const mt = Color(0xFF7ca5b8);
static const en = Color(0xFF769c87);
static const er = Color(0xFFab4d39);
Expand Down
Loading

0 comments on commit f8a4f55

Please sign in to comment.