How to configure Feed on Web?
For getting started, please refer to this doc.
The config
parameter is an instance of LMFeedConfig
and it allows you to configure various settings for the LikeMinds Feed SDK. In this code snippet, it sets the webConfiguration
property of LMFeedConfig
to an instance of LMFeedWebConfiguration
with a maxWidth
of 800.
note
This restricts the post width on the web to be at max 800 pixels.
Here's the code snippet:
LMResponse response = await LMFeedCore.instance.initialize(
config: LMFeedConfig(
webConfiguration: const LMFeedWebConfiguration(maxWidth: 800),
),
);
This code initializes the LikeMinds Feed SDK with the specified web configuration.
For changing the scrolling behavior on the web you can pass the following class in your Material App
/// A custom scroll behavior class for web applications in the LikeMindsFeedCore library.
///
/// This class extends the [MaterialScrollBehavior] class and overrides the [dragDevices] getter
/// to specify the supported pointer devices for scrolling.
///
/// By default, the [MaterialScrollBehavior] class supports mouse devices on web.
/// However, in this custom behavior, we only support touch and mouse devices for dragging.
///
import 'package:likeminds_feed_flutter_core/likeminds_feed_core.dart';
class MyApp extends StatelessWidget {
Widget build(BuildContext context) {
return MaterialApp(
scrollBehavior: LMWebScrollBehavior(), // Apply the custom scroll behavior
home: MyHomePage(),
);
}
}