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

A simple Flutter package to rotate an icon based on different compass directions.

example/lib/main.dart

import 'package:compass_icon/compass_direction.dart';
import 'package:compass_icon/compass_icon.dart';
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Compass Icon',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: const Text('Compass Icon'),
        ),
        body: const Center(
          child: CompassIcon(
            icon: Icon(
              Icons.arrow_circle_up,
              size: 100,
            ),
            compassDirection: CompassDirection.north,
            initialDirection: CompassDirection.north,
          ),
        ));
  }
}
0
likes
0
pub points
62%
popularity

Publisher

verified publishertytydraco.xyz

A simple Flutter package to rotate an icon based on different compass directions.

Repository

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on compass_icon