limo_sdk_flutter 1.0.0
limo_sdk_flutter: ^1.0.0 copied to clipboard
A Flutter plugin for LIMO SDK integration, providing native ad functionality.
LIMO SDK Flutter Plugin #
A Flutter plugin for integrating LIMO SDK's native ad functionality into your Flutter applications.
Features #
- Native ad integration with LIMO SDK
- Efficient ad view caching
- Support for both image and video ads
- Automatic ad loading and error handling
- Visibility detection for better performance
Installation #
Add this to your package's pubspec.yaml file:
dependencies:
limo_sdk_flutter:
git:
url: https://github.com/yourusername/limo_sdk_flutter.git
ref: main
Usage #
- Initialize the SDK in your app:
import 'package:limo_sdk_flutter/limo_sdk_flutter.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
// Initialize the SDK with your app ID
final initialized = await LimoSdkFlutter.initSDK('YOUR_APP_ID');
if (!initialized) {
print('Failed to initialize LIMO SDK');
return;
}
runApp(MyApp());
}
- Use the NativeAdWidget in your app:
NativeAdWidget(
width: MediaQuery.of(context).size.width,
height: 280,
adKey: 'unique_ad_key',
adUnitId: 'YOUR_AD_UNIT_ID',
onAdLoaded: () {
print('Ad loaded successfully');
},
onAdError: (error) {
print('Ad failed to load: $error');
},
)
API Reference #
LimoSdkFlutter #
The main class for SDK initialization and configuration.
Methods
initSDK(String appId): Initialize the SDK with your app ID.loadNativeAd({required String spaceId, required double width, required double height}): Load a native ad with specified parameters.
NativeAdWidget #
A widget that displays a native ad.
Properties
width(required): The width of the ad widget.height(required): The height of the ad widget.adKey(required): A unique key for this ad instance.adUnitId(required): The ad unit ID for this ad.onAdLoaded(optional): Callback when the ad is loaded successfully.onAdError(optional): Callback when the ad fails to load.
Example #
See the example directory for a complete example of how to use this plugin.
Contributing #
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License #
This project is licensed under the MIT License - see the LICENSE file for details.