diff --git a/lib/constants.dart b/lib/constants.dart index 0c4eefb61..c43fe0b27 100644 --- a/lib/constants.dart +++ b/lib/constants.dart @@ -74,8 +74,8 @@ List rangeMenuEntries = [ 'CH2', 'CH3', 'MIC', - 'CAP' - 'RES', + 'CAP', + 'RES', 'VOL', ]; diff --git a/lib/main.dart b/lib/main.dart index 48209138e..6d023c5f9 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -8,6 +8,8 @@ import 'package:pslab/view/faq_screen.dart'; import 'package:pslab/view/instruments_screen.dart'; import 'package:pslab/view/oscilloscope_screen.dart'; +import 'constants.dart'; + void main() { setupLocator(); WidgetsFlutterBinding.ensureInitialized(); @@ -29,8 +31,8 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { + _preCacheImages(context); return ScreenUtilInit( - designSize: const Size(360, 690), builder: (context, child) { return MaterialApp( debugShowCheckedModeBanner: false, @@ -50,3 +52,11 @@ class MyApp extends StatelessWidget { ); } } + +void _preCacheImages(BuildContext context) { + for (final path in instrumentIcons) { + precacheImage(AssetImage(path), context); + } + precacheImage( + const AssetImage('assets/icons/ic_nav_header_logo.png'), context); +} diff --git a/lib/view/instruments_screen.dart b/lib/view/instruments_screen.dart index bead05324..858916767 100644 --- a/lib/view/instruments_screen.dart +++ b/lib/view/instruments_screen.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:pslab/constants.dart'; import 'package:pslab/view/widgets/applications_list_item.dart'; import 'package:pslab/view/widgets/main_scaffold_widget.dart'; @@ -15,7 +16,16 @@ class _InstrumentsScreenState extends State { void _onItemTapped(int index) { switch (index) { case 0: - Navigator.pushNamed(context, '/oscilloscope'); + if (Navigator.canPop(context) && + ModalRoute.of(context)?.settings.name == '/oscilloscope') { + Navigator.popUntil(context, ModalRoute.withName('/oscilloscope')); + } else { + Navigator.pushNamedAndRemoveUntil( + context, + '/oscilloscope', + (route) => route.isFirst, + ); + } break; default: break; @@ -35,8 +45,6 @@ class _InstrumentsScreenState extends State { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, - DeviceOrientation.landscapeLeft, - DeviceOrientation.landscapeRight, ]); } @@ -47,6 +55,9 @@ class _InstrumentsScreenState extends State { @override Widget build(BuildContext context) { + ScreenUtil.configure( + designSize: const Size(360, 690), + ); return MainScaffold( index: 0, title: 'Instruments', diff --git a/lib/view/oscilloscope_screen.dart b/lib/view/oscilloscope_screen.dart index 455237836..51d5b7680 100644 --- a/lib/view/oscilloscope_screen.dart +++ b/lib/view/oscilloscope_screen.dart @@ -38,6 +38,9 @@ class _OscilloscopeScreenState extends State { @override Widget build(BuildContext context) { + ScreenUtil.configure( + designSize: const Size(690, 360), + ); return MultiProvider( providers: [ ChangeNotifierProvider(create: (_) => OscilloscopeStateProvider()), @@ -50,12 +53,12 @@ class _OscilloscopeScreenState extends State { child: Row( children: [ Container( - width: 310.w, + width: 590.w, margin: const EdgeInsets.only(right: 5), child: Column( children: [ SizedBox( - height: 380.h, + height: 197.h, child: LineChart( LineChartData( backgroundColor: Colors.black, diff --git a/lib/view/widgets/channel_parameters_widget.dart b/lib/view/widgets/channel_parameters_widget.dart index 5a1b3ea7a..c5d300e9e 100644 --- a/lib/view/widgets/channel_parameters_widget.dart +++ b/lib/view/widgets/channel_parameters_widget.dart @@ -28,8 +28,8 @@ class _ChannelParametersState extends State { child: Stack( children: [ Positioned( - top: 0.h, - left: 2.w, + top: -4.h, + left: 4.w, child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, @@ -48,32 +48,32 @@ class _ChannelParametersState extends State { ), Padding( padding: EdgeInsets.only(top: 2.h), - child: const Text( + child: Text( 'CH1', style: TextStyle( fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, - fontSize: 15, + fontSize: 15.sp, ), ), ), Padding( - padding: EdgeInsets.only(top: 1.h, left: 3.w), - child: const Text( + padding: EdgeInsets.only(top: 1.h, left: 8.w), + child: Text( 'Range', style: TextStyle( - color: Color(0xFF424242), + color: const Color(0xFF424242), fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, - fontSize: 14, + fontSize: 14.sp, ), ), ), Padding( - padding: EdgeInsets.only(top: 1.h, left: 4.w), + padding: EdgeInsets.only(left: 6.w), child: DropdownMenu( initialSelection: yAxisRanges[0], - width: 60.w, + width: 130.w, dropdownMenuEntries: yAxisRanges.map( (String value) { return DropdownMenuEntry( @@ -85,8 +85,8 @@ class _ChannelParametersState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 14.sp, ), onSelected: (String? value) { switch (yAxisRanges.indexOf(value!)) { @@ -127,7 +127,7 @@ class _ChannelParametersState extends State { Padding( padding: EdgeInsets.only(top: 0.h), child: DropdownMenu( - width: 50.w, + width: 95.w, initialSelection: rangeMenuEntries[0], dropdownMenuEntries: rangeMenuEntries.map( (String value) { @@ -140,8 +140,8 @@ class _ChannelParametersState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 15, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ), @@ -149,8 +149,8 @@ class _ChannelParametersState extends State { ), ), Positioned( - left: 2.w, - bottom: 8.h, + left: 4.w, + bottom: 2.h, child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, @@ -169,37 +169,37 @@ class _ChannelParametersState extends State { ), Padding( padding: EdgeInsets.only(top: 2.h), - child: const Text( + child: Text( 'CH2', style: TextStyle( fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, - fontSize: 15, + fontSize: 15.sp, ), ), ), Padding( - padding: EdgeInsets.only(top: 1.h, left: 3.w), - child: const Text( + padding: EdgeInsets.only(top: 1.h, left: 8.w), + child: Text( 'Range', style: TextStyle( - color: Color(0xFF424242), + color: const Color(0xFF424242), fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, - fontSize: 14, + fontSize: 14.sp, ), ), ), Padding( - padding: EdgeInsets.only(top: 2.h, left: 4.w), + padding: EdgeInsets.only(top: 2.h, left: 6.w), child: SizedBox( - width: 60.w, - child: const Text( + width: 130.w, + child: Text( '+/-16V', style: TextStyle( fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, - fontSize: 14, + fontSize: 14.sp, ), ), ), @@ -208,12 +208,12 @@ class _ChannelParametersState extends State { padding: EdgeInsets.only(top: 2.h), child: SizedBox( width: 45.w, - child: const Text( + child: Text( 'CH2', style: TextStyle( fontStyle: FontStyle.normal, fontWeight: FontWeight.normal, - fontSize: 15, + fontSize: 15.sp, ), ), ), @@ -222,8 +222,8 @@ class _ChannelParametersState extends State { ), ), Positioned( - top: 16.h, - right: 4.w, + top: 4.h, + right: 8.w, child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, @@ -241,13 +241,13 @@ class _ChannelParametersState extends State { }, ), Padding( - padding: EdgeInsets.only(top: 2.h), - child: const Text( + padding: EdgeInsets.only(top: 1.h), + child: Text( 'CH3 (+/- 3.3V)', style: TextStyle( fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, - fontSize: 15, + fontSize: 15.sp, ), ), ), @@ -255,8 +255,8 @@ class _ChannelParametersState extends State { ), ), Positioned( - bottom: 8.h, - right: 4.w, + bottom: 2.h, + right: 8.w, child: Row( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.center, @@ -289,10 +289,10 @@ class _ChannelParametersState extends State { ), Padding( padding: EdgeInsets.only(top: 2.h), - child: const Text( + child: Text( 'In-Built MIC', style: TextStyle( - fontSize: 15, + fontSize: 15.sp, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, ), @@ -324,10 +324,10 @@ class _ChannelParametersState extends State { ), Padding( padding: EdgeInsets.only(top: 2.h), - child: const Text( + child: Text( 'PSLab MIC', style: TextStyle( - fontSize: 15, + fontSize: 15.sp, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, ), @@ -342,19 +342,19 @@ class _ChannelParametersState extends State { Positioned( left: 0.w, right: 0.w, - top: 2.h, + top: 1.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', + child: Text( + 'Channels', style: TextStyle( - color: Color(0xFFC72C2C), + color: const Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, - fontSize: 13, + fontSize: 13.sp, ), ), ), diff --git a/lib/view/widgets/common_scaffold_widget.dart b/lib/view/widgets/common_scaffold_widget.dart index adcec7b19..a30ed66bd 100644 --- a/lib/view/widgets/common_scaffold_widget.dart +++ b/lib/view/widgets/common_scaffold_widget.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; class CommonScaffold extends StatefulWidget { final String title; @@ -52,9 +53,9 @@ class _CommonScaffoldState extends State { title: Text( key: widget.scaffoldKey, widget.title, - style: const TextStyle( + style: TextStyle( color: Colors.white, - fontSize: 15, + fontSize: 15.sp, ), ), actions: [ diff --git a/lib/view/widgets/data_analysis_widget.dart b/lib/view/widgets/data_analysis_widget.dart index 4231bcf3d..3283068b5 100644 --- a/lib/view/widgets/data_analysis_widget.dart +++ b/lib/view/widgets/data_analysis_widget.dart @@ -30,8 +30,8 @@ class _DataAnalysisState extends State { child: Stack( children: [ Positioned( - top: 0.h, - left: 2.w, + top: -2.h, + left: 4.w, right: 0.h, child: Row( mainAxisSize: MainAxisSize.max, @@ -54,10 +54,10 @@ class _DataAnalysisState extends State { ), Padding( padding: EdgeInsets.only(bottom: 2.h), - child: const Text( + child: Text( 'Fourier Analysis', style: TextStyle( - fontSize: 14, + fontSize: 15.sp, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, ), @@ -65,9 +65,10 @@ class _DataAnalysisState extends State { ), const Spacer(), DropdownMenu( - width: 50.w, - initialSelection: 'CH1', + width: 95.w, + initialSelection: 'None', dropdownMenuEntries: [ + 'None', 'CH1', 'CH2', 'CH3', @@ -83,22 +84,22 @@ class _DataAnalysisState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ], ), ), Positioned( - bottom: 0.h, - left: 6.w, + bottom: -6.h, + left: 14.w, right: 0.h, child: Row( mainAxisSize: MainAxisSize.max, children: [ DropdownMenu( - width: 80.w, + width: 150.w, initialSelection: 'Sine Fit', dropdownMenuEntries: [ 'Sine Fit', @@ -114,17 +115,18 @@ class _DataAnalysisState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), const Spacer(), Padding( padding: EdgeInsets.only(left: 4.w), child: DropdownMenu( - width: 50.w, - initialSelection: 'CH1', + width: 95.w, + initialSelection: 'None', dropdownMenuEntries: [ + 'None', 'CH1', 'CH2', 'CH3', @@ -140,8 +142,8 @@ class _DataAnalysisState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ), @@ -154,19 +156,19 @@ class _DataAnalysisState extends State { Positioned( left: 0.w, right: 0.w, - top: 2.h, + top: 1.h, child: Align( alignment: Alignment.center, child: Container( padding: EdgeInsets.symmetric(horizontal: 2.w), decoration: const BoxDecoration(color: Colors.white), - child: const Text( + child: Text( 'Data Analysis', style: TextStyle( - color: Color(0xFFC72C2C), + color: const Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, - fontSize: 13, + fontSize: 13.sp, ), ), ), @@ -189,10 +191,10 @@ class _DataAnalysisState extends State { Positioned( bottom: 0.h, top: 0.h, - left: 6.w, + left: 12.w, child: Center( child: DropdownMenu( - width: 50.w, + width: 95.w, initialSelection: 'CH1', dropdownMenuEntries: [ 'CH1', @@ -210,16 +212,16 @@ class _DataAnalysisState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ), ), Positioned( top: 4.h, - right: 4.w, - left: 45.w, + right: 8.w, + left: 75.w, child: Row( children: [ Expanded( @@ -246,8 +248,8 @@ class _DataAnalysisState extends State { ), Text( '${verticalOffset.toStringAsFixed(2)} V', - style: const TextStyle( - fontSize: 14, + style: TextStyle( + fontSize: 15.sp, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, ), @@ -256,9 +258,9 @@ class _DataAnalysisState extends State { ), ), Positioned( - bottom: 0.h, - right: 4.w, - left: 45.w, + bottom: -2.h, + right: 8.w, + left: 75.w, child: Row( children: [ Expanded( @@ -285,8 +287,8 @@ class _DataAnalysisState extends State { ), Text( '${horizontalOffset.toStringAsFixed(2)} ms', - style: const TextStyle( - fontSize: 14, + style: TextStyle( + fontSize: 15.sp, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, ), @@ -300,19 +302,19 @@ class _DataAnalysisState extends State { Positioned( left: 0.w, right: 0.w, - top: 2.h, + top: 1.h, child: Align( alignment: Alignment.center, child: Container( padding: EdgeInsets.symmetric(horizontal: 2.w), decoration: const BoxDecoration(color: Colors.white), - child: const Text( + child: Text( 'Offsets', style: TextStyle( - color: Color(0xFFC72C2C), + color: const Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, - fontSize: 13, + fontSize: 13.sp, ), ), ), diff --git a/lib/view/widgets/main_scaffold_widget.dart b/lib/view/widgets/main_scaffold_widget.dart index 535c6f4b0..f09fb6c7e 100644 --- a/lib/view/widgets/main_scaffold_widget.dart +++ b/lib/view/widgets/main_scaffold_widget.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:provider/provider.dart'; import 'package:pslab/providers/board_state_provider.dart'; @@ -50,9 +51,9 @@ class _MainScaffoldState extends State { title: Text( key: widget.scaffoldKey, widget.title, - style: const TextStyle( + style: TextStyle( color: Colors.white, - fontSize: 18, + fontSize: 18.sp, ), ), actions: [ diff --git a/lib/view/widgets/oscilloscope_screen_tabs.dart b/lib/view/widgets/oscilloscope_screen_tabs.dart index 16c8dd1e9..05f6a6e76 100644 --- a/lib/view/widgets/oscilloscope_screen_tabs.dart +++ b/lib/view/widgets/oscilloscope_screen_tabs.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:provider/provider.dart'; import 'package:pslab/providers/oscilloscope_state_provider.dart'; @@ -62,13 +63,13 @@ class _OscilloscopeTabsState extends State { color: oscilloscopeStateProvider.selectedIndex == 0 ? const Color(0xFFC72C2C) : Colors.transparent, - child: const Text( + child: Text( 'Channels', textAlign: TextAlign.center, maxLines: 1, style: TextStyle( color: Colors.black, - fontSize: 9, + fontSize: 9.sp, fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, ), @@ -114,13 +115,13 @@ class _OscilloscopeTabsState extends State { color: oscilloscopeStateProvider.selectedIndex == 1 ? const Color(0xFFC72C2C) : Colors.transparent, - child: const Text( + child: Text( 'Timebase', textAlign: TextAlign.center, maxLines: 1, style: TextStyle( color: Colors.black, - fontSize: 9, + fontSize: 9.sp, fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, ), @@ -165,13 +166,13 @@ class _OscilloscopeTabsState extends State { color: oscilloscopeStateProvider.selectedIndex == 2 ? const Color(0xFFC72C2C) : Colors.transparent, - child: const Text( + child: Text( 'Data Analysis', textAlign: TextAlign.center, maxLines: 1, style: TextStyle( color: Colors.black, - fontSize: 9, + fontSize: 9.sp, fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, ), @@ -216,13 +217,13 @@ class _OscilloscopeTabsState extends State { color: oscilloscopeStateProvider.selectedIndex == 3 ? const Color(0xFFC72C2C) : Colors.transparent, - child: const Text( + child: Text( 'XY Plot', textAlign: TextAlign.center, maxLines: 1, style: TextStyle( color: Colors.black, - fontSize: 9, + fontSize: 9.sp, fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, ), diff --git a/lib/view/widgets/timebase_trigger_widget.dart b/lib/view/widgets/timebase_trigger_widget.dart index 7f65ae91d..e7a7182e4 100644 --- a/lib/view/widgets/timebase_trigger_widget.dart +++ b/lib/view/widgets/timebase_trigger_widget.dart @@ -26,13 +26,13 @@ class _TimebaseTriggerState extends State { child: Stack( children: [ Positioned( - top: 0.h, - left: 2.w, + bottom: -4.h, + left: 4.w, right: 0.w, child: Row( children: [ Padding( - padding: EdgeInsets.only(bottom: 2.h), + padding: EdgeInsets.only(bottom: 1.h), child: Checkbox( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, activeColor: const Color(0xFFCE525F), @@ -47,20 +47,20 @@ class _TimebaseTriggerState extends State { ), ), Padding( - padding: EdgeInsets.only(bottom: 2.h), - child: const Text( + padding: EdgeInsets.only(bottom: 1.h), + child: Text( 'Trigger', style: TextStyle( - fontSize: 14, + fontSize: 15.sp, fontWeight: FontWeight.bold, fontStyle: FontStyle.normal, ), ), ), Padding( - padding: EdgeInsets.only(left: 8.w), + padding: EdgeInsets.only(left: 12.w), child: DropdownMenu( - width: 50.w, + width: 95.w, initialSelection: 'CH1', dropdownMenuEntries: [ 'CH1', @@ -78,8 +78,8 @@ class _TimebaseTriggerState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ), @@ -105,18 +105,21 @@ class _TimebaseTriggerState extends State { ), ), ), - Text( - '${triggerValue.toStringAsFixed(1)} V', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, + Padding( + padding: EdgeInsets.only(left: 8.w), + child: Text( + '${triggerValue.toStringAsFixed(1)} V', + style: TextStyle( + fontSize: 15.sp, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), ), ), Padding( - padding: EdgeInsets.only(left: 8.w), + padding: EdgeInsets.only(left: 20.w), child: DropdownMenu( - width: 70.w, + width: 145.w, initialSelection: 'Rising Edge', dropdownMenuEntries: [ 'Rising Edge', @@ -133,8 +136,8 @@ class _TimebaseTriggerState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ), @@ -142,19 +145,22 @@ class _TimebaseTriggerState extends State { ), ), Positioned( - bottom: 0.h, - left: 8.w, - right: 8.w, + top: 0.h, + left: 16.w, + right: 24.w, child: Row( mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, children: [ - const Text( - 'Timebase', - style: TextStyle( - fontSize: 14, - fontWeight: FontWeight.bold, - fontStyle: FontStyle.normal, + Padding( + padding: EdgeInsets.only(right: 40.w), + child: Text( + 'Timebase', + style: TextStyle( + fontSize: 15.sp, + fontWeight: FontWeight.bold, + fontStyle: FontStyle.normal, + ), ), ), Expanded( @@ -180,12 +186,15 @@ class _TimebaseTriggerState extends State { ), ), ), - Text( - '${_timebaseSlider.toStringAsFixed(2)} ms', - style: const TextStyle( - fontSize: 14, - fontWeight: FontWeight.normal, - fontStyle: FontStyle.normal, + Padding( + padding: EdgeInsets.only(left: 40.w), + child: Text( + '${_timebaseSlider.toStringAsFixed(2)} ms', + style: TextStyle( + fontSize: 15.sp, + fontWeight: FontWeight.normal, + fontStyle: FontStyle.normal, + ), ), ), ], @@ -197,19 +206,19 @@ class _TimebaseTriggerState extends State { Positioned( left: 0.w, right: 0.w, - top: 2.h, + top: 1.h, child: Align( alignment: Alignment.center, child: Container( padding: EdgeInsets.symmetric(horizontal: 2.w), decoration: const BoxDecoration(color: Colors.white), - child: const Text( + child: Text( 'Timebase & Trigger', style: TextStyle( - color: Color(0xFFC72C2C), + color: const Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, - fontSize: 13, + fontSize: 13.sp, ), ), ), diff --git a/lib/view/widgets/xyplot_widget.dart b/lib/view/widgets/xyplot_widget.dart index d5d9082e6..da2213444 100644 --- a/lib/view/widgets/xyplot_widget.dart +++ b/lib/view/widgets/xyplot_widget.dart @@ -24,8 +24,8 @@ class _XYPlotState extends State { child: Stack( children: [ Positioned( - top: 0.h, - left: 2.w, + top: 4.h, + left: 4.w, right: 0.w, child: Row( mainAxisSize: MainAxisSize.max, @@ -47,18 +47,27 @@ class _XYPlotState extends State { ), Padding( padding: EdgeInsets.only(bottom: 2.h), - child: const Text( + child: Text( 'Enable XY Plot', style: TextStyle( - fontSize: 14, + fontSize: 15.sp, fontWeight: FontWeight.normal, fontStyle: FontStyle.normal, ), ), ), - const Spacer(), + ], + ), + ), + Positioned( + bottom: -6.h, + left: 14.w, + right: 14.w, + child: Row( + mainAxisSize: MainAxisSize.max, + children: [ DropdownMenu( - width: 50.w, + width: 95.w, initialSelection: 'CH1', dropdownMenuEntries: [ 'CH1', @@ -76,12 +85,12 @@ class _XYPlotState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), DropdownMenu( - width: 50.w, + width: 95.w, initialSelection: 'CH2', dropdownMenuEntries: [ 'CH1', @@ -99,32 +108,32 @@ class _XYPlotState extends State { inputDecorationTheme: const InputDecorationTheme( border: InputBorder.none, ), - textStyle: const TextStyle( - fontSize: 14, + textStyle: TextStyle( + fontSize: 15.sp, ), ), ], ), - ), + ) ], ), ), Positioned( left: 0.w, right: 0.w, - top: 2.h, + top: 1.h, child: Align( alignment: Alignment.center, child: Container( padding: EdgeInsets.symmetric(horizontal: 2.w), decoration: const BoxDecoration(color: Colors.white), - child: const Text( + child: Text( 'XY Plot', style: TextStyle( - color: Color(0xFFC72C2C), + color: const Color(0xFFC72C2C), fontStyle: FontStyle.normal, fontWeight: FontWeight.bold, - fontSize: 13, + fontSize: 13.sp, ), ), ), diff --git a/pubspec.lock b/pubspec.lock index aa5f3f66e..7756ec4db 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -93,10 +93,10 @@ packages: dependency: "direct main" description: name: fl_chart - sha256: "10ddaf334fe84d59333a12d153043e366f243e0bdfff2df0313e1e249f5bf926" + sha256: "5276944c6ffc975ae796569a826c38a62d2abcf264e26b88fa6f482e107f4237" url: "https://pub.dev" source: hosted - version: "0.70.1" + version: "0.70.2" flutter: dependency: "direct main" description: flutter @@ -151,10 +151,10 @@ packages: dependency: transitive description: name: http - sha256: b9c29a161230ee03d3ccf545097fccd9b87a5264228c5d348202e0f0c28f9010 + sha256: fe7ab022b76f3034adc518fb6ea04a82387620e19977665ea18d30a1cf43442f url: "https://pub.dev" source: hosted - version: "1.2.2" + version: "1.3.0" http_parser: dependency: transitive description: @@ -397,7 +397,7 @@ packages: description: path: "." ref: master - resolved-ref: "35f3cca1454f03f07bb646bfb36aed32011e5443" + resolved-ref: ba7892bca3b8bf7725af92c6cc58279659c2a2bc url: "https://github.com/AsCress/usbserial.git" source: git version: "0.5.1"