flutter_ad_gromore 0.1.0 copy "flutter_ad_gromore: ^0.1.0" to clipboard
flutter_ad_gromore: ^0.1.0 copied to clipboard

集成穿山甲广告,GroMore聚合sdk 6.1.2.5

example/lib/main.dart

/*
 * @Author: lipeng [email protected]
 * @Date: 2024-06-01 09:36:40
 * @LastEditors: lipeng [email protected]
 * @LastEditTime: 2024-06-06 21:43:11
 * @FilePath: /flutterad/example/lib/main.dart
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:flutter_ad_gromore/flutterad.dart';

import 'ad/home.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  String _platformVersion = 'Unknown';
  final _flutteradPlugin = Flutterad();

  @override
  void initState() {
    super.initState();
    // initPlatformState();
  }

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initPlatformState() async {
    String platformVersion;
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.
    try {
      platformVersion = await _flutteradPlugin.getPlatformVersion() ??
          'Unknown platform version';
    } on PlatformException {
      platformVersion = 'Failed to get platform version.';
    }

    // If the widget was removed from the tree while the asynchronous platform
    // message was in flight, we want to discard the reply rather than calling
    // setState to update our non-existent appearance.
    if (!mounted) return;

    setState(() {
      _platformVersion = platformVersion;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: HomePage(),
      ),
    );
  }
}
1
likes
130
points
18
downloads

Publisher

unverified uploader

Weekly Downloads

集成穿山甲广告,GroMore聚合sdk 6.1.2.5

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on flutter_ad_gromore

Packages that implement flutter_ad_gromore