flutter_qiblah 1.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

Flutter Qiblah #

pub package License: MIT

Getting Started #

To start using this package, add flutter_zoom_drawer dependency to your pubspec.yaml

dependencies:
  flutter_zoom_drawer: '<latest_release>'

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

Screens #

Here is the Example app demo:

Example app Demo

Based on the LocationStatus class, you can add a check to see the current status of the GPS and display an error widget if it's disabled or permission is denied. check the 📝 Example Code

GPS Disabled

For devices with no sensors, a Map can be displayed with the direction from the current/selected location to Mecca. check the 📝 Example Code

Qiblah with maps

Issues #

Please file any issues, bugs or feature request as an issue on our GitHub page.

Want to contribute #

If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug or adding a cool new feature), please carefully review our contribution guide and send us your pull request.

1.0.3 #

  • Upgraded flutter_compass, location_permissions and Geolocator package versions

1.0.2+1 #

  • upgraded flutter_compass version

1.0.2 #

  • updated the requestPermission method to return GeolocationStatus object

1.0.1 #

  • Added dispose method
  • Updated readme

1.0.0 #

  • Flutter Qiblah plugin initial release

example/lib/main.dart

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

import 'package:flutter/services.dart';
import 'package:flutter_qiblah/flutter_qiblah.dart';
import 'package:flutter_qiblah_example/loading_indicator.dart';
import 'package:flutter_qiblah_example/qiblah_compass.dart';
import 'package:flutter_qiblah_example/qiblah_maps.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final _deviceSupport = FlutterQiblah.androidDeviceSensorSupport();

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        primaryColor: Color(0xff0c7b93),
        primaryColorLight: Color(0xff00a8cc),
        primaryColorDark: Color(0xff27496d),
        accentColor: Color(0xffecce6d),
      ),
      darkTheme: ThemeData.dark().copyWith(accentColor: Color(0xffecce6d)),
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: FutureBuilder(
          future: _deviceSupport,
          builder: (_, AsyncSnapshot<bool> snapshot) {
            if (snapshot.connectionState == ConnectionState.waiting)
              return LoadingIndicator();
            if (snapshot.hasError)
              return Center(
                child: Text("Error: ${snapshot.error.toString()}"),
              );

            if (snapshot.data)
              return QiblahCompass();
            else
              return QiblahMaps();
          },
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_qiblah: ^1.0.3

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_qiblah/flutter_qiblah.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

We analyzed this package on Jul 2, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform ios

Because of import path [package:flutter_qiblah/flutter_qiblah.dart, package:geolocator/geolocator.dart, package:google_api_availability/google_api_availability.dart] that declares support for platforms: android

Package does not support Flutter platform linux

Because of import path [package:flutter_qiblah/flutter_qiblah.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:flutter_qiblah/flutter_qiblah.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:flutter_qiblah/flutter_qiblah.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:flutter_qiblah/flutter_qiblah.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [flutter_qiblah] that is in a package requiring null.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
flutter 0.0.0
flutter_compass ^0.4.2+1 0.4.2+1
geolocator ^5.3.2+2 5.3.2+2
location_permissions ^3.0.0 3.0.0+1
stream_transform ^1.2.0 1.2.0
vector_math ^2.0.8 2.0.8
Transitive dependencies
collection 1.14.12 1.14.13
equatable 1.2.0
google_api_availability 2.0.4
meta 1.1.8
rxdart 0.24.1
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
Dev dependencies
flutter_test