ampliffy_ctv 0.0.0 copy "ampliffy_ctv: ^0.0.0" to clipboard
ampliffy_ctv: ^0.0.0 copied to clipboard

Ampliffy CTV Flutter plugin project.

example/lib/main.dart

import 'package:flutter/material.dart';

// Import Ampliffy CTV Plugin
import 'package:ampliffy_ctv/ampliffy_ctv.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  final _ampliffyCtvPlugin = AmpliffyCtv();

  // This is where we will store the battery level
  num? _batteryLevel;

  @override
  void initState() {
    super.initState();

    // Execute the method to retrieve the battery level
    _ampliffyCtvPlugin.getBatteryLevel().then((batteryLevel) {
      setState(() {
        _batteryLevel = batteryLevel;
      });
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          // we display the battery level
          child: _batteryLevel != null
              ? Text('Battery Level: $_batteryLevel')
              : const CircularProgressIndicator(),
        ),
      ),
    );
  }
}
0
likes
150
points
17
downloads

Publisher

unverified uploader

Weekly Downloads

Ampliffy CTV Flutter plugin project.

Homepage

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on ampliffy_ctv

Packages that implement ampliffy_ctv