You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
920 B
Dart
38 lines
920 B
Dart
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');
|
|
}),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|