diff --git a/lib/constants.dart b/lib/constants.dart index 2134bb380..b6d83c586 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -144,6 +144,22 @@ String maxValue = 'Max: '; String gyroscopeTitle = "Gyroscope"; String gyroscopeAxisLabel = 'rad/s'; String noData = 'No data available'; +String xyPlot = 'XY Plot'; +String enablePlot = 'Enable XY Plot'; +String trigger = 'Trigger'; +String timeBase = 'Timebase'; +String timeBaseAndTrigger = 'Timebase & Trigger'; +String offsets = 'Offsets'; +String dataAnalysis = 'Data Analysis'; +String fourierAnalysis = 'Fourier Analysis'; +String channels = 'Channels'; +String pslabMic = 'PSLab MIC'; +String inBuiltMic = 'In-Built MIC'; +String ch3Range = 'CH3 (+/- 3.3V)'; +String rangeValue = '+/-16V'; +String range = 'Range'; +String ch2 = 'CH2'; +String ch1 = 'CH1'; String luxMeterTitle = 'Lux Meter'; String builtIn = 'Built-In'; String lx = 'Lx'; diff --git a/lib/others/theme.dart b/lib/others/theme.dart index f34bc3574..f232139a8 100644 --- a/lib/others/theme.dart +++ b/lib/others/theme.dart @@ -6,11 +6,34 @@ class AppTheme { useMaterial3: true, scaffoldBackgroundColor: Colors.white, colorSchemeSeed: Colors.white, + checkboxTheme: const CheckboxThemeData( + side: BorderSide(color: Colors.black, width: 2), + ), + radioTheme: RadioThemeData( + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { + return const Color(0xFFCE525F); + } + return Colors.black; + }), + ), ); + static final darkTheme = ThemeData( brightness: Brightness.dark, useMaterial3: true, scaffoldBackgroundColor: Colors.black, colorSchemeSeed: Colors.black, + checkboxTheme: const CheckboxThemeData( + side: BorderSide(color: Colors.black, width: 2), + ), + radioTheme: RadioThemeData( + fillColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.selected)) { + return const Color(0xFFCE525F); + } + return Colors.black; + }), + ), ); } diff --git a/lib/view/widgets/accelerometer_card.dart b/lib/view/widgets/accelerometer_card.dart index ae9c23888..104e7cc58 100644 --- a/lib/view/widgets/accelerometer_card.dart +++ b/lib/view/widgets/accelerometer_card.dart @@ -67,7 +67,7 @@ class _AccelerometerCardState extends State { margin: const EdgeInsets.only(top: 8, bottom: 12), child: Text( "${currVal.toStringAsFixed(1)} $accelerationAxisLabel", - style: const TextStyle(fontSize: 14), + style: const TextStyle(color: Colors.black, fontSize: 14), ), ), Container( @@ -75,7 +75,7 @@ class _AccelerometerCardState extends State { margin: const EdgeInsets.only(left: 8, top: 4), child: Text( "$minValue ${minVal.toStringAsFixed(1)} $accelerationAxisLabel", - style: const TextStyle(fontSize: 10), + style: const TextStyle(color: Colors.black, fontSize: 10), ), ), Container( @@ -83,7 +83,7 @@ class _AccelerometerCardState extends State { margin: const EdgeInsets.only(left: 8, top: 2), child: Text( "$maxValue ${maxVal.toStringAsFixed(1)} $accelerationAxisLabel", - style: const TextStyle(fontSize: 10), + style: const TextStyle(color: Colors.black, fontSize: 10), ), ), ]), diff --git a/lib/view/widgets/channel_parameters_widget.dart b/lib/view/widgets/channel_parameters_widget.dart index 780d9e152..85c4e7e4e 100644 --- a/lib/view/widgets/channel_parameters_widget.dart +++ b/lib/view/widgets/channel_parameters_widget.dart @@ -45,19 +45,20 @@ class _ChannelParametersState extends State { ); }, ), - const Text( - 'CH1', - style: TextStyle( + Text( + ch1, + style: const TextStyle( + color: Colors.black, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, fontSize: 15, ), ), - const Padding( - padding: EdgeInsets.only(left: 8), + Padding( + padding: const EdgeInsets.only(left: 8), child: Text( - 'Range', - style: TextStyle( + range, + style: const TextStyle( color: Color(0xFF424242), fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -82,7 +83,8 @@ class _ChannelParametersState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle(fontSize: 15), + textStyle: + const TextStyle(color: Colors.black, fontSize: 15), onSelected: (String? value) { switch (yAxisRanges.indexOf(value!)) { case 0: @@ -143,19 +145,20 @@ class _ChannelParametersState extends State { ); }, ), - const Text( - 'CH2', - style: TextStyle( + Text( + ch2, + style: const TextStyle( + color: Colors.black, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, fontSize: 15, ), ), - const Padding( - padding: EdgeInsets.only(left: 8), + Padding( + padding: const EdgeInsets.only(left: 8), child: Text( - 'Range', - style: TextStyle( + range, + style: const TextStyle( color: Color(0xFF424242), fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -163,13 +166,14 @@ class _ChannelParametersState extends State { ), ), ), - const Padding( - padding: EdgeInsets.only(left: 8), + Padding( + padding: const EdgeInsets.only(left: 8), child: SizedBox( width: 120, child: Text( - '+/-16V', - style: TextStyle( + rangeValue, + style: const TextStyle( + color: Colors.black, fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, fontSize: 15, @@ -199,9 +203,10 @@ class _ChannelParametersState extends State { ); }, ), - const Text( - 'CH3 (+/- 3.3V)', - style: TextStyle( + Text( + ch3Range, + style: const TextStyle( + color: Colors.black, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, fontSize: 15, @@ -251,9 +256,10 @@ class _ChannelParametersState extends State { ); }, ), - const Text( - 'In-Built MIC', - style: TextStyle( + Text( + inBuiltMic, + style: const TextStyle( + color: Colors.black, fontSize: 15, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, @@ -283,9 +289,10 @@ class _ChannelParametersState extends State { ); }, ), - const Text( - 'PSLab MIC', - style: TextStyle( + Text( + pslabMic, + style: const TextStyle( + color: Colors.black, fontSize: 15, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, @@ -306,9 +313,9 @@ class _ChannelParametersState extends State { child: Container( padding: const EdgeInsets.symmetric(horizontal: 2), decoration: const BoxDecoration(color: Colors.white), - child: const Text( - 'Channels', - style: TextStyle( + child: Text( + channels, + style: const TextStyle( color: Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, diff --git a/lib/view/widgets/data_analysis_widget.dart b/lib/view/widgets/data_analysis_widget.dart index d2edca9c7..bd4dfda48 100644 --- a/lib/view/widgets/data_analysis_widget.dart +++ b/lib/view/widgets/data_analysis_widget.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:pslab/providers/oscilloscope_state_provider.dart'; +import 'package:pslab/constants.dart'; class DataAnalysisWidget extends StatefulWidget { const DataAnalysisWidget({super.key}); @@ -50,9 +51,10 @@ class _DataAnalysisState extends State { ); }, ), - const Text( - 'Fourier Analysis', - style: TextStyle( + Text( + fourierAnalysis, + style: const TextStyle( + color: Colors.black, fontSize: 15, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -88,6 +90,7 @@ class _DataAnalysisState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (String? value) { @@ -128,6 +131,7 @@ class _DataAnalysisState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (value) { @@ -165,6 +169,7 @@ class _DataAnalysisState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (value) { @@ -189,9 +194,9 @@ class _DataAnalysisState extends State { child: Container( padding: const EdgeInsets.symmetric(horizontal: 2), decoration: const BoxDecoration(color: Colors.white), - child: const Text( - 'Data Analysis', - style: TextStyle( + child: Text( + dataAnalysis, + style: const TextStyle( color: Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, @@ -241,6 +246,7 @@ class _DataAnalysisState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (value) => { @@ -262,9 +268,10 @@ class _DataAnalysisState extends State { children: [ Expanded( child: SliderTheme( - data: const SliderThemeData( + data: SliderThemeData( + inactiveTrackColor: Colors.blueGrey[100], trackHeight: 1, - thumbShape: RoundSliderThumbShape( + thumbShape: const RoundSliderThumbShape( enabledThumbRadius: 6), ), child: Slider( @@ -304,6 +311,7 @@ class _DataAnalysisState extends State { border: InputBorder.none, ), style: const TextStyle( + color: Colors.black, fontSize: 14, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -343,9 +351,10 @@ class _DataAnalysisState extends State { children: [ Expanded( child: SliderTheme( - data: const SliderThemeData( + data: SliderThemeData( + inactiveTrackColor: Colors.blueGrey[100], trackHeight: 1, - thumbShape: RoundSliderThumbShape( + thumbShape: const RoundSliderThumbShape( enabledThumbRadius: 6), ), child: Slider( @@ -403,6 +412,7 @@ class _DataAnalysisState extends State { : '${oscilloscopeStateProvider.xOffsets[oscilloscopeStateProvider.selectedChannelOffset]!.toStringAsFixed(2)} ms', ), style: const TextStyle( + color: Colors.black, fontSize: 14, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -456,9 +466,9 @@ class _DataAnalysisState extends State { child: Container( padding: const EdgeInsets.symmetric(horizontal: 2), decoration: const BoxDecoration(color: Colors.white), - child: const Text( - 'Offsets', - style: TextStyle( + child: Text( + offsets, + style: const TextStyle( color: Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, diff --git a/lib/view/widgets/gyroscope_card.dart b/lib/view/widgets/gyroscope_card.dart index e38f89da7..30bb69be3 100644 --- a/lib/view/widgets/gyroscope_card.dart +++ b/lib/view/widgets/gyroscope_card.dart @@ -101,7 +101,7 @@ class _GyroscopeCardState extends State { margin: const EdgeInsets.only(top: 8, bottom: 12), child: Text( "${currVal.toStringAsFixed(1)} $gyroscopeAxisLabel", - style: const TextStyle(fontSize: 14), + style: const TextStyle(color: Colors.black, fontSize: 14), ), ), Container( @@ -109,7 +109,7 @@ class _GyroscopeCardState extends State { margin: const EdgeInsets.only(left: 8, top: 4), child: Text( "$minValue ${minVal.toStringAsFixed(1)} $gyroscopeAxisLabel", - style: const TextStyle(fontSize: 10), + style: const TextStyle(color: Colors.black, fontSize: 10), ), ), Container( @@ -117,7 +117,7 @@ class _GyroscopeCardState extends State { margin: const EdgeInsets.only(left: 8, top: 2), child: Text( "$maxValue ${maxVal.toStringAsFixed(1)} $gyroscopeAxisLabel", - style: const TextStyle(fontSize: 10), + style: const TextStyle(color: Colors.black, fontSize: 10), ), ), ]), diff --git a/lib/view/widgets/timebase_trigger_widget.dart b/lib/view/widgets/timebase_trigger_widget.dart index ed8b95756..8c94f202a 100644 --- a/lib/view/widgets/timebase_trigger_widget.dart +++ b/lib/view/widgets/timebase_trigger_widget.dart @@ -44,9 +44,10 @@ class _TimebaseTriggerState extends State { ); }, ), - const Text( - 'Trigger', - style: TextStyle( + Text( + trigger, + style: const TextStyle( + color: Colors.black, fontSize: 15, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, @@ -70,6 +71,7 @@ class _TimebaseTriggerState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (String? value) { @@ -79,10 +81,11 @@ class _TimebaseTriggerState extends State { ), Expanded( child: SliderTheme( - data: const SliderThemeData( + data: SliderThemeData( + inactiveTrackColor: Colors.blueGrey[100], trackHeight: 1, - thumbShape: - RoundSliderThumbShape(enabledThumbRadius: 6), + thumbShape: const RoundSliderThumbShape( + enabledThumbRadius: 6), ), child: Selector( selector: (context, provider) => @@ -117,6 +120,7 @@ class _TimebaseTriggerState extends State { border: InputBorder.none, ), style: const TextStyle( + color: Colors.black, fontSize: 14, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -171,6 +175,7 @@ class _TimebaseTriggerState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 14, ), onSelected: (String? value) { @@ -202,9 +207,10 @@ class _TimebaseTriggerState extends State { mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - const Text( - 'Timebase', - style: TextStyle( + Text( + timeBase, + style: const TextStyle( + color: Colors.black, fontSize: 15, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, @@ -212,10 +218,11 @@ class _TimebaseTriggerState extends State { ), Expanded( child: SliderTheme( - data: const SliderThemeData( + data: SliderThemeData( + inactiveTrackColor: Colors.blueGrey[100], trackHeight: 1, - thumbShape: - RoundSliderThumbShape(enabledThumbRadius: 6), + thumbShape: const RoundSliderThumbShape( + enabledThumbRadius: 6), ), child: Slider( activeColor: const Color(0xFFCE525F), @@ -303,6 +310,7 @@ class _TimebaseTriggerState extends State { ? '${oscilloscopeStateProvider.timebase.toStringAsFixed(2)} \u00b5s' : '${(oscilloscopeStateProvider.timebase / 1000).toStringAsFixed(2)} ms', style: const TextStyle( + color: Colors.black, fontSize: 14, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -324,9 +332,9 @@ class _TimebaseTriggerState extends State { child: Container( padding: const EdgeInsets.symmetric(horizontal: 2), decoration: const BoxDecoration(color: Colors.white), - child: const Text( - 'Timebase & Trigger', - style: TextStyle( + child: Text( + timeBaseAndTrigger, + style: const TextStyle( color: Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, diff --git a/lib/view/widgets/xyplot_widget.dart b/lib/view/widgets/xyplot_widget.dart index 33da189ed..d1ee814d1 100644 --- a/lib/view/widgets/xyplot_widget.dart +++ b/lib/view/widgets/xyplot_widget.dart @@ -44,9 +44,10 @@ class _XYPlotState extends State { ); }, ), - const Text( - 'Enable XY Plot', - style: TextStyle( + Text( + enablePlot, + style: const TextStyle( + color: Colors.black, fontSize: 15, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, @@ -77,6 +78,7 @@ class _XYPlotState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (String? value) { @@ -98,6 +100,7 @@ class _XYPlotState extends State { border: InputBorder.none, ), textStyle: const TextStyle( + color: Colors.black, fontSize: 15, ), onSelected: (String? value) { @@ -119,9 +122,9 @@ class _XYPlotState extends State { child: Container( padding: const EdgeInsets.symmetric(horizontal: 2), decoration: const BoxDecoration(color: Colors.white), - child: const Text( - 'XY Plot', - style: TextStyle( + child: Text( + xyPlot, + style: const TextStyle( color: Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold,