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

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

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final double _outerRadius = 99;
  final double _innerRadius = 99 / 2;

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('云台方向按钮widget'),
        ),
        body: Center(
          child: SizedBox(
            width: 2 * _outerRadius,
            height: 2 * _outerRadius,
            child: PtControlWidget(
                innerRadius: _innerRadius,
                outerRadius: _outerRadius,
                callback: (status) {
                  print('status = $status');
                }),
          ),
        ),
      ),
    );
  }
}
