magnetic_declination 1.0.0 copy "magnetic_declination: ^1.0.0" to clipboard
magnetic_declination: ^1.0.0 copied to clipboard

A Flutter plugin for calculating magnetic declination on Android and iOS.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: Text('Magnetic Declination Example')),
        body: Center(
          child: FutureBuilder<double>(
            future: MagneticDeclination.calculateDeclination(37.7749, -122.4194, 10, DateTime.now()),
            builder: (context, snapshot) {
              if (snapshot.connectionState == ConnectionState.waiting) {
                return CircularProgressIndicator();
              }
              if (snapshot.hasError) {
                return Text('Error: ${snapshot.error}');
              }
              return Text('Magnetic Declination: ${snapshot.data}°');
            },
          ),
        ),
      ),
    );
  }
}
0
likes
150
points
32
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for calculating magnetic declination on Android and iOS.

Repository

Documentation

API reference

License

LGPL-3.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on magnetic_declination

Packages that implement magnetic_declination