mirror of
https://github.com/timokz/flutter-vienna-hackathon-25.git
synced 2025-11-08 21:24:20 +01:00
merge frontend changes
This commit is contained in:
parent
1ef6e06329
commit
9de633feb9
3 changed files with 39 additions and 2 deletions
34
wien_talks/wien_talks_flutter/lib/news_screen.dart
Normal file
34
wien_talks/wien_talks_flutter/lib/news_screen.dart
Normal 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")),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -16,7 +16,10 @@ class ShowLatestNewsWidget extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
HeadingText(text: "Latest news"),
|
HeadingText(text: "Latest news"),
|
||||||
if (snapshot.hasError) Text('Error: ${snapshot.error}'),
|
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)),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ class QuoteEndpoint extends Endpoint {
|
||||||
);
|
);
|
||||||
|
|
||||||
final inserted = await session.db.insertRow<Quote>(quote);
|
final inserted = await session.db.insertRow<Quote>(quote);
|
||||||
await session.messages.postMessage(_channelQuoteUpdates, quote);
|
await session.messages.postMessage(_channelQuoteUpdates, inserted);
|
||||||
|
|
||||||
return inserted;
|
return inserted;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue