From 9de633feb9a8bbedd7b584ababcb22ae5623eee6 Mon Sep 17 00:00:00 2001 From: tk Date: Sat, 16 Aug 2025 18:10:28 +0200 Subject: [PATCH] merge frontend changes --- .../wien_talks_flutter/lib/news_screen.dart | 34 +++++++++++++++++++ .../lib/show_latest_news_widget.dart | 5 ++- .../lib/src/quotes/quotes_endpoint.dart | 2 +- 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 wien_talks/wien_talks_flutter/lib/news_screen.dart diff --git a/wien_talks/wien_talks_flutter/lib/news_screen.dart b/wien_talks/wien_talks_flutter/lib/news_screen.dart new file mode 100644 index 0000000..0463223 --- /dev/null +++ b/wien_talks/wien_talks_flutter/lib/news_screen.dart @@ -0,0 +1,34 @@ +import 'package:flutter/material.dart'; +import 'package:go_router/go_router.dart'; +import 'package:wien_talks_flutter/show_latest_news_widget.dart'; +import 'package:wien_talks_flutter/widgets/heading_text.dart'; +import 'package:wien_talks_flutter/widgets/screen_widget.dart'; + +class NewsScreen extends StatelessWidget { + const NewsScreen({ + super.key, + }); + + @override + Widget build(BuildContext context) { + return ScreenWidget( + child: SingleChildScrollView( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + HeadingText(text: "Latest news"), + QuoteList(), + SizedBox( + height: 30, + ), + ElevatedButton( + onPressed: () { + context.pushNamed("create_event"); + }, + child: Text("Submit your own event")), + ], + ), + ), + ); + } +} diff --git a/wien_talks/wien_talks_flutter/lib/show_latest_news_widget.dart b/wien_talks/wien_talks_flutter/lib/show_latest_news_widget.dart index 38dd823..0f50d2c 100644 --- a/wien_talks/wien_talks_flutter/lib/show_latest_news_widget.dart +++ b/wien_talks/wien_talks_flutter/lib/show_latest_news_widget.dart @@ -16,7 +16,10 @@ class ShowLatestNewsWidget extends StatelessWidget { children: [ HeadingText(text: "Latest news"), if (snapshot.hasError) Text('Error: ${snapshot.error}'), - Text(snapshot.data ?? "Be the first to submit amazing news!", style: TextStyle(fontSize: 20, color: Theme.of(context).colorScheme.error)), + Text(snapshot.data ?? "Be the first to submit amazing news!", + style: TextStyle( + fontSize: 20, + color: Theme.of(context).colorScheme.error)), ], ); }); diff --git a/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart b/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart index 4ad4f31..f57732e 100644 --- a/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart +++ b/wien_talks/wien_talks_server/lib/src/quotes/quotes_endpoint.dart @@ -40,7 +40,7 @@ class QuoteEndpoint extends Endpoint { ); final inserted = await session.db.insertRow(quote); - await session.messages.postMessage(_channelQuoteUpdates, quote); + await session.messages.postMessage(_channelQuoteUpdates, inserted); return inserted; }