From f1d29a6626b363331a20e61649425a493d50df1a Mon Sep 17 00:00:00 2001 From: Gold87 <91761103+Gold872@users.noreply.github.com> Date: Sun, 26 May 2024 02:23:27 -0400 Subject: [PATCH] Replaced deprecated APIs (#46) --- lib/main.dart | 2 +- lib/widgets/editable_tab_bar.dart | 10 +++++----- lib/widgets/nt_widgets/multi-topic/camera_stream.dart | 4 ++-- lib/widgets/nt_widgets/multi-topic/pid_controller.dart | 2 +- .../multi-topic/profiled_pid_controller.dart | 2 +- .../nt_widgets/multi-topic/robot_preferences.dart | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index b96ebc68..8e4917c8 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -2,10 +2,10 @@ import 'dart:convert'; import 'dart:io'; import 'dart:math'; -import 'package:flex_seed_scheme/flex_seed_scheme.dart'; import 'package:flutter/material.dart'; import 'package:dot_cast/dot_cast.dart'; +import 'package:flex_seed_scheme/flex_seed_scheme.dart'; import 'package:package_info_plus/package_info_plus.dart'; import 'package:path_provider/path_provider.dart'; import 'package:screen_retriever/screen_retriever.dart'; diff --git a/lib/widgets/editable_tab_bar.dart b/lib/widgets/editable_tab_bar.dart index 3317edc0..c7705a98 100644 --- a/lib/widgets/editable_tab_bar.dart +++ b/lib/widgets/editable_tab_bar.dart @@ -93,11 +93,11 @@ class EditableTabBar extends StatelessWidget { Widget build(BuildContext context) { ThemeData theme = Theme.of(context); ButtonStyle endButtonStyle = const ButtonStyle( - shape: MaterialStatePropertyAll(RoundedRectangleBorder()), - maximumSize: MaterialStatePropertyAll(Size.square(34.0)), - minimumSize: MaterialStatePropertyAll(Size.zero), - padding: MaterialStatePropertyAll(EdgeInsets.all(4.0)), - iconSize: MaterialStatePropertyAll(24.0), + shape: WidgetStatePropertyAll(RoundedRectangleBorder()), + maximumSize: WidgetStatePropertyAll(Size.square(34.0)), + minimumSize: WidgetStatePropertyAll(Size.zero), + padding: WidgetStatePropertyAll(EdgeInsets.all(4.0)), + iconSize: WidgetStatePropertyAll(24.0), ); return Column( diff --git a/lib/widgets/nt_widgets/multi-topic/camera_stream.dart b/lib/widgets/nt_widgets/multi-topic/camera_stream.dart index 9869114c..f3130f60 100644 --- a/lib/widgets/nt_widgets/multi-topic/camera_stream.dart +++ b/lib/widgets/nt_widgets/multi-topic/camera_stream.dart @@ -1,12 +1,12 @@ -import 'package:elastic_dashboard/widgets/dialog_widgets/dialog_text_input.dart'; import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; import 'package:dot_cast/dot_cast.dart'; -import 'package:flutter/services.dart'; import 'package:provider/provider.dart'; import 'package:elastic_dashboard/services/nt_connection.dart'; import 'package:elastic_dashboard/widgets/custom_loading_indicator.dart'; +import 'package:elastic_dashboard/widgets/dialog_widgets/dialog_text_input.dart'; import 'package:elastic_dashboard/widgets/mjpeg.dart'; import 'package:elastic_dashboard/widgets/nt_widgets/nt_widget.dart'; diff --git a/lib/widgets/nt_widgets/multi-topic/pid_controller.dart b/lib/widgets/nt_widgets/multi-topic/pid_controller.dart index d9f08ec6..05981712 100644 --- a/lib/widgets/nt_widgets/multi-topic/pid_controller.dart +++ b/lib/widgets/nt_widgets/multi-topic/pid_controller.dart @@ -321,7 +321,7 @@ class PIDControllerWidget extends NTWidget { model.publishSetpoint(); }, style: ButtonStyle( - shape: MaterialStatePropertyAll( + shape: WidgetStatePropertyAll( RoundedRectangleBorder( borderRadius: BorderRadius.circular(5.0), ), diff --git a/lib/widgets/nt_widgets/multi-topic/profiled_pid_controller.dart b/lib/widgets/nt_widgets/multi-topic/profiled_pid_controller.dart index e2751d6b..25b5c599 100644 --- a/lib/widgets/nt_widgets/multi-topic/profiled_pid_controller.dart +++ b/lib/widgets/nt_widgets/multi-topic/profiled_pid_controller.dart @@ -323,7 +323,7 @@ class ProfiledPIDControllerWidget extends NTWidget { model.publishGoal(); }, style: ButtonStyle( - shape: MaterialStatePropertyAll( + shape: WidgetStatePropertyAll( RoundedRectangleBorder( borderRadius: BorderRadius.circular(5.0), ), diff --git a/lib/widgets/nt_widgets/multi-topic/robot_preferences.dart b/lib/widgets/nt_widgets/multi-topic/robot_preferences.dart index d48ce330..9d188ec5 100644 --- a/lib/widgets/nt_widgets/multi-topic/robot_preferences.dart +++ b/lib/widgets/nt_widgets/multi-topic/robot_preferences.dart @@ -194,7 +194,7 @@ class PreferenceSearch extends StatelessWidget { .toList(); }, initialList: preferenceTopicNames, - builder: (displayedList, itemIndex, item) { + itemBuilder: (item) { TextEditingController? textController = preferenceTextControllers[item]; return _RobotPreference(