diff --git a/lib/view/widgets/channel_parameters_widget.dart b/lib/view/widgets/channel_parameters_widget.dart index a37892acd..1f3517075 100644 --- a/lib/view/widgets/channel_parameters_widget.dart +++ b/lib/view/widgets/channel_parameters_widget.dart @@ -17,297 +17,322 @@ class _ChannelParametersState extends State { @override Widget build(BuildContext context) { - return Container( - margin: const EdgeInsets.only(top: 5, bottom: 5), - decoration: BoxDecoration( - border: Border.all(width: 1, color: const Color(0xFFD32F2F)), - borderRadius: BorderRadius.circular(10), - ), - child: Stack( - children: [ - Positioned( - top: 0.h, - left: 2.w, - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Checkbox( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - value: isCH1Selected, - activeColor: const Color(0xFFCE525F), - onChanged: (bool? value) { - setState( - () { - isCH1Selected = value; + return Stack( + children: [ + Container( + margin: const EdgeInsets.only(top: 8, bottom: 5), + decoration: BoxDecoration( + border: Border.all(width: 1, color: const Color(0xFFD32F2F)), + borderRadius: BorderRadius.circular(10), + ), + child: Stack( + children: [ + Positioned( + top: 0.h, + left: 2.w, + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Checkbox( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + value: isCH1Selected, + activeColor: const Color(0xFFCE525F), + onChanged: (bool? value) { + setState( + () { + isCH1Selected = value; + }, + ); }, - ); - }, - ), - Padding( - padding: EdgeInsets.only(top: 2.h), - child: const Text( - 'CH1', - style: TextStyle( - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, - fontSize: 15, ), - ), - ), - Padding( - padding: EdgeInsets.only(top: 1.h, left: 3.w), - child: const Text( - 'Range', - style: TextStyle( - color: Color(0xFF424242), - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - fontSize: 14, + Padding( + padding: EdgeInsets.only(top: 2.h), + child: const Text( + 'CH1', + style: TextStyle( + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + fontSize: 15, + ), + ), ), - ), - ), - Padding( - padding: EdgeInsets.only(top: 1.h, left: 4.w), - child: DropdownMenu( - initialSelection: '+/-16V', - width: 60.w, - dropdownMenuEntries: [ - '+/-16V', - '+/-8V', - '+/-4V', - '+/-3V', - '+/-2V', - '+/-1.5V', - '+/-1V', - '+/-500mV', - '+/-160V', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, + Padding( + padding: EdgeInsets.only(top: 1.h, left: 3.w), + child: const Text( + 'Range', + style: TextStyle( + color: Color(0xFF424242), + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + fontSize: 14, + ), + ), ), - textStyle: const TextStyle( - fontSize: 14, + Padding( + padding: EdgeInsets.only(top: 1.h, left: 4.w), + child: DropdownMenu( + initialSelection: '+/-16V', + width: 60.w, + dropdownMenuEntries: [ + '+/-16V', + '+/-8V', + '+/-4V', + '+/-3V', + '+/-2V', + '+/-1.5V', + '+/-1V', + '+/-500mV', + '+/-160V', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), ), - ), + Padding( + padding: EdgeInsets.only(top: 0.h), + child: DropdownMenu( + width: 50.w, + initialSelection: 'CH1', + dropdownMenuEntries: [ + 'CH1', + 'CH2', + 'CH3', + 'MIC', + 'RES', + 'VOL', + 'CAP', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 15, + ), + ), + ), + ], ), - Padding( - padding: EdgeInsets.only(top: 0.h), - child: DropdownMenu( - width: 50.w, - initialSelection: 'CH1', - dropdownMenuEntries: [ - 'CH1', - 'CH2', - 'CH3', - 'MIC', - 'RES', - 'VOL', - 'CAP', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, + ), + Positioned( + left: 2.w, + bottom: 8.h, + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Checkbox( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + value: isCH2Selected, + activeColor: const Color(0xFFCE525F), + onChanged: (bool? value) { + setState( + () { + isCH2Selected = value; + }, ); }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, - ), - textStyle: const TextStyle( - fontSize: 15, ), - ), - ), - ], - ), - ), - Positioned( - left: 2.w, - bottom: 8.h, - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Checkbox( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - value: isCH2Selected, - activeColor: const Color(0xFFCE525F), - onChanged: (bool? value) { - setState( - () { - isCH2Selected = value; - }, - ); - }, - ), - Padding( - padding: EdgeInsets.only(top: 2.h), - child: const Text( - 'CH2', - style: TextStyle( - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, - fontSize: 15, + Padding( + padding: EdgeInsets.only(top: 2.h), + child: const Text( + 'CH2', + style: TextStyle( + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + fontSize: 15, + ), + ), ), - ), - ), - Padding( - padding: EdgeInsets.only(top: 1.h, left: 3.w), - child: const Text( - 'Range', - style: TextStyle( - color: Color(0xFF424242), - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - fontSize: 14, + Padding( + padding: EdgeInsets.only(top: 1.h, left: 3.w), + child: const Text( + 'Range', + style: TextStyle( + color: Color(0xFF424242), + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + fontSize: 14, + ), + ), ), - ), - ), - Padding( - padding: EdgeInsets.only(top: 2.h, left: 4.w), - child: SizedBox( - width: 60.w, - child: const Text( - '+/-16V', - style: TextStyle( - fontStyle: FontStyle.normal, - fontWeight: FontWeight.normal, - fontSize: 14, + Padding( + padding: EdgeInsets.only(top: 2.h, left: 4.w), + child: SizedBox( + width: 60.w, + child: const Text( + '+/-16V', + style: TextStyle( + fontStyle: FontStyle.normal, + fontWeight: FontWeight.normal, + fontSize: 14, + ), + ), ), ), - ), - ), - Padding( - padding: EdgeInsets.only(top: 2.h), - child: SizedBox( - width: 45.w, - child: const Text( - 'CH2', - style: TextStyle( - fontStyle: FontStyle.normal, - fontWeight: FontWeight.normal, - fontSize: 15, + Padding( + padding: EdgeInsets.only(top: 2.h), + child: SizedBox( + width: 45.w, + child: const Text( + 'CH2', + style: TextStyle( + fontStyle: FontStyle.normal, + fontWeight: FontWeight.normal, + fontSize: 15, + ), + ), ), ), - ), + ], ), - ], - ), - ), - Positioned( - top: 16.h, - right: 4.w, - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Checkbox( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - value: isCH3Selected, - activeColor: const Color(0xFFCE525F), - onChanged: (bool? value) { - setState( - () { - isCH3Selected = value; + ), + Positioned( + top: 16.h, + right: 4.w, + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Checkbox( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + value: isCH3Selected, + activeColor: const Color(0xFFCE525F), + onChanged: (bool? value) { + setState( + () { + isCH3Selected = value; + }, + ); }, - ); - }, - ), - Padding( - padding: EdgeInsets.only(top: 2.h), - child: const Text( - 'CH3 (+/- 3.3V)', - style: TextStyle( - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, - fontSize: 15, ), - ), + Padding( + padding: EdgeInsets.only(top: 2.h), + child: const Text( + 'CH3 (+/- 3.3V)', + style: TextStyle( + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + fontSize: 15, + ), + ), + ), + ], ), - ], - ), - ), - Positioned( - bottom: 8.h, - right: 4.w, - child: Row( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Radio( - activeColor: const Color(0xFFCE525F), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - value: true, - groupValue: isInBuiltMICSelected, - toggleable: true, - onChanged: (bool? value) { - setState( - () { - if (value == null) { - isInBuiltMICSelected = false; - } else { - isInBuiltMICSelected = value; - isMICSelected = !value; - } + ), + Positioned( + bottom: 8.h, + right: 4.w, + child: Row( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Radio( + activeColor: const Color(0xFFCE525F), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + value: true, + groupValue: isInBuiltMICSelected, + toggleable: true, + onChanged: (bool? value) { + setState( + () { + if (value == null) { + isInBuiltMICSelected = false; + } else { + isInBuiltMICSelected = value; + isMICSelected = !value; + } + }, + ); }, - ); - }, - ), - Padding( - padding: EdgeInsets.only(top: 2.h), - child: const Text( - 'In-Built MIC', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, ), - ), - ), - Radio( - activeColor: const Color(0xFFCE525F), - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - value: true, - groupValue: isMICSelected, - toggleable: true, - onChanged: (bool? value) { - setState( - () { - if (value == null) { - isMICSelected = false; - } else { - isMICSelected = value; - isInBuiltMICSelected = !value; - } + Padding( + padding: EdgeInsets.only(top: 2.h), + child: const Text( + 'In-Built MIC', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + ), + ), + ), + Radio( + activeColor: const Color(0xFFCE525F), + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + value: true, + groupValue: isMICSelected, + toggleable: true, + onChanged: (bool? value) { + setState( + () { + if (value == null) { + isMICSelected = false; + } else { + isMICSelected = value; + isInBuiltMICSelected = !value; + } + }, + ); }, - ); - }, - ), - Padding( - padding: EdgeInsets.only(top: 2.h), - child: const Text( - 'PSLab MIC', - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, ), - ), + Padding( + padding: EdgeInsets.only(top: 2.h), + child: const Text( + 'PSLab MIC', + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + ), + ), + ), + ], + ), + ), + ], + ), + ), + Positioned( + left: 0.w, + right: 0.w, + top: 2.h, + child: Align( + alignment: Alignment.center, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 2.w), + decoration: const BoxDecoration(color: Colors.white), + child: const Text( + 'Channel Parameters', + style: TextStyle( + color: Color(0xFFC72C2C), + fontStyle: FontStyle.normal, + fontWeight: FontWeight.bold, + fontSize: 13, ), - ], + ), ), ), - ], - ), + ) + ], ); } } diff --git a/lib/view/widgets/data_analysis_widget.dart b/lib/view/widgets/data_analysis_widget.dart index 23dd06d33..4231bcf3d 100644 --- a/lib/view/widgets/data_analysis_widget.dart +++ b/lib/view/widgets/data_analysis_widget.dart @@ -19,107 +19,180 @@ class _DataAnalysisState extends State { mainAxisSize: MainAxisSize.max, children: [ Expanded( - child: Container( - margin: const EdgeInsets.only(top: 5, bottom: 5, right: 2.5), - decoration: BoxDecoration( - border: Border.all(width: 1, color: const Color(0xFFD32F2F)), - borderRadius: BorderRadius.circular(10), - ), - child: Stack( - children: [ - Positioned( - top: 0.h, - left: 2.w, - right: 0.h, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: Checkbox( - materialTapTargetSize: - MaterialTapTargetSize.shrinkWrap, - activeColor: const Color(0xFFCE525F), - value: isFourierTransformSelected, - onChanged: (bool? value) { - setState( - () { - isFourierTransformSelected = value; + child: Stack( + children: [ + Container( + margin: const EdgeInsets.only(top: 8, bottom: 5, right: 2.5), + decoration: BoxDecoration( + border: Border.all(width: 1, color: const Color(0xFFD32F2F)), + borderRadius: BorderRadius.circular(10), + ), + child: Stack( + children: [ + Positioned( + top: 0.h, + left: 2.w, + right: 0.h, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 2.h), + child: Checkbox( + materialTapTargetSize: + MaterialTapTargetSize.shrinkWrap, + activeColor: const Color(0xFFCE525F), + value: isFourierTransformSelected, + onChanged: (bool? value) { + setState( + () { + isFourierTransformSelected = value; + }, + ); }, - ); - }, - ), + ), + ), + Padding( + padding: EdgeInsets.only(bottom: 2.h), + child: const Text( + 'Fourier Analysis', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + ), + ), + const Spacer(), + DropdownMenu( + width: 50.w, + initialSelection: 'CH1', + dropdownMenuEntries: [ + 'CH1', + 'CH2', + 'CH3', + 'MIC', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), + ], ), - Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: const Text( - 'Fourier Transforms', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, + ), + Positioned( + bottom: 0.h, + left: 6.w, + right: 0.h, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + DropdownMenu( + width: 80.w, + initialSelection: 'Sine Fit', + dropdownMenuEntries: [ + 'Sine Fit', + 'Square Fit', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), ), - ), + const Spacer(), + Padding( + padding: EdgeInsets.only(left: 4.w), + child: DropdownMenu( + width: 50.w, + initialSelection: 'CH1', + dropdownMenuEntries: [ + 'CH1', + 'CH2', + 'CH3', + 'MIC', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), + ), + ], ), - const Spacer(), - DropdownMenu( - width: 45.w, - initialSelection: 'CH1', - dropdownMenuEntries: [ - 'CH1', - 'CH2', - 'CH3', - 'MIC', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, - ), - textStyle: const TextStyle( - fontSize: 14, - ), + ), + ], + ), + ), + Positioned( + left: 0.w, + right: 0.w, + top: 2.h, + child: Align( + alignment: Alignment.center, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 2.w), + decoration: const BoxDecoration(color: Colors.white), + child: const Text( + 'Data Analysis', + style: TextStyle( + color: Color(0xFFC72C2C), + fontStyle: FontStyle.normal, + fontWeight: FontWeight.bold, + fontSize: 13, ), - ], + ), ), ), - Positioned( - bottom: 0.h, - left: 6.w, - right: 0.h, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - DropdownMenu( - initialSelection: 'Sine Fit', - dropdownMenuEntries: [ - 'Sine Fit', - 'Square Fit', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, - ), - textStyle: const TextStyle( - fontSize: 14, - ), - ), - const Spacer(), - Padding( - padding: EdgeInsets.only(left: 4.w), + ) + ], + ), + ), + Expanded( + child: Stack( + children: [ + Container( + margin: const EdgeInsets.only(top: 8, bottom: 5, left: 2.5), + decoration: BoxDecoration( + border: Border.all(width: 1, color: const Color(0xFFD32F2F)), + borderRadius: BorderRadius.circular(10), + ), + child: Stack( + children: [ + Positioned( + bottom: 0.h, + top: 0.h, + left: 6.w, + child: Center( child: DropdownMenu( - width: 45.w, + width: 50.w, initialSelection: 'CH1', dropdownMenuEntries: [ 'CH1', @@ -142,132 +215,110 @@ class _DataAnalysisState extends State { ), ), ), - ], - ), - ), - ], - ), - ), - ), - Expanded( - child: Container( - margin: const EdgeInsets.only(top: 5, bottom: 5, left: 2.5), - decoration: BoxDecoration( - border: Border.all(width: 1, color: const Color(0xFFD32F2F)), - borderRadius: BorderRadius.circular(10), - ), - child: Stack( - children: [ - Positioned( - bottom: 0.h, - top: 0.h, - left: 6.w, - child: Center( - child: DropdownMenu( - width: 50.w, - initialSelection: 'CH1', - dropdownMenuEntries: [ - 'CH1', - 'CH2', - 'CH3', - 'MIC', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, - ), - textStyle: const TextStyle( - fontSize: 14, - ), ), - ), - ), - Positioned( - top: 4.h, - right: 4.w, - left: 45.w, - child: Row( - children: [ - Expanded( - child: SliderTheme( - data: const SliderThemeData( - trackHeight: 1, - thumbShape: - RoundSliderThumbShape(enabledThumbRadius: 6), - ), - child: Slider( - activeColor: const Color(0xFFCE525F), - min: -16, - max: 16, - value: verticalOffset, - onChanged: (double value) { - setState( - () { - verticalOffset = value; + Positioned( + top: 4.h, + right: 4.w, + left: 45.w, + child: Row( + children: [ + Expanded( + child: SliderTheme( + data: const SliderThemeData( + trackHeight: 1, + thumbShape: RoundSliderThumbShape( + enabledThumbRadius: 6), + ), + child: Slider( + activeColor: const Color(0xFFCE525F), + min: -16, + max: 16, + value: verticalOffset, + onChanged: (double value) { + setState( + () { + verticalOffset = value; + }, + ); }, - ); - }, + ), + ), ), - ), - ), - Text( - '${verticalOffset.toStringAsFixed(2)} V', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), - ), - ], - ), - ), - Positioned( - bottom: 0.h, - right: 4.w, - left: 45.w, - child: Row( - children: [ - Expanded( - child: SliderTheme( - data: const SliderThemeData( - trackHeight: 1, - thumbShape: - RoundSliderThumbShape(enabledThumbRadius: 6), + Text( + '${verticalOffset.toStringAsFixed(2)} V', + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), ), - child: Slider( - activeColor: const Color(0xFFCE525F), - min: 0, - max: 1, - value: horizontalOffset, - onChanged: (double value) { - setState( - () { - horizontalOffset = value; + ], + ), + ), + Positioned( + bottom: 0.h, + right: 4.w, + left: 45.w, + child: Row( + children: [ + Expanded( + child: SliderTheme( + data: const SliderThemeData( + trackHeight: 1, + thumbShape: RoundSliderThumbShape( + enabledThumbRadius: 6), + ), + child: Slider( + activeColor: const Color(0xFFCE525F), + min: 0, + max: 1, + value: horizontalOffset, + onChanged: (double value) { + setState( + () { + horizontalOffset = value; + }, + ); }, - ); - }, + ), + ), ), - ), + Text( + '${horizontalOffset.toStringAsFixed(2)} ms', + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + ), + ], ), - Text( - '${horizontalOffset.toStringAsFixed(2)} ms', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), + ) + ], + ), + ), + Positioned( + left: 0.w, + right: 0.w, + top: 2.h, + child: Align( + alignment: Alignment.center, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 2.w), + decoration: const BoxDecoration(color: Colors.white), + child: const Text( + 'Offsets', + style: TextStyle( + color: Color(0xFFC72C2C), + fontStyle: FontStyle.normal, + fontWeight: FontWeight.bold, + fontSize: 13, ), - ], + ), ), - ) - ], - ), + ), + ) + ], ), ) ], diff --git a/lib/view/widgets/timebase_trigger_widget.dart b/lib/view/widgets/timebase_trigger_widget.dart index 7179b762f..7f65ae91d 100644 --- a/lib/view/widgets/timebase_trigger_widget.dart +++ b/lib/view/widgets/timebase_trigger_widget.dart @@ -15,180 +15,207 @@ class _TimebaseTriggerState extends State { @override Widget build(BuildContext context) { - return Container( - margin: const EdgeInsets.only(top: 5, bottom: 5), - decoration: BoxDecoration( - border: Border.all(width: 1, color: const Color(0xFFD32F2F)), - borderRadius: BorderRadius.circular(10), - ), - child: Stack( - children: [ - Positioned( - top: 0.h, - left: 2.w, - right: 0.w, - child: Row( - children: [ - Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: Checkbox( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - activeColor: const Color(0xFFCE525F), - value: isTriggerChecked, - onChanged: (bool? value) { - setState( - () { - isTriggerChecked = value; + return Stack( + children: [ + Container( + margin: const EdgeInsets.only(top: 8, bottom: 5), + decoration: BoxDecoration( + border: Border.all(width: 1, color: const Color(0xFFD32F2F)), + borderRadius: BorderRadius.circular(10), + ), + child: Stack( + children: [ + Positioned( + top: 0.h, + left: 2.w, + right: 0.w, + child: Row( + children: [ + Padding( + padding: EdgeInsets.only(bottom: 2.h), + child: Checkbox( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + activeColor: const Color(0xFFCE525F), + value: isTriggerChecked, + onChanged: (bool? value) { + setState( + () { + isTriggerChecked = value; + }, + ); }, - ); - }, - ), - ), - Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: const Text( - 'Trigger', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, - ), - ), - ), - Padding( - padding: EdgeInsets.only(left: 4.w), - child: DropdownMenu( - width: 50.w, - initialSelection: 'CH1', - dropdownMenuEntries: [ - 'CH1', - 'CH2', - 'CH3', - 'MIC', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, + ), ), - textStyle: const TextStyle( - fontSize: 14, + Padding( + padding: EdgeInsets.only(bottom: 2.h), + child: const Text( + 'Trigger', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + ), + ), ), - ), - ), - Expanded( - child: SliderTheme( - data: const SliderThemeData( - trackHeight: 1, - thumbShape: RoundSliderThumbShape(enabledThumbRadius: 6), + Padding( + padding: EdgeInsets.only(left: 8.w), + child: DropdownMenu( + width: 50.w, + initialSelection: 'CH1', + dropdownMenuEntries: [ + 'CH1', + 'CH2', + 'CH3', + 'MIC', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), ), - child: Slider( - activeColor: const Color(0xFFCE525F), - min: -16, - max: 16, - value: triggerValue, - onChanged: (double value) { - setState( - () { - triggerValue = value; + Expanded( + child: SliderTheme( + data: const SliderThemeData( + trackHeight: 1, + thumbShape: + RoundSliderThumbShape(enabledThumbRadius: 6), + ), + child: Slider( + activeColor: const Color(0xFFCE525F), + min: -16, + max: 16, + value: triggerValue, + onChanged: (double value) { + setState( + () { + triggerValue = value; + }, + ); }, - ); - }, + ), + ), ), - ), - ), - Text( - '${triggerValue.toStringAsFixed(1)} V', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), - ), - Padding( - padding: EdgeInsets.only(left: 8.w), - child: DropdownMenu( - width: 70.w, - initialSelection: 'Rising Edge', - dropdownMenuEntries: [ - 'Rising Edge', - 'Falling Edge', - 'Dual Edge', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, + Text( + '${triggerValue.toStringAsFixed(1)} V', + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), ), - textStyle: const TextStyle( - fontSize: 14, + Padding( + padding: EdgeInsets.only(left: 8.w), + child: DropdownMenu( + width: 70.w, + initialSelection: 'Rising Edge', + dropdownMenuEntries: [ + 'Rising Edge', + 'Falling Edge', + 'Dual Edge', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), ), - ), + ], ), - ], - ), - ), - Positioned( - bottom: 0.h, - left: 8.w, - right: 8.w, - child: Row( - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - const Text( - 'Timebase', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, - ), - ), - Expanded( - child: SliderTheme( - data: const SliderThemeData( - trackHeight: 1, - thumbShape: RoundSliderThumbShape(enabledThumbRadius: 6), + ), + Positioned( + bottom: 0.h, + left: 8.w, + right: 8.w, + child: Row( + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + const Text( + 'Timebase', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + ), ), - child: Slider( - activeColor: const Color(0xFFCE525F), - min: 0, - max: 8, - divisions: 8, - value: _timebaseSlider, - onChanged: (double value) { - setState( - () { - _timebaseSlider = value; + Expanded( + child: SliderTheme( + data: const SliderThemeData( + trackHeight: 1, + thumbShape: + RoundSliderThumbShape(enabledThumbRadius: 6), + ), + child: Slider( + activeColor: const Color(0xFFCE525F), + min: 0, + max: 8, + divisions: 8, + value: _timebaseSlider, + onChanged: (double value) { + setState( + () { + _timebaseSlider = value; + }, + ); }, - ); - }, + ), + ), + ), + Text( + '${_timebaseSlider.toStringAsFixed(2)} ms', + style: const TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), ), - ), + ], ), - Text( - '${_timebaseSlider.toStringAsFixed(2)} ms', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, - ), + ), + ], + ), + ), + Positioned( + left: 0.w, + right: 0.w, + top: 2.h, + child: Align( + alignment: Alignment.center, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 2.w), + decoration: const BoxDecoration(color: Colors.white), + child: const Text( + 'Timebase & Trigger', + style: TextStyle( + color: Color(0xFFC72C2C), + fontStyle: FontStyle.normal, + fontWeight: FontWeight.bold, + fontSize: 13, ), - ], + ), ), ), - ], - ), + ) + ], ); } } diff --git a/lib/view/widgets/xyplot_widget.dart b/lib/view/widgets/xyplot_widget.dart index d1b4e7d86..d5d9082e6 100644 --- a/lib/view/widgets/xyplot_widget.dart +++ b/lib/view/widgets/xyplot_widget.dart @@ -13,99 +13,124 @@ class _XYPlotState extends State { @override Widget build(BuildContext context) { - return Container( - margin: const EdgeInsets.only(top: 5, bottom: 5), - decoration: BoxDecoration( - border: Border.all(width: 1, color: const Color(0xFFD32F2F)), - borderRadius: BorderRadius.circular(10), - ), - child: Stack( - children: [ - Positioned( - top: 0.h, - left: 2.w, - right: 0.w, - child: Row( - mainAxisSize: MainAxisSize.max, - children: [ - Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: Checkbox( - materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - activeColor: const Color(0xFFCE525F), - value: isXYPlotSelected, - onChanged: (bool? value) { - setState( - () { - isXYPlotSelected = value; + return Stack( + children: [ + Container( + margin: const EdgeInsets.only(top: 8, bottom: 5), + decoration: BoxDecoration( + border: Border.all(width: 1, color: const Color(0xFFD32F2F)), + borderRadius: BorderRadius.circular(10), + ), + child: Stack( + children: [ + Positioned( + top: 0.h, + left: 2.w, + right: 0.w, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ + Padding( + padding: EdgeInsets.only(bottom: 2.h), + child: Checkbox( + materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, + activeColor: const Color(0xFFCE525F), + value: isXYPlotSelected, + onChanged: (bool? value) { + setState( + () { + isXYPlotSelected = value; + }, + ); }, - ); - }, - ), - ), - Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: const Text( - 'Enable XY Plot', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, + ), ), - ), - ), - const Spacer(), - DropdownMenu( - width: 50.w, - initialSelection: 'CH1', - dropdownMenuEntries: [ - 'CH1', - 'CH2', - 'CH3', - 'MIC', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, - ), - textStyle: const TextStyle( - fontSize: 14, - ), + Padding( + padding: EdgeInsets.only(bottom: 2.h), + child: const Text( + 'Enable XY Plot', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), + ), + ), + const Spacer(), + DropdownMenu( + width: 50.w, + initialSelection: 'CH1', + dropdownMenuEntries: [ + 'CH1', + 'CH2', + 'CH3', + 'MIC', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), + DropdownMenu( + width: 50.w, + initialSelection: 'CH2', + dropdownMenuEntries: [ + 'CH1', + 'CH2', + 'CH3', + 'MIC', + ].map( + (String value) { + return DropdownMenuEntry( + label: value, + value: value, + ); + }, + ).toList(), + inputDecorationTheme: const InputDecorationTheme( + border: InputBorder.none, + ), + textStyle: const TextStyle( + fontSize: 14, + ), + ), + ], ), - DropdownMenu( - width: 50.w, - initialSelection: 'CH2', - dropdownMenuEntries: [ - 'CH1', - 'CH2', - 'CH3', - 'MIC', - ].map( - (String value) { - return DropdownMenuEntry( - label: value, - value: value, - ); - }, - ).toList(), - inputDecorationTheme: const InputDecorationTheme( - border: InputBorder.none, - ), - textStyle: const TextStyle( - fontSize: 14, - ), + ), + ], + ), + ), + Positioned( + left: 0.w, + right: 0.w, + top: 2.h, + child: Align( + alignment: Alignment.center, + child: Container( + padding: EdgeInsets.symmetric(horizontal: 2.w), + decoration: const BoxDecoration(color: Colors.white), + child: const Text( + 'XY Plot', + style: TextStyle( + color: Color(0xFFC72C2C), + fontStyle: FontStyle.normal, + fontWeight: FontWeight.bold, + fontSize: 13, ), - ], + ), ), ), - ], - ), + ) + ], ); } }