compass_view 1.0.2 copy "compass_view: ^1.0.2" to clipboard
compass_view: ^1.0.2 copied to clipboard

A customizable and lightweight Flutter package that provides beautiful compass UI components and direction/heading utilities out of the box. Designed for easy integration and scalability, this package [...]

example/lib/main.dart

import 'package:compass_view/compass_view.dart'; // ← Your package
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Compass Example',
      theme: ThemeData(colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple)),
      home: const CompassHomePage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('Compass View', style: TextStyle(color: Colors.white)), backgroundColor: Colors.black),
      body: SizedBox(
        width: double.infinity,
        child: Column(
          spacing: 24,
          mainAxisAlignment: MainAxisAlignment.center,
          crossAxisAlignment: CrossAxisAlignment.center,
          children: [
            CompassWidget(
              size: 100,
              backgroundColor: Colors.black,
              showPointer: false,
              markerColor: Colors.black,
              textStyle: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black),
            ),

            CompassWidget(
              size: 300,
              backgroundColor: Colors.white,
              markerColor: Colors.black,
              textStyle: TextStyle(fontSize: 22, fontWeight: FontWeight.bold, color: Colors.black),
            ),
            CompassHeading(textStyle: TextStyle(fontSize: 32, fontWeight: FontWeight.bold, color: Colors.black)),
          ],
        ),
      ),
    );
  }
}
2
likes
130
points
38
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable and lightweight Flutter package that provides beautiful compass UI components and direction/heading utilities out of the box. Designed for easy integration and scalability, this package makes it simple to build compass-based applications with minimal effort.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_compass

More

Packages that depend on compass_view