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 {
), ),
); );
} }
} }*/
+64 -67
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,73 +18,74 @@ class UserDefinedItem extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
String shortDescription = "${description.substring(0,34)}..."; return Card(
child: InkWell(
return Padding( onTap: () {
padding: const EdgeInsets.symmetric(vertical: 1.0), // Open a new screen when the user taps on the list item
child: Card( Navigator.push(
child: InkWell( context,
onTap: () { MaterialPageRoute(
// Open a new screen when the user taps on the list item builder: (context) => DetailPage(
Navigator.push( title: title,
context, datum: datum,
MaterialPageRoute( description: description,
builder: (context) => DetailPage( image: image != null ? image! : null,
title: title,
description: description,
image: image != null ? image! : null,
),
), ),
); ),
}, );
child: Row( },
children: [ child: Row(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
width: 130, children: [
height: 130, SizedBox(
child: image, width: 120,
), height: 120,
Flexible( child: image,
child: Column( ),
crossAxisAlignment: CrossAxisAlignment.start, Flexible(
children: [ flex: 1,
Padding( child: Column(
padding: const EdgeInsets.all(8.0), crossAxisAlignment: CrossAxisAlignment.start,
child: Row( children: [
mainAxisAlignment: MainAxisAlignment.spaceBetween, Padding(
children: [ padding: const EdgeInsets.all(8.0),
Flexible( child: Row(
child: Text( mainAxisAlignment: MainAxisAlignment.spaceBetween,
title, children: [
overflow: TextOverflow.ellipsis, Flexible(
style: const TextStyle( child: Text(
fontSize: 20, // beliebige Schriftgröße title,
), overflow: TextOverflow.ellipsis,
),
),
Text(
datum,
style: const TextStyle( style: const TextStyle(
fontSize: 16, // beliebige Schriftgröße fontSize: 20,
fontWeight: FontWeight.bold// beliebige Schriftgröße
), ),
), ),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0),
child: Text(
shortDescription,
style: const TextStyle(
fontSize: 18, // beliebige Schriftgröße
), ),
Text(
datum,
style: const TextStyle(
fontSize: 15, // beliebige Schriftgröße
),
),
],
),
),
Padding(
padding: const EdgeInsets.all(8.0), // feste Höhe für 2 Zeilen
child: Text(
description,
maxLines: 3,
overflow: TextOverflow.ellipsis,
style: const TextStyle(
fontSize: 15,
), ),
), ),
], ),
), ],
), ),
], ),
), ],
), ),
), ),
); );
@@ -191,16 +191,13 @@ class IssueList extends StatelessWidget {
//addUDI(item1); //addUDI(item1);
//addUDI(item2); //addUDI(item2);
return ListView( return ListView(
children: _items.map((item) => UserDefinedItem( children: _items.map((item) => UserDefinedItem(
title: item.title, title: item.title,
datum: item.datum, datum: item.datum,
description: item.description, description: item.description,
image: item.image, image: item.image,
), ),
).toList(), ).toList(),
); );
} }
} }
+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