Compare commits

..

No commits in common. "642dddaaa3051fcb14bf6f41a0bf52c20e72c63b" and "35edff13efc35c9b254d3d0e0a5c035426a75219" have entirely different histories.

4 changed files with 5 additions and 12 deletions

View file

@ -22,14 +22,9 @@ class FunmapMgr {
// address by running `ipconfig` on Windows or `ifconfig` on Mac/Linux.
// You can set the variable when running or building your app like this:
// E.g. `flutter run --dart-define=SERVER_URL=https://api.example.com/`
const serverUrlFromEnv = String.fromEnvironment('SERVER_URL');
final serverUrl =
serverUrlFromEnv.isEmpty ? 'http://$localhost:8080/' : serverUrlFromEnv;
final serverUrl = serverUrlFromEnv.isEmpty ? 'http://localhost:8080/' : serverUrlFromEnv;
client = Client(serverUrl, connectionTimeout: const Duration(seconds: 5))
..connectivityMonitor = FlutterConnectivityMonitor();
client.openStreamingConnection();
client = Client(serverUrl, connectionTimeout: const Duration(seconds: 5))..connectivityMonitor = FlutterConnectivityMonitor();
}
}

View file

@ -1,9 +1,7 @@
import 'package:flutter/material.dart';
import 'package:wien_talks_flutter/helper/funmap_mgr.dart';
import 'package:wien_talks_flutter/helper/go_router.dart';
void main() {
FunmapMgr();
runApp(const MyApp());
}

View file

@ -10,8 +10,7 @@ class AddQuoteFab extends StatelessWidget {
@override
Widget build(BuildContext context) {
return FloatingActionButton(onPressed: () {
FunmapMgr().client.quote.createQuote(
CreateQuoteRequest(text: 'Quote Text', lat: 22, lng: 140));
FunmapMgr().client.quote.createQuote(CreateQuoteRequest(text: 'Quote Text', lat: 22, lng: 140));
});
}
}

View file

@ -54,6 +54,7 @@ class QuoteEndpoint extends Endpoint {
throw Exception('Quote not found');
}
// Only for dev
Future<List<Quote>> getAllQuotes(Session session) async {
final quotes = await Quote.db.find(session);
return quotes;
@ -65,7 +66,7 @@ class QuoteEndpoint extends Endpoint {
}) async* {
if (limit <= 0 || limit > 500) limit = 200;
final quoteStream = session.messages.createStream<Quote>('quotes');
final quoteStream = session.messages.createStream('quotes');
await for (final Quote quote in quoteStream) {
yield quote;