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: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 { class DetailPage extends StatelessWidget {
final String title; 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:flutter/material.dart';
import 'package:cloud_firestore/cloud_firestore.dart';
import 'DetailPage.dart'; import 'DetailPage.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
@@ -19,11 +18,7 @@ class UserDefinedItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String shortDescription = "${description.substring(0,34)}..."; return Card(
return Padding(
padding: const EdgeInsets.symmetric(vertical: 1.0),
child: Card(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
// Open a new screen when the user taps on the list item // Open a new screen when the user taps on the list item
@@ -32,6 +27,7 @@ class UserDefinedItem extends StatelessWidget {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => DetailPage( builder: (context) => DetailPage(
title: title, title: title,
datum: datum,
description: description, description: description,
image: image != null ? image! : null, image: image != null ? image! : null,
), ),
@@ -39,13 +35,15 @@ class UserDefinedItem extends StatelessWidget {
); );
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox( SizedBox(
width: 130, width: 120,
height: 130, height: 120,
child: image, child: image,
), ),
Flexible( Flexible(
flex: 1,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@@ -59,25 +57,28 @@ class UserDefinedItem extends StatelessWidget {
title, title,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
style: const TextStyle( style: const TextStyle(
fontSize: 20, // beliebige Schriftgröße fontSize: 20,
fontWeight: FontWeight.bold// beliebige Schriftgröße
), ),
), ),
), ),
Text( Text(
datum, datum,
style: const TextStyle( style: const TextStyle(
fontSize: 16, // beliebige Schriftgröße fontSize: 15, // beliebige Schriftgröße
), ),
), ),
], ],
), ),
), ),
Padding( Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0), // feste Höhe für 2 Zeilen
child: Text( child: Text(
shortDescription, description,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: const TextStyle( 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 name: demoapp
description: test app description: test app
# The following line prevents the package from being accidentally published to # The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages. # 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 publish_to: 'none' # Remove this line if you wish to publish to pub.dev
@@ -31,6 +32,8 @@ environment:
dependencies: dependencies:
flutter: flutter:
sdk: flutter sdk: flutter
intl: ^0.17.0
# The following adds the Cupertino Icons font to your application. # The following adds the Cupertino Icons font to your application.
@@ -42,6 +45,7 @@ dependencies:
firebase_storage: ^11.1.0 firebase_storage: ^11.1.0
cloud_firestore: ^4.5.1 cloud_firestore: ^4.5.1
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter