compass_view 1.0.2
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 [...]
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)),
],
),
),
);
}
}