flutter_qiblah_advanced

pub package License: MIT

Flutter Qiblah direction using device compass and location, with support for Android and iOS.

Community-maintained fork of medyas/flutter_qiblah, republished as flutter_qiblah_advanced on pub.dev. Compass support is provided by flutter_device_compass (fork of medyas/flutter_compass_v2).

Getting Started

Add flutter_qiblah_advanced to your pubspec.yaml:

dependencies:
  flutter_qiblah_advanced: ^4.0.0

The package does not work on the iOS Simulator. To test on iOS, use a real device. See medyas/flutter_qiblah#39.

Features

  • Check device sensor support (Android)
  • Request location permission
  • Check GPS status (enabled and permission status)
  • Receive Qiblah direction, north direction, and Qiblah offset from north

Usage

import 'package:flutter_qiblah_advanced/flutter_qiblah_advanced.dart';

final supported = await FlutterQiblah.androidDeviceSensorSupport();
final status = await FlutterQiblah.checkLocationStatus();

FlutterQiblah.qiblahStream.listen((QiblahDirection direction) {
  print('Qiblah: ${direction.qiblah}, North: ${direction.direction}');
});

Screens

Example app demo (from upstream):

Example app Demo

Based on the LocationStatus class, you can check GPS and permission state and show an error widget when needed. See the example app.

GPS Disabled

For devices without rotation-vector sensors, a map can show direction from the current location to Mecca. See the example app.

Qiblah with maps

Issues

Please file issues on GitHub.

License

MIT — see LICENSE. Original work Copyright (c) 2020 medyas.