merge frontend changes

This commit is contained in:
tk 2025-08-16 18:10:28 +02:00
parent 1ef6e06329
commit 9de633feb9
3 changed files with 39 additions and 2 deletions

View file

@ -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")),
],
),
),
);
}
}

View file

@ -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)),
],
);
});

View file

@ -40,7 +40,7 @@ class QuoteEndpoint extends Endpoint {
);
final inserted = await session.db.insertRow<Quote>(quote);
await session.messages.postMessage(_channelQuoteUpdates, quote);
await session.messages.postMessage(_channelQuoteUpdates, inserted);
return inserted;
}