accessibilty 1.0.0 copy "accessibilty: ^1.0.0" to clipboard
accessibilty: ^1.0.0 copied to clipboard

This Flutter plugin is able to gather Accessibility data from iOS and Android. It gathers data from the ScreenReader, VoiceOver, font size and many more.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'dart:async';

import 'package:flutter/services.dart';
import 'package:accessibilty/accessibilty.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 _accessibilityStats = 'Unknown';
  final _accessibiltyPlugin = Accessibilty();

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

  // Platform messages are asynchronous, so we initialize in an async method.
  Future<void> initAccessibilityStatsState() async {
    String accessibilityStats;
    // Platform messages may fail, so we use a try/catch PlatformException.
    // We also handle the message potentially returning null.
    try {
      accessibilityStats = await _accessibiltyPlugin.getAccessibilityStats() ??
          'Unknown accessibility stats';
    } on PlatformException {
      accessibilityStats = 'Failed to get accessbility stats.';
    }

    // 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(() {
      _accessibilityStats = accessibilityStats;
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: Text('Running on: $_accessibilityStats\n'),
        ),
      ),
    );
  }
}
0
likes
150
pub points
12%
popularity

Publisher

unverified uploader

This Flutter plugin is able to gather Accessibility data from iOS and Android. It gathers data from the ScreenReader, VoiceOver, font size and many more.

Homepage
Repository (GitLab)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on accessibilty