diff --git a/README.md b/README.md index 4387ae5cb..0f27c71ff 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ## Overview -**uni** is a project developed by [NIAEFEUP](https://ni.fe.up.pt/) to help students of the [University of Porto](https://up.pt) to manage their academic life, including useful features such as upcoming classes and exams. It is a mobile app that is available for both Android and iOS, and is developed using the [Flutter](https://flutter.dev/) framework. +**uni** is a project developed by [NIAEFEUP](https://niaefeup.pt/) to help students of the [University of Porto](https://up.pt) to manage their academic life, including useful features such as upcoming classes and exams. It is a mobile app that is available for both Android and iOS, and is developed using the [Flutter](https://flutter.dev/) framework. Some of the features are only available to students of [FEUP](https://fe.up.pt). The reliability of the information provided by the app is not guaranteed, and the app is not affiliated with the University of Porto or any of its faculties. @@ -34,4 +34,4 @@ This application is licensed under the [GNU General Public License v3.0](./LICEN Contributions are welcome, and can be made by opening a pull request. Please note, however, that a university's account is required to access most of the app's features. -For further information about the project structure, please refer to [the app's README file](./uni/README.md). +For further information about the project structure, please refer to [the app's README file](./packages/uni_app/README.md). diff --git a/packages/uni_app/pubspec.lock b/packages/uni_app/pubspec.lock index 22937daf1..04ebf0c95 100644 --- a/packages/uni_app/pubspec.lock +++ b/packages/uni_app/pubspec.lock @@ -425,6 +425,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.2" + figma_squircle: + dependency: transitive + description: + name: figma_squircle + sha256: "790b91a9505e90d246f6efe2fa065ff7fffe658c7b44fe9b5b20c7b0ad3818c0" + url: "https://pub.dev" + source: hosted + version: "0.5.3" file: dependency: transitive description: @@ -1507,6 +1515,13 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + uni_ui: + dependency: "direct main" + description: + path: "../uni_ui" + relative: true + source: path + version: "1.0.0" unicode: dependency: transitive description: diff --git a/packages/uni_app/pubspec.yaml b/packages/uni_app/pubspec.yaml index 2bc3262a7..14b47ab0a 100644 --- a/packages/uni_app/pubspec.yaml +++ b/packages/uni_app/pubspec.yaml @@ -68,6 +68,8 @@ dependencies: timelines: ^0.1.0 tuple: ^2.0.0 ua_client_hints: ^1.3.1 + uni_ui: + path: ../uni_ui url_launcher: ^6.2.2 workmanager: ^0.5.2 diff --git a/packages/uni_ui/lib/generic_card.dart b/packages/uni_ui/lib/generic_card.dart new file mode 100644 index 000000000..bd1acfc37 --- /dev/null +++ b/packages/uni_ui/lib/generic_card.dart @@ -0,0 +1,58 @@ +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, + }); + + final EdgeInsetsGeometry? margin; + final EdgeInsetsGeometry? padding; + final Color? color; + final Color? shadowColor; + final double? borderRadius; + final Function? onClick; + final Widget? child; + + @override + Widget build(BuildContext context) { + final cardTheme = CardTheme.of(context); + + return Padding( + padding: margin ?? cardTheme.margin ?? const EdgeInsets.all(4), + child: GestureDetector( + onTap: () => onClick, + child: ClipSmoothRect( + radius: SmoothBorderRadius( + cornerRadius: borderRadius ?? 20, + cornerSmoothing: 1, + ), + child: Container( + decoration: BoxDecoration( + color: color ?? + cardTheme.color ?? + const Color.fromARGB(255, 255, 245, 243), + boxShadow: [ + BoxShadow( + color: shadowColor ?? + cardTheme.shadowColor ?? + Colors.black.withOpacity(0.25), + blurRadius: 6, + ), + ], + ), + child: Padding( + padding: padding ?? const EdgeInsets.all(10), child: child), + ), + ), + ), + ); + } +} diff --git a/packages/uni_ui/pubspec.lock b/packages/uni_ui/pubspec.lock index 70207236c..25a63aad9 100644 --- a/packages/uni_ui/pubspec.lock +++ b/packages/uni_ui/pubspec.lock @@ -161,6 +161,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.3.1" + figma_squircle: + dependency: "direct main" + description: + name: figma_squircle + sha256: "790b91a9505e90d246f6efe2fa065ff7fffe658c7b44fe9b5b20c7b0ad3818c0" + url: "https://pub.dev" + source: hosted + version: "0.5.3" file: dependency: transitive description: diff --git a/packages/uni_ui/pubspec.yaml b/packages/uni_ui/pubspec.yaml index 0dde2f809..9f518255d 100644 --- a/packages/uni_ui/pubspec.yaml +++ b/packages/uni_ui/pubspec.yaml @@ -8,6 +8,7 @@ environment: flutter: 3.22.0 dependencies: + figma_squircle: ^0.5.3 flutter: sdk: flutter