Skip to content

Commit

Permalink
Added static string type to every widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Gold872 committed Dec 4, 2023
1 parent 7b08892 commit be1b779
Show file tree
Hide file tree
Showing 31 changed files with 62 additions and 31 deletions.
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/accelerometer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class AccelerometerWidget extends NT4Widget {
static const String widgetType = 'Accelerometer';
@override
String type = 'Accelerometer';
String type = widgetType;

late String valueTopic;
late NT4Subscription valueSubscription;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/camera_stream.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import 'package:http/http.dart';
import 'package:provider/provider.dart';

class CameraStreamWidget extends NT4Widget {
static const String widgetType = 'Camera Stream';
@override
String type = 'Camera Stream';
String type = widgetType;

late String streamsTopic;

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/combo_box_chooser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ComboBoxChooser extends NT4Widget {
static const String widgetType = 'ComboBox Chooser';
@override
String type = 'ComboBox Chooser';
String type = widgetType;

late String optionsTopicName;
late String selectedTopicName;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/command_scheduler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class CommandSchedulerWidget extends NT4Widget {
static const String widgetType = 'Scheduler';
@override
String type = 'Scheduler';
String type = widgetType;

NT4Topic? cancelTopic;

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/command_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class CommandWidget extends NT4Widget {
static const String widgetType = 'Command';
@override
String type = 'Command';
String type = widgetType;

NT4Topic? runningTopic;

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/differential_drive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class DifferentialDrive extends NT4Widget {
static const String widgetType = 'DifferentialDrive';
@override
String type = 'DifferentialDrive';
String type = widgetType;

late String leftSpeedTopicName;
late String rightSpeedTopicName;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/encoder_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class EncoderWidget extends NT4Widget {
static const String widgetType = 'Encoder';
@override
String type = 'Encoder';
String type = widgetType;

late String distanceTopic;
late String speedTopic;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/field_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ import 'package:vector_math/vector_math_64.dart'
show Matrix3, Quaternion, Vector3, radians;

class FieldWidget extends NT4Widget {
static const String widgetType = 'Field';
@override
String type = 'Field';
String type = widgetType;

String fieldGame = 'Charged Up';
late Field? field;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/fms_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:patterns_canvas/patterns_canvas.dart';
import 'package:provider/provider.dart';

class FMSInfo extends NT4Widget {
static const String widgetType = 'FMSInfo';
@override
String type = 'FMSInfo';
String type = widgetType;

static const int ENABLED_FLAG = 0x01;
static const int AUTO_FLAG = 0x02;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/gyro.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class Gyro extends NT4Widget {
static const String widgetType = 'Gyro';
@override
String type = 'Gyro';
String type = widgetType;

bool counterClockwisePositive = false;

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/motor_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class MotorController extends NT4Widget {
static const String widgetType = 'Motor Controller';
@override
String type = 'Motor Controller';
String type = widgetType;

late String valueTopic;
late NT4Subscription valueSubscription;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/network_alerts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class NetworkAlerts extends NT4Widget {
static const String widgetType = 'Alerts';
@override
String type = 'Alerts';
String type = widgetType;

late String errorsTopicName;
late String warningsTopicName;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/pid_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class PIDControllerWidget extends NT4Widget {
static const String widgetType = 'PIDController';
@override
String type = 'PIDController';
String type = widgetType;

late String kpTopicName;
late String kiTopicName;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/power_distribution.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class PowerDistribution extends NT4Widget {
static const String widgetType = 'PowerDistribution';
@override
String type = 'PowerDistribution';
String type = widgetType;

static int numberOfChannels = 23;

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/relay_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class RelayWidget extends NT4Widget {
static const String widgetType = 'Relay';
@override
String type = 'Relay';
String type = widgetType;

late String valueTopicName;
late NT4Subscription valueSubscription;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/robot_preferences.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:searchable_listview/searchable_listview.dart';

class RobotPreferences extends NT4Widget {
static const String widgetType = 'RobotPreferences';
@override
String type = 'RobotPreferences';
String type = widgetType;

TextEditingController searchTextController = TextEditingController();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class SplitButtonChooser extends NT4Widget {
static const String widgetType = 'Split Button Chooser';
@override
String type = 'Split Button Chooser';
String type = widgetType;

late String optionsTopicName;
late String selectedTopicName;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/subsystem_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class SubsystemWidget extends NT4Widget {
static const String widgetType = 'Subsystem';
@override
String type = 'Subsystem';
String type = widgetType;

late String defaultCommandTopic;
late String currentCommandTopic;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/multi-topic/swerve_drive.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ import 'package:provider/provider.dart';
import 'package:vector_math/vector_math_64.dart' show radians;

class SwerveDriveWidget extends NT4Widget {
static const String widgetType = 'SwerveDrive';
@override
String type = 'SwerveDrive';
String type = widgetType;

late String frontLeftAngleTopic;
late String frontLeftVelocityTopic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ThreeAxisAccelerometer extends NT4Widget {
static const String widgetType = '3-Axis Accelerometer';
@override
String type = '3-Axis Accelerometer';
String type = widgetType;

late String xTopic;
late String yTopic;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/boolean_box.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class BooleanBox extends NT4Widget {
static const String widgetType = 'Boolean Box';
@override
String type = 'Boolean Box';
String type = widgetType;

late Color trueColor;
late Color falseColor;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/graph.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_charts/charts.dart';

class GraphWidget extends NT4Widget {
static const String widgetType = 'Graph';
@override
String type = 'Graph';
String type = widgetType;

late double timeDisplayed;
double? minValue;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/match_time.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class MatchTimeWidget extends NT4Widget {
static const String widgetType = 'Match Time';
@override
String type = 'Match Time';
String type = widgetType;

MatchTimeWidget({super.key, required super.topic, super.period}) : super();

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/multi_color_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class MultiColorView extends NT4Widget {
static const String widgetType = 'Multi Color View';
@override
String type = 'Multi Color View';
String type = widgetType;

MultiColorView({super.key, required super.topic, super.period}) : super();

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/number_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class NumberBar extends NT4Widget {
static const String widgetType = 'Number Bar';
@override
String type = 'Number Bar';
String type = widgetType;

late double minValue;
late double maxValue;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/number_slider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class NumberSlider extends NT4Widget {
static const String widgetType = 'Number Slider';
@override
final String type = 'Number Slider';
final String type = widgetType;

late double minValue;
late double maxValue;
Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/single_color_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class SingleColorView extends NT4Widget {
static const String widgetType = 'Single Color View';
@override
String type = 'Single Color View';
String type = widgetType;

SingleColorView({super.key, required super.topic, super.period}) : super();

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/text_display.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class TextDisplay extends NT4Widget {
static const String widgetType = 'Text Display';
@override
String type = 'Text Display';
String type = widgetType;

final TextEditingController _controller = TextEditingController();

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/toggle_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ToggleButton extends NT4Widget {
static const String widgetType = 'Toggle Button';
@override
String type = 'Toggle Button';
String type = widgetType;

ToggleButton({super.key, required super.topic, super.period}) : super();

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/toggle_switch.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ import 'package:flutter/material.dart';
import 'package:provider/provider.dart';

class ToggleSwitch extends NT4Widget {
static const String widgetType = 'Toggle Switch';
@override
String type = 'Toggle Switch';
String type = widgetType;

ToggleSwitch({super.key, required super.topic, super.period}) : super();

Expand Down
3 changes: 2 additions & 1 deletion lib/widgets/nt4_widgets/single_topic/voltage_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_gauges/gauges.dart';

class VoltageView extends NT4Widget {
static const String widgetType = 'Voltage View';
@override
String type = 'Voltage View';
String type = widgetType;

late double minValue;
late double maxValue;
Expand Down

0 comments on commit be1b779

Please sign in to comment.