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

A Flutter Qibla compass using GPS and compass sensor. Bilingual Arabic/English UI, smooth animations, and real-time alignment feedback.

example/lib/main.dart

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

void main() => runApp(const ExampleApp());

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Qibla Compass Example',
      debugShowCheckedModeBanner: false,
      theme: ThemeData.dark(),
      home: const _HomePage(),
    );
  }
}

class _HomePage extends StatelessWidget {
  const _HomePage();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: const Color(0xFF0A2E24),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            // ── Default theme ────────────────────────────────────────────────
            ElevatedButton(
              style: ElevatedButton.styleFrom(
                backgroundColor: const Color(0xFFCDA047),
                foregroundColor: const Color(0xFF0A2E24),
                padding:
                    const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
                shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(14)),
              ),
              onPressed: () => Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (_) => const QiblaScreen(),
                ),
              ),
              child: const Text(
                'فتح البوصلة  ·  Open Qibla Compass',
                style: TextStyle(fontFamily: 'Amiri', fontSize: 16),
              ),
            ),

            const SizedBox(height: 20),

            // ── Midnight theme ───────────────────────────────────────────────
            ElevatedButton(
              style: ElevatedButton.styleFrom(
                backgroundColor: const Color(0xFF1A2A6C),
                foregroundColor: Colors.white,
                padding:
                    const EdgeInsets.symmetric(horizontal: 32, vertical: 16),
                shape: RoundedRectangleBorder(
                    borderRadius: BorderRadius.circular(14)),
              ),
              onPressed: () => Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (_) => const QiblaScreen(
                    theme: QiblaTheme.midnightTheme,
                  ),
                ),
              ),
              child: const Text(
                'Midnight Theme',
                style: TextStyle(fontSize: 16),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
3
likes
150
points
15
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter Qibla compass using GPS and compass sensor. Bilingual Arabic/English UI, smooth animations, and real-time alignment feedback.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, flutter_compass, geolocator

More

Packages that depend on qibla_compass