Compare commits

..

No commits in common. "master" and "clippath" have entirely different histories.

19 changed files with 23 additions and 188 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 40 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 76 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -59,7 +59,6 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">

View File

@ -1,6 +1,3 @@
import 'dart:math';
import 'package:Emma_home/utils/clipper.dart';
import 'package:flutter/material.dart';
import 'package:Emma_home/utils/helper_functions.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
@ -199,7 +196,7 @@ class EventCard2Section extends StatelessWidget {
final Color color;
final MediaQueryData screen_size;
EventCard2Section({
const EventCard2Section({
super.key,
required this.title,
required this.description,
@ -208,28 +205,6 @@ class EventCard2Section extends StatelessWidget {
required this.color,
required this.screen_size,
});
List<CustomClipper<Path>> clippers = [
BowClipper(),
WaveClipper(),
ConcavClipper()
];
String getRandomImage() {
final List<String> images = [
'assets/images/Event_Images/image01.png',
'assets/images/Event_Images/image02.jpg',
'assets/images/Event_Images/image03.jpg',
'assets/images/Event_Images/image04.jpg',
'assets/images/Event_Images/image05.jpg',
];
final randomIndex = Random().nextInt(images.length);
return images[randomIndex];
}
CustomClipper<Path> _getRandomClipper() {
final randomIndex = Random().nextInt(clippers.length);
return clippers[randomIndex];
}
@override
Widget build(BuildContext context) {
return Container(
@ -256,7 +231,7 @@ class EventCard2Section extends StatelessWidget {
),
child: Stack(
children: [
/* Positioned(
Positioned(
right: 0,
top: 0,
child: Image.asset(
@ -264,20 +239,7 @@ class EventCard2Section extends StatelessWidget {
height: 110, // Höhe des Bildes
width: 130, // Breite des Bildes
),
), */
Positioned(
right: 0,
top: 0,
child: ClipPath(
clipper: _getRandomClipper(),
child: Image.asset(
getRandomImage(), // Pfad zum Bild
height: 110, // Höhe des Bildes
width: 115, // Breite des Bildes
fit: BoxFit.cover,
),
)),
),
//Bookmark Button
Positioned(
// Bookmark Button
@ -313,7 +275,7 @@ class EventCard2Section extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
shortenText(title, 20),
shortenText(title, 30),
style: const TextStyle(
color: Color(0xFF0A0A0A),
fontSize: 18,

View File

@ -1,97 +0,0 @@
import 'package:flutter/material.dart';
class WaveClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
Paint paint = Paint();
Path path = Path();
// Path number 1
path = Path();
path.lineTo(size.width * 0.05, size.height * 0.3);
path.cubicTo(-0.03, size.height * 0.18, size.width * 0.02,
size.height * 0.05, size.width * 0.05, 0);
path.cubicTo(
size.width * 0.05, 0, size.width * 0.92, 0, size.width * 0.92, 0);
path.cubicTo(size.width, 0, size.width, size.height * 0.05, size.width,
size.height * 0.07);
path.cubicTo(size.width, size.height * 0.07, size.width, size.height * 0.91,
size.width, size.height * 0.91);
path.cubicTo(size.width, size.height, size.width * 0.94, size.height,
size.width * 0.9, size.height);
path.cubicTo(size.width * 0.9, size.height, size.width * 0.05, size.height,
size.width * 0.05, size.height);
path.cubicTo(size.width * 0.1, size.height * 0.95, size.width * 0.07,
size.height * 0.87, size.width * 0.05, size.height * 0.84);
path.cubicTo(-0.02, size.height * 0.76, size.width * 0.02,
size.height * 0.63, size.width * 0.05, size.height * 0.58);
path.cubicTo(size.width * 0.13, size.height * 0.45, size.width * 0.09,
size.height * 0.34, size.width * 0.05, size.height * 0.3);
path.cubicTo(size.width * 0.05, size.height * 0.3, size.width * 0.05,
size.height * 0.3, size.width * 0.05, size.height * 0.3);
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}
class BowClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
Paint paint = Paint();
Path path = Path();
// Path number 1
path = Path();
path.lineTo(0, size.height);
path.cubicTo(0, size.height, 0, size.height, 0, size.height);
path.cubicTo(0, size.height, size.width * 0.89, size.height,
size.width * 0.89, size.height);
path.cubicTo(size.width, size.height, size.width, size.height, size.width,
size.height * 0.88);
path.cubicTo(size.width, size.height * 0.88, size.width, size.height * 0.11,
size.width, size.height * 0.11);
path.cubicTo(size.width, 0, size.width * 0.95, 0, size.width * 0.89, 0);
path.cubicTo(
size.width * 0.89, 0, size.width * 0.63, 0, size.width * 0.63, 0);
path.cubicTo(size.width * 0.11, size.height * 0.04, size.width * 0.04,
size.height * 0.68, 0, size.height);
path.cubicTo(0, size.height, 0, size.height, 0, size.height);
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}
class ConcavClipper extends CustomClipper<Path> {
@override
Path getClip(Size size) {
Paint paint = Paint();
Path path = Path();
// Path number 1
path.lineTo(size.width * 0.16, size.height * 0.58);
path.cubicTo(size.width * 0.16, size.height * 0.16, size.width * 0.08,
size.height * 0.1, size.width * 0.03, 0);
path.cubicTo(
size.width * 0.03, 0, size.width * 0.93, 0, size.width * 0.93, 0);
path.cubicTo(size.width, 0, size.width, size.height * 0.05, size.width,
size.height * 0.07);
path.cubicTo(size.width, size.height * 0.07, size.width, size.height * 0.9,
size.width, size.height * 0.9);
path.cubicTo(size.width, size.height * 0.98, size.width * 0.95, size.height,
size.width * 0.93, size.height);
path.cubicTo(
size.width * 0.93, size.height, 0, size.height, 0, size.height);
path.cubicTo(size.width * 0.12, size.height * 0.9, size.width * 0.15,
size.height * 0.68, size.width * 0.16, size.height * 0.58);
path.cubicTo(size.width * 0.16, size.height * 0.58, size.width * 0.16,
size.height * 0.58, size.width * 0.16, size.height * 0.58);
return path;
}
@override
bool shouldReclip(CustomClipper<Path> oldClipper) => false;
}

View File

@ -21,11 +21,13 @@ String shortenText(String text, int maxLength) {
return '$shortened ...';
}
class ScaleSize {
static double textScaleFactor(BuildContext context,
{double maxTextScaleFactor = 2}) {
static double textScaleFactor(BuildContext context, {double maxTextScaleFactor = 2}) {
final width = MediaQuery.of(context).size.width;
double val = (width / 1400) * maxTextScaleFactor;
return max(1, min(val, maxTextScaleFactor));
}
}
}

View File

@ -59,7 +59,6 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
enableGPUValidationMode = "1"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">

View File

@ -37,18 +37,18 @@ packages:
dependency: transitive
description:
name: async
sha256: d2872f9c19731c2e5f10444b14686eb7cc85c76274bd6c16e1816bff9a3bab63
sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c"
url: "https://pub.dev"
source: hosted
version: "2.12.0"
version: "2.11.0"
boolean_selector:
dependency: transitive
description:
name: boolean_selector
sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea"
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
version: "2.1.1"
characters:
dependency: transitive
description:
@ -61,10 +61,10 @@ packages:
dependency: transitive
description:
name: clock
sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.dev"
source: hosted
version: "1.1.2"
version: "1.1.1"
collection:
dependency: transitive
description:
@ -101,10 +101,10 @@ packages:
dependency: transitive
description:
name: fake_async
sha256: "6a95e56b2449df2273fd8c45a662d6947ce1ebb7aafe80e550a3f68297f3cacc"
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.dev"
source: hosted
version: "1.3.2"
version: "1.3.1"
ffi:
dependency: transitive
description:
@ -396,10 +396,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
version: "1.9.0"
path_provider:
dependency: transitive
description:
@ -601,10 +601,10 @@ packages:
dependency: transitive
description:
name: string_scanner
sha256: "0bd04f5bb74fcd6ff0606a888a30e917af9bd52820b178eaa464beb11dca84b6"
sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3"
url: "https://pub.dev"
source: hosted
version: "1.4.0"
version: "1.3.0"
supabase:
dependency: transitive
description:
@ -729,10 +729,10 @@ packages:
dependency: transitive
description:
name: vm_service
sha256: "0968250880a6c5fe7edc067ed0a13d4bae1577fe2771dcf3010d52c4a9d3ca14"
sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b
url: "https://pub.dev"
source: hosted
version: "14.3.1"
version: "14.3.0"
web:
dependency: transitive
description:

View File

@ -72,7 +72,6 @@ flutter:
assets:
- assets/images/
- assets/images/Icons/
- assets/images/Event_Images/
- .env.local
# An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware