flutter_qiblah 1.0.1 copy "flutter_qiblah: ^1.0.1" to clipboard
flutter_qiblah: ^1.0.1 copied to clipboard

outdated

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

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();
          },
        ),
      ),
    );
  }
}
160
likes
0
points
1.49k
downloads

Publisher

verified publishermedyas.ml

Weekly Downloads

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

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, flutter_compass, geolocator, stream_transform, vector_math

More

Packages that depend on flutter_qiblah