Skip to content

Commit

Permalink
Merge pull request #54 from LikeMindsCommunity/release/v1.2.1
Browse files Browse the repository at this point in the history
Release/v1.2.1
  • Loading branch information
TyagiLikeMinds authored Nov 1, 2023
2 parents 454409a + a2c22df commit 4ecc9bc
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 285 deletions.
6 changes: 3 additions & 3 deletions example/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data
android:scheme="feedsuraasa"
android:host="www.feedsuraasa.com" />
android:scheme="suraasalearn"
android:host="www.suraasa.com" />
<data
android:scheme="https"
android:host="feedsuraasa.com" />
android:host="suraasa.com" />
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
Expand Down
2 changes: 1 addition & 1 deletion example/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<string>com.suraasa.likeminds.dev</string>
<key>CFBundleURLSchemes</key>
<array>
<string>feedsuraasa</string>
<string>suraasalearn</string>
</array>
</dict>
</array>
Expand Down
9 changes: 5 additions & 4 deletions example/lib/likeminds_callback.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'package:flutter/cupertino.dart';
import 'package:likeminds_feed/likeminds_feed.dart';

/// This class is used to implement the [LMSDKCallback] interface
Expand All @@ -9,9 +10,9 @@ class LikeMindsCallback implements LMSDKCallback {
/// [propertiesMap] is the map of properties associated with the event
@override
void eventFiredCallback(String eventKey, Map<String, dynamic> propertiesMap) {
print("Main event fired callback in UI: $eventKey");
debugPrint("Main event fired callback in UI: $eventKey");
propertiesMap.forEach((key, value) {
print("Key: $key, Value: $value");
debugPrint("Key: $key, Value: $value");
});
}

Expand All @@ -33,11 +34,11 @@ class LikeMindsCallback implements LMSDKCallback {

@override
void profileRouteCallback({required String lmUserId}) {
print("LM User ID caught in callback : $lmUserId");
debugPrint("LM User ID caught in callback : $lmUserId");
}

@override
void routeToCompanyCallback({required String companyId}) {
print("Company ID caught in callback : $companyId");
debugPrint("Company ID caught in callback : $companyId");
}
}
2 changes: 1 addition & 1 deletion example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.2.0
version: 1.2.1

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,7 @@ class _TypeAheadFieldState<T> extends State<TypeAheadField<T>>

TextEditingController? get _effectiveController =>
widget.textFieldConfiguration.controller ?? _textEditingController;

FocusNode? get _effectiveFocusNode =>
widget.textFieldConfiguration.focusNode ?? _focusNode;
late VoidCallback _focusNodeListener;
Expand All @@ -590,8 +591,10 @@ class _TypeAheadFieldState<T> extends State<TypeAheadField<T>>

// Timer that resizes the suggestion box on each tick. Only active when the user is scrolling.
Timer? _resizeOnScrollTimer;

// The rate at which the suggestion box will resize when the user is scrolling
final Duration _resizeOnScrollRefreshRate = const Duration(milliseconds: 500);

// Will have a value if the typeahead is inside a scrollable widget
ScrollPosition? _scrollPosition;

Expand Down Expand Up @@ -858,6 +861,7 @@ class _TypeAheadFieldState<T> extends State<TypeAheadField<T>>
onTagTap: widget.onTagTap ?? null,
tagColor: widget.tagColor,
),
scrollPhysics: const NeverScrollableScrollPhysics(),
focusNode: this._effectiveFocusNode,
controller: this._effectiveController,
decoration: widget.textFieldConfiguration.decoration,
Expand Down
62 changes: 62 additions & 0 deletions lib/src/services/likeminds_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,46 +12,87 @@ const _prodFlag = !bool.fromEnvironment('DEBUG');

abstract class ILikeMindsService {
Future<InitiateUserResponse> initiateUser(InitiateUserRequest request);

Future<LogoutResponse> logout(LogoutRequest request);

Future<MemberStateResponse> getMemberState();

Future<GetFeedResponse?> getFeed(GetFeedRequest request);

Future<GetFeedRoomResponse> getFeedRoom(GetFeedRoomRequest request);

Future<GetFeedOfFeedRoomResponse> getFeedOfFeedRoom(
GetFeedOfFeedRoomRequest request);

Future<GetNotificationFeedResponse> getNotificationFeed(
GetNotificationFeedRequest request);

Future<GetUnreadNotificationCountResponse> getUnreadNotificationCount();

Future<AddPostResponse> addPost(AddPostRequest request);

Future<GetPostResponse> getPost(GetPostRequest request);

Future<PostDetailResponse> getPostDetails(PostDetailRequest request);

Future<GetPostLikesResponse> getPostLikes(GetPostLikesRequest request);

Future<PinPostResponse> pinPost(PinPostRequest request);

Future<SavePostResponse> savePost(SavePostRequest request);

Future<EditPostResponse> editPost(EditPostRequest request);

Future<GetCommentLikesResponse> getCommentLikes(
GetCommentLikesRequest request);

Future<DeletePostResponse> deletePost(DeletePostRequest request);

Future<LikePostResponse> likePost(LikePostRequest request);

Future<AddCommentResponse> addComment(AddCommentRequest request);

Future<GetCommentResponse> getComment(GetCommentRequest request);

Future<ToggleLikeCommentResponse> toggleLikeComment(
ToggleLikeCommentRequest request);

Future<DeleteCommentResponse> deleteComment(DeleteCommentRequest request);

Future<EditCommentResponse> editComment(EditCommentRequest request);

Future<AddCommentReplyResponse> addCommentReply(
AddCommentReplyRequest request);

Future<EditCommentReplyResponse> editCommentReply(
EditCommentReplyRequest request);

Future<String?> uploadFile(File file, String userUniqueId);

Future<RegisterDeviceResponse> registerDevice(RegisterDeviceRequest request);

Future<GetTaggingListResponse> getTaggingList(
{required GetTaggingListRequest request});

Future<DecodeUrlResponse> decodeUrl(DecodeUrlRequest request);

Future<MarkReadNotificationResponse> markReadNotification(
MarkReadNotificationRequest request);

Future<GetDeleteReasonResponse> getReportTags(GetDeleteReasonRequest request);

Future<GetTopicsResponse> getTopics(GetTopicsRequest request);

Future<GetCommunityConfigurationsResponse> getCommunityConfigurations();

Future<GetUserFeedResponse> getUserFeed(GetUserFeedRequest userFeedRequest);

Future<GetWidgetResponse> getWidgets(GetWidgetRequest request);

Future<GetProfileResponse> getProfile(GetProfileRequest request);

Future<EditProfileResponse> editProfile(EditProfileRequest request);

void routeToProfile(String userId);
}

Expand Down Expand Up @@ -80,6 +121,7 @@ class LikeMindsService implements ILikeMindsService {
..apiKey(key)
..sdkCallback(sdkCallback))
.build();
LMAnalytics.get().initialize();
}

@override
Expand Down Expand Up @@ -278,6 +320,26 @@ class LikeMindsService implements ILikeMindsService {
return _sdkApplication.getTopics(request);
}

@override
Future<GetUserFeedResponse> getUserFeed(GetUserFeedRequest userFeedRequest) {
return _sdkApplication.getUserFeed(userFeedRequest);
}

@override
Future<GetWidgetResponse> getWidgets(GetWidgetRequest request) {
return _sdkApplication.getWidgets(request);
}

@override
Future<GetProfileResponse> getProfile(GetProfileRequest request) {
return _sdkApplication.getProfile(request);
}

@override
Future<EditProfileResponse> editProfile(EditProfileRequest request) {
return _sdkApplication.editProfile(request);
}

@override
void routeToProfile(String userId) {
debugPrint(userId);
Expand Down
15 changes: 14 additions & 1 deletion lib/src/utils/analytics/analytics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,31 @@ import 'package:likeminds_feed_ui_fl/likeminds_feed_ui_fl.dart';

class LMAnalytics {
static LMAnalytics? _instance;

static LMAnalytics get() => _instance ??= LMAnalytics._();

LMSDKCallback? sdkCallback;

LMAnalytics._();

void initialize() {
sdkCallback =
DIService.getIt.isRegistered<LMSDKCallback>(instanceName: "LMCallback")
? DIService.getIt.get<LMSDKCallback>(
instanceName: "LMCallback",
)
: null;
debugPrint("Analytics initialized");
}

void logEvent(String eventKey, Map<String, dynamic> propertiesMap) {
debugPrint('Event: $eventKey');
debugPrint('Params: $propertiesMap');
}

void track(String eventKey, Map<String, dynamic> propertiesMap) {
logEvent(eventKey, propertiesMap);
// TODO: Add your analytics logic here
sdkCallback?.eventFiredCallback(eventKey, propertiesMap);
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/utils/share/share_post.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SharePost {
static String userId = prodFlag ? CredsProd.botId : CredsDev.botId;
static String apiKey = prodFlag ? CredsProd.apiKey : CredsDev.apiKey;
// TODO: Add domain to your application
String domain = 'feedsuraasa://www.feedsuraasa.com';
String domain = 'suraasalearn://www.suraasa.com';
// fetches the domain given by client at time of initialization of Feed

// below function creates a link from domain and post id
Expand Down
5 changes: 3 additions & 2 deletions lib/src/utils/tagging/tagging_textfield_ta.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TaggingAheadTextField extends StatefulWidget {
final TextEditingController controller;
final InputDecoration? decoration;
final Function(String)? onChange;
final int maxLines;
final int? maxLines;
final int minLines;

const TaggingAheadTextField({
Expand All @@ -26,7 +26,7 @@ class TaggingAheadTextField extends StatefulWidget {
required this.focusNode,
this.decoration,
required this.onChange,
this.maxLines = 200,
this.maxLines,
this.minLines = 1,
});

Expand Down Expand Up @@ -118,6 +118,7 @@ class _TaggingAheadTextFieldState extends State<TaggingAheadTextField> {
padding: const EdgeInsets.symmetric(horizontal: 6.0),
child: TypeAheadField<UserTag>(
onTagTap: (p) {},

suggestionsBoxController: _suggestionsBoxController,
suggestionsBoxDecoration: SuggestionsBoxDecoration(
elevation: 4,
Expand Down
2 changes: 2 additions & 0 deletions lib/src/views/post/edit_post_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import 'package:url_launcher/url_launcher.dart';
class EditPostScreen extends StatefulWidget {
static const String route = '/edit_post_screen';
final String postId;

const EditPostScreen({
super.key,
required this.postId,
Expand Down Expand Up @@ -405,6 +406,7 @@ class _EditPostScreenState extends State<EditPostScreen> {
: Container(
padding: const EdgeInsets.only(
top: kPaddingSmall,
left: 44.0,
),
height: 180,
alignment: Alignment.center,
Expand Down
Loading

0 comments on commit 4ecc9bc

Please sign in to comment.