medyas / flutter_qiblah

Flutter Qiblah is a plugin that allows you to display Qiblah direction in you app with support for both Android and iOS.

Home Page:https://pub.dev/packages/flutter_qiblah

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Execution failed for task ':flutter_compass_v2:compileDebugJavaWithJavac'. > error: invalid source release: 17

sadikRizvi31 opened this issue · comments

Details of device on which I'm installing running :
SM M015G
Android : 12, API : 31.

Here is the code for compass :

class _CompassScreenState extends State {
final _deviceSupport = FlutterQiblah.androidDeviceSensorSupport();
@OverRide
Widget build(BuildContext context) {
return Scaffold(
// Appbar start ===>
appBar: CustomAppBar(
title: 'Qibla Compass',
isBackButtonExist: widget.appBackButton == true ? true : false,
),

  // body start--->
  body: FutureBuilder(
    future: _deviceSupport,
    builder: (_, AsyncSnapshot<bool?> snapshot) {
      // Loading section---->
      if (snapshot.connectionState == ConnectionState.waiting) {
        return const LoadingIndicator();
      }
      // Error message show here--.
      if (snapshot.hasError) {
        return Center(
          child: Text("Error: ${snapshot.error.toString()}"),
        );
      }

      if (snapshot.data!) {
        // QiblahCompass page return here-->
        return const QiblahCompass();
      }
      // error message---.
      return const Center(
          child: Text('Our compass not support in your device'));
    },
  ),
);

}
}

Do let me know if anything else is needed.