From 37eb93f34f203dd9562baf5a0dfbb77bb2e3e02e Mon Sep 17 00:00:00 2001 From: anitarua Date: Tue, 19 Dec 2023 16:47:42 -0800 Subject: [PATCH] needed to export more stuff --- examples/flutter_chat_app/lib/main.dart | 14 +++++++++++--- examples/topics.dart | 6 ------ lib/client_sdk_dart.dart | 6 ++++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/examples/flutter_chat_app/lib/main.dart b/examples/flutter_chat_app/lib/main.dart index 5429283..9cbca08 100644 --- a/examples/flutter_chat_app/lib/main.dart +++ b/examples/flutter_chat_app/lib/main.dart @@ -1,6 +1,5 @@ +import 'package:client_sdk_dart/client_sdk_dart.dart'; import 'package:flutter/material.dart'; -import 'package:client_sdk_dart/src/auth/credential_provider.dart'; -import 'package:client_sdk_dart/src/config/topic_configurations.dart'; void main() { runApp(const MyApp()); @@ -58,8 +57,17 @@ class MyHomePage extends StatefulWidget { class _MyHomePageState extends State { int _counter = 0; + String momentoApiKey = "eyJlbmRwb2ludCI6ImNlbGwtYWxwaGEtZGV2LnByZXByb2QuYS5tb21lbnRvaHEuY29tIiwiYXBpX2tleSI6ImV5SmhiR2NpT2lKSVV6STFOaUo5LmV5SnpkV0lpT2lKaGJtbDBZVUJ0YjIxbGJuUnZhSEV1WTI5dElpd2lkbVZ5SWpveExDSndJam9pUTBGQlBTSXNJbVY0Y0NJNk1UY3dOVGcyTXpRNE0zMC5rellHNHNScFNxQVNEUV9hNWpTb2Z0ZmQyaGFmcnZtLWM2czdHckg3cE40In0="; + late TopicClient topicClient = TopicClient(CredentialProvider.fromString(momentoApiKey), Mobile.latest()); - void _incrementCounter() { + Future _incrementCounter() async { + final result = await topicClient.publish("cache", "topic", StringValue("Hello")); + switch (result) { + case TopicPublishSuccess(): + print("Success"); + case TopicPublishError(): + print("Error: ${result.message}"); + } setState(() { // This call to setState tells the Flutter framework that something has // changed in this State, which causes it to rerun the build method below diff --git a/examples/topics.dart b/examples/topics.dart index 55e0673..ef57437 100644 --- a/examples/topics.dart +++ b/examples/topics.dart @@ -1,12 +1,6 @@ import 'dart:io'; import 'package:client_sdk_dart/client_sdk_dart.dart'; -import 'package:client_sdk_dart/src/auth/credential_provider.dart'; -import 'package:client_sdk_dart/src/config/topic_configurations.dart'; -import 'package:client_sdk_dart/src/messages/responses/topics/topic_publish.dart'; -import 'package:client_sdk_dart/src/messages/responses/topics/topic_subscribe.dart'; -import 'package:client_sdk_dart/src/messages/responses/topics/topic_subscription_item.dart'; -import 'package:client_sdk_dart/src/messages/values.dart'; import 'package:logging/logging.dart'; void main() async { diff --git a/lib/client_sdk_dart.dart b/lib/client_sdk_dart.dart index 6c393d2..3e572a0 100644 --- a/lib/client_sdk_dart.dart +++ b/lib/client_sdk_dart.dart @@ -4,5 +4,11 @@ library; export 'src/topic_client.dart'; +export 'src/auth/credential_provider.dart'; +export 'src/config/topic_configurations.dart'; +export 'src/messages/values.dart'; +export 'src/messages/responses/topics/topic_publish.dart'; +export 'src/messages/responses/topics/topic_subscribe.dart'; +export 'src/messages/responses/topics/topic_subscription_item.dart'; // TODO: Export any libraries intended for clients of this package.