Merge branch 'main' into Firebase

# Conflicts:
#	lib/AddPage.dart
#	lib/UserDefinedList.dart
#	pubspec.lock
This commit is contained in:
2023-04-26 17:28:50 +02:00
3 changed files with 140 additions and 68 deletions
+72 -1
View File
@@ -1,4 +1,74 @@
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class DetailPage extends StatelessWidget {
final String title;
final String datum;
final String description;
final Image? image;
const DetailPage({
Key? key,
required this.title,
required this.datum,
required this.description,
required this.image,
}) : super(key: key);
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(title),
),
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
padding: const EdgeInsets.all(8.0),
child: image,
),
Container(
padding: const EdgeInsets.all(8.0),
child: Text(
title,
style: const TextStyle(
fontSize: 24,
fontWeight: FontWeight.bold,
),
),
),
Container(
padding: const EdgeInsets.only(left: 8.0, bottom: 8.0),
child: Text(
datum,
style: const TextStyle(
fontSize: 18,
),
),
),
Container(
padding: const EdgeInsets.all(8.0),
child: Text(
description,
style: const TextStyle(
fontSize: 18,
),
),
),
],
),
),
);
}
}
/*import 'package:flutter/material.dart';
class DetailPage extends StatelessWidget {
final String title;
@@ -48,4 +118,5 @@ class DetailPage extends StatelessWidget {
),
);
}
}
}*/
+14 -17
View File
@@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'DetailPage.dart';
import 'package:intl/intl.dart';
@@ -19,11 +18,7 @@ class UserDefinedItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
String shortDescription = "${description.substring(0,34)}...";
return Padding(
padding: const EdgeInsets.symmetric(vertical: 1.0),
child: Card(
return Card(
child: InkWell(
onTap: () {
// Open a new screen when the user taps on the list item
@@ -32,6 +27,7 @@ class UserDefinedItem extends StatelessWidget {
MaterialPageRoute(
builder: (context) => DetailPage(
title: title,
datum: datum,
description: description,
image: image != null ? image! : null,
),
@@ -39,13 +35,15 @@ class UserDefinedItem extends StatelessWidget {
);
},
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
width: 130,
height: 130,
width: 120,
height: 120,
child: image,
),
Flexible(
flex: 1,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -59,25 +57,28 @@ class UserDefinedItem extends StatelessWidget {
title,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 20, // beliebige Schriftgröße
fontSize: 20,
fontWeight: FontWeight.bold// beliebige Schriftgröße
),
),
),
Text(
datum,
style: const TextStyle(
fontSize: 16, // beliebige Schriftgröße
fontSize: 15, // beliebige Schriftgröße
),
),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.all(8.0), // feste Höhe für 2 Zeilen
child: Text(
shortDescription,
description,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 18, // beliebige Schriftgröße
fontSize: 15,
),
),
),
@@ -87,7 +88,6 @@ class UserDefinedItem extends StatelessWidget {
],
),
),
),
);
}
}
@@ -201,6 +201,3 @@ class IssueList extends StatelessWidget {
);
}
}
+4
View File
@@ -1,6 +1,7 @@
name: demoapp
description: test app
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
@@ -31,6 +32,8 @@ environment:
dependencies:
flutter:
sdk: flutter
intl: ^0.17.0
# The following adds the Cupertino Icons font to your application.
@@ -42,6 +45,7 @@ dependencies:
firebase_storage: ^11.1.0
cloud_firestore: ^4.5.1
dev_dependencies:
flutter_test:
sdk: flutter