rename/export Flutter widgets

This commit is contained in:
Nick Fisher
2024-06-17 13:19:24 +08:00
parent e1aad2425f
commit 436b978537
4 changed files with 20 additions and 18 deletions

View File

@@ -3,15 +3,15 @@ import 'dart:io';
import 'package:thermion_dart/thermion_dart/thermion_viewer.dart'; import 'package:thermion_dart/thermion_dart/thermion_viewer.dart';
import 'package:flutter/foundation.dart'; import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'filament_gesture_detector_desktop.dart'; import 'thermion_gesture_detector_desktop.dart';
import 'filament_gesture_detector_mobile.dart'; import 'thermion_gesture_detector_mobile.dart';
enum GestureType { rotateCamera, panCamera, panBackground } enum GestureType { rotateCamera, panCamera, panBackground }
/// ///
/// A widget that translates finger/mouse gestures to zoom/pan/rotate actions. /// A widget that translates finger/mouse gestures to zoom/pan/rotate actions.
/// ///
class FilamentGestureDetector extends StatelessWidget { class ThermionGestureDetector extends StatelessWidget {
/// ///
/// The content to display below the gesture detector/listener widget. /// The content to display below the gesture detector/listener widget.
/// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary. /// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary.
@@ -45,7 +45,7 @@ class FilamentGestureDetector extends StatelessWidget {
final void Function(ScaleUpdateDetails)? onScaleUpdate; final void Function(ScaleUpdateDetails)? onScaleUpdate;
final void Function(ScaleEndDetails)? onScaleEnd; final void Function(ScaleEndDetails)? onScaleEnd;
const FilamentGestureDetector( const ThermionGestureDetector(
{Key? key, {Key? key,
required this.controller, required this.controller,
this.child, this.child,
@@ -68,7 +68,7 @@ class FilamentGestureDetector extends StatelessWidget {
if (kIsWeb || Platform.isLinux || if (kIsWeb || Platform.isLinux ||
Platform.isWindows || Platform.isWindows ||
Platform.isMacOS) { Platform.isMacOS) {
return FilamentGestureDetectorDesktop( return ThermionGestureDetectorDesktop(
controller: controller, controller: controller,
child: child, child: child,
showControlOverlay: showControlOverlay, showControlOverlay: showControlOverlay,
@@ -76,7 +76,7 @@ class FilamentGestureDetector extends StatelessWidget {
enablePicking: enablePicking, enablePicking: enablePicking,
); );
} else { } else {
return FilamentGestureDetectorMobile( return ThermionGestureDetectorMobile(
controller: controller, controller: controller,
child: child, child: child,
showControlOverlay: showControlOverlay, showControlOverlay: showControlOverlay,

View File

@@ -7,7 +7,7 @@ import 'package:flutter/material.dart';
/// ///
/// A widget that translates finger/mouse gestures to zoom/pan/rotate actions. /// A widget that translates finger/mouse gestures to zoom/pan/rotate actions.
/// ///
class FilamentGestureDetectorDesktop extends StatefulWidget { class ThermionGestureDetectorDesktop extends StatefulWidget {
/// ///
/// The content to display below the gesture detector/listener widget. /// The content to display below the gesture detector/listener widget.
/// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary. /// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary.
@@ -37,7 +37,7 @@ class FilamentGestureDetectorDesktop extends StatefulWidget {
/// ///
final bool enablePicking; final bool enablePicking;
const FilamentGestureDetectorDesktop( const ThermionGestureDetectorDesktop(
{Key? key, {Key? key,
required this.controller, required this.controller,
this.child, this.child,
@@ -47,11 +47,11 @@ class FilamentGestureDetectorDesktop extends StatefulWidget {
: super(key: key); : super(key: key);
@override @override
State<StatefulWidget> createState() => _FilamentGestureDetectorDesktopState(); State<StatefulWidget> createState() => _ThermionGestureDetectorDesktopState();
} }
class _FilamentGestureDetectorDesktopState class _ThermionGestureDetectorDesktopState
extends State<FilamentGestureDetectorDesktop> { extends State<ThermionGestureDetectorDesktop> {
/// ///
/// ///
/// ///
@@ -69,7 +69,7 @@ class _FilamentGestureDetectorDesktopState
} }
@override @override
void didUpdateWidget(FilamentGestureDetectorDesktop oldWidget) { void didUpdateWidget(ThermionGestureDetectorDesktop oldWidget) {
if (widget.showControlOverlay != oldWidget.showControlOverlay || if (widget.showControlOverlay != oldWidget.showControlOverlay ||
widget.enableCamera != oldWidget.enableCamera || widget.enableCamera != oldWidget.enableCamera ||
widget.enablePicking != oldWidget.enablePicking) { widget.enablePicking != oldWidget.enablePicking) {

View File

@@ -7,7 +7,7 @@ enum GestureType { rotateCamera, panCamera, panBackground }
/// ///
/// A widget that translates finger/mouse gestures to zoom/pan/rotate actions. /// A widget that translates finger/mouse gestures to zoom/pan/rotate actions.
/// ///
class FilamentGestureDetectorMobile extends StatefulWidget { class ThermionGestureDetectorMobile extends StatefulWidget {
/// ///
/// The content to display below the gesture detector/listener widget. /// The content to display below the gesture detector/listener widget.
/// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary. /// This will usually be a ThermionWidget (so you can navigate by directly interacting with the viewport), but this is not necessary.
@@ -43,7 +43,7 @@ class FilamentGestureDetectorMobile extends StatefulWidget {
final void Function(ScaleUpdateDetails)? onScaleUpdate; final void Function(ScaleUpdateDetails)? onScaleUpdate;
final void Function(ScaleEndDetails)? onScaleEnd; final void Function(ScaleEndDetails)? onScaleEnd;
const FilamentGestureDetectorMobile( const ThermionGestureDetectorMobile(
{Key? key, {Key? key,
required this.controller, required this.controller,
this.child, this.child,
@@ -57,11 +57,11 @@ class FilamentGestureDetectorMobile extends StatefulWidget {
: super(key: key); : super(key: key);
@override @override
State<StatefulWidget> createState() => _FilamentGestureDetectorMobileState(); State<StatefulWidget> createState() => _ThermionGestureDetectorMobileState();
} }
class _FilamentGestureDetectorMobileState class _ThermionGestureDetectorMobileState
extends State<FilamentGestureDetectorMobile> { extends State<ThermionGestureDetectorMobile> {
GestureType gestureType = GestureType.panCamera; GestureType gestureType = GestureType.panCamera;
final _icons = { final _icons = {
@@ -116,7 +116,7 @@ class _FilamentGestureDetectorMobileState
} }
@override @override
void didUpdateWidget(FilamentGestureDetectorMobile oldWidget) { void didUpdateWidget(ThermionGestureDetectorMobile oldWidget) {
if (widget.showControlOverlay != oldWidget.showControlOverlay || if (widget.showControlOverlay != oldWidget.showControlOverlay ||
widget.enableCamera != oldWidget.enableCamera || widget.enableCamera != oldWidget.enableCamera ||
widget.enablePicking != oldWidget.enablePicking) { widget.enablePicking != oldWidget.enablePicking) {

View File

@@ -2,4 +2,6 @@ library thermion_flutter;
export 'thermion/thermion_flutter_plugin.dart'; export 'thermion/thermion_flutter_plugin.dart';
export 'thermion/widgets/thermion_widget.dart'; export 'thermion/widgets/thermion_widget.dart';
export 'thermion/widgets/camera/gestures/thermion_gesture_detector.dart';
export 'package:thermion_dart/thermion_dart.dart'; export 'package:thermion_dart/thermion_dart.dart';