Giter VIP home page Giter VIP logo

accessibility-service-plugin's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

accessibility-service-plugin's Issues

Not work on my phone

Hello:
Thank you for share this plugin with all of us. But I failed on testing your plugin on my phone.

re-production:

  1. include plugin in pubspec.yaml
dependencies:
  accessibility_service: ^0.0.1
  flutter:
    sdk: flutter
  1. import your plugin in main.dart like
import 'package:accessibility_service/accessibility_service.dart';
  1. define variable _opResult and ref to methods provided by plugin
  String _opResult = "default";

  void applyAccessibility() async {
    await AccessibilityServiceManager.requestToStartService();
    setState((){
      _opResult = "request accessibility";
    });
  }

  void getAccessibilityStatus() {
    AccessibilityServiceManager.serviceStatus.then((value) => setState((){
      _opResult = "accessibility status: $value";
    }));
  }
  1. write flutter simple UI
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('安卓辅助功能测试'),
        ),
        body: Column(
          children: <Widget>[
            Text("操作Accessibility 功能:"),
            ElevatedButton(
              onPressed: () => applyAccessibility(),
              child: Text('点击申请', style: TextStyle(fontSize: 10)),
              style: ElevatedButton.styleFrom(
                  primary: Colors.lightBlueAccent,
                  padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 10),
                  textStyle: const TextStyle(
                      fontSize: 30,
                      fontWeight: FontWeight.bold)),
            ),
            ElevatedButton(
              onPressed: () => getAccessibilityStatus(),
              child: Text('查看状态', style: TextStyle(fontSize: 10)),
              style: ElevatedButton.styleFrom(
                  primary: Colors.lightBlueAccent,
                  padding: const EdgeInsets.symmetric(horizontal: 50, vertical: 10),
                  textStyle: const TextStyle(
                      fontSize: 30,
                      fontWeight: FontWeight.bold)),
            ),
            Text('$_opResult'),
          ],
        ),
      ),
    );
  }
  1. test app:
    click first button to request "accessibility functionality"

Screenshot_2021-11-04-15-11-15-194


set “accessibility” selection to TRUE

Screenshot_2021-11-04-15-11-31-288


click second button to check “accessibility” status, which I got "0"

Screenshot_2021-11-04-15-11-41-220

  1. AS log:
    D/Accessibility service( 9627): no callback to process D/Plugin ( 9627): permission denied,please allow it to run this app

Question

I can successfully set accessibility for "accessService" which defined in your plugin.
When I call method "getAccessibilityStatus", I got 0, not 1.
Did i miss some steps?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.