nothing_glyph_interface 0.0.7 copy "nothing_glyph_interface: ^0.0.7" to clipboard
nothing_glyph_interface: ^0.0.7 copied to clipboard

PlatformAndroid

Plugin to control the glyph interface of Nothing Phones for Flutter Android applications.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:nothing_glyph_interface/nothing_glyph_interface.dart';

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

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

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

class _MyAppState extends State<MyApp> {
  late NothingGlyphInterface _glyphInterfacePlugin;

  @override
  void initState() {
    _glyphInterfacePlugin = NothingGlyphInterface();

    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              FutureBuilder(
                future: _glyphInterfacePlugin.is20111(),
                builder: (context, snapshot) {
                  if (snapshot.connectionState == ConnectionState.waiting) {
                    return const CircularProgressIndicator();
                  }

                  return Text('Is Nothing Phone 1: ${snapshot.data}', textAlign: TextAlign.center);
                },
              ),
              FutureBuilder(
                future: _glyphInterfacePlugin.is22111(),
                builder: (context, snapshot) {
                  if (snapshot.connectionState == ConnectionState.waiting) {
                    return const CircularProgressIndicator();
                  }

                  return Text('Is Nothing Phone 2: ${snapshot.data}', textAlign: TextAlign.center);
                },
              ),
              FutureBuilder(
                future: _glyphInterfacePlugin.is23111(),
                builder: (context, snapshot) {
                  if (snapshot.connectionState == ConnectionState.waiting) {
                    return const CircularProgressIndicator();
                  }

                  return Text('Is Nothing Phone 2a: ${snapshot.data}', textAlign: TextAlign.center);
                },
              ),
              FutureBuilder(
                future: _glyphInterfacePlugin.is23113(),
                builder: (context, snapshot) {
                  if (snapshot.connectionState == ConnectionState.waiting) {
                    return const CircularProgressIndicator();
                  }

                  return Text('Is Nothing Phone 2a Plus: ${snapshot.data}', textAlign: TextAlign.center);
                },
              ),
              const SizedBox(height: 30),
              ElevatedButton(
                onPressed: () async {
                  await _glyphInterfacePlugin.buildGlyphFrame(
                      GlyphFrameBuilder().buildChannelA().buildChannel(NothingPhone2.c3).buildPeriod(2000).buildCycles(3).buildInterval(1000).build());
                  await _glyphInterfacePlugin.animate();
                },
                child: const Text("Test"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
3
likes
150
points
35
downloads

Publisher

verified publisherjaykaycooperations.com

Weekly Downloads

Plugin to control the glyph interface of Nothing Phones for Flutter Android applications.

Repository (GitHub)
View/report issues

Topics

#glyph #nothing

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on nothing_glyph_interface