Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lib/constants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
23 changes: 23 additions & 0 deletions lib/others/theme.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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<Color>((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<Color>((states) {
if (states.contains(WidgetState.selected)) {
return const Color(0xFFCE525F);
}
return Colors.black;
}),
),
);
}
6 changes: 3 additions & 3 deletions lib/view/widgets/accelerometer_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ class _AccelerometerCardState extends State<AccelerometerCard> {
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(
alignment: Alignment.topLeft,
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(
alignment: Alignment.topLeft,
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),
),
),
]),
Expand Down
69 changes: 38 additions & 31 deletions lib/view/widgets/channel_parameters_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,20 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
);
},
),
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,
Expand All @@ -82,7 +83,8 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
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:
Expand Down Expand Up @@ -143,33 +145,35 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
);
},
),
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,
fontSize: 15,
),
),
),
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,
Expand Down Expand Up @@ -199,9 +203,10 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
);
},
),
const Text(
'CH3 (+/- 3.3V)',
style: TextStyle(
Text(
ch3Range,
style: const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
fontSize: 15,
Expand Down Expand Up @@ -251,9 +256,10 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
);
},
),
const Text(
'In-Built MIC',
style: TextStyle(
Text(
inBuiltMic,
style: const TextStyle(
color: Colors.black,
fontSize: 15,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
Expand Down Expand Up @@ -283,9 +289,10 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
);
},
),
const Text(
'PSLab MIC',
style: TextStyle(
Text(
pslabMic,
style: const TextStyle(
color: Colors.black,
fontSize: 15,
fontWeight: FontWeight.bold,
fontStyle: FontStyle.normal,
Expand All @@ -306,9 +313,9 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
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,
Expand Down
36 changes: 23 additions & 13 deletions lib/view/widgets/data_analysis_widget.dart
Original file line number Diff line number Diff line change
@@ -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});
Expand Down Expand Up @@ -50,9 +51,10 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
);
},
),
const Text(
'Fourier Analysis',
style: TextStyle(
Text(
fourierAnalysis,
style: const TextStyle(
color: Colors.black,
fontSize: 15,
fontWeight: FontWeight.normal,
fontStyle: FontStyle.normal,
Expand Down Expand Up @@ -88,6 +90,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
border: InputBorder.none,
),
textStyle: const TextStyle(
color: Colors.black,
fontSize: 15,
),
onSelected: (String? value) {
Expand Down Expand Up @@ -128,6 +131,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
border: InputBorder.none,
),
textStyle: const TextStyle(
color: Colors.black,
fontSize: 15,
),
onSelected: (value) {
Expand Down Expand Up @@ -165,6 +169,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
border: InputBorder.none,
),
textStyle: const TextStyle(
color: Colors.black,
fontSize: 15,
),
onSelected: (value) {
Expand All @@ -189,9 +194,9 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
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,
Expand Down Expand Up @@ -241,6 +246,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
border: InputBorder.none,
),
textStyle: const TextStyle(
color: Colors.black,
fontSize: 15,
),
onSelected: (value) => {
Expand All @@ -262,9 +268,10 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
children: [
Expanded(
child: SliderTheme(
data: const SliderThemeData(
data: SliderThemeData(
inactiveTrackColor: Colors.blueGrey[100],
trackHeight: 1,
thumbShape: RoundSliderThumbShape(
thumbShape: const RoundSliderThumbShape(
enabledThumbRadius: 6),
),
child: Slider(
Expand Down Expand Up @@ -304,6 +311,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
border: InputBorder.none,
),
style: const TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.normal,
fontStyle: FontStyle.normal,
Expand Down Expand Up @@ -343,9 +351,10 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
children: [
Expanded(
child: SliderTheme(
data: const SliderThemeData(
data: SliderThemeData(
inactiveTrackColor: Colors.blueGrey[100],
trackHeight: 1,
thumbShape: RoundSliderThumbShape(
thumbShape: const RoundSliderThumbShape(
enabledThumbRadius: 6),
),
child: Slider(
Expand Down Expand Up @@ -403,6 +412,7 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
: '${oscilloscopeStateProvider.xOffsets[oscilloscopeStateProvider.selectedChannelOffset]!.toStringAsFixed(2)} ms',
),
style: const TextStyle(
color: Colors.black,
fontSize: 14,
fontWeight: FontWeight.normal,
fontStyle: FontStyle.normal,
Expand Down Expand Up @@ -456,9 +466,9 @@ class _DataAnalysisState extends State<DataAnalysisWidget> {
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,
Expand Down
6 changes: 3 additions & 3 deletions lib/view/widgets/gyroscope_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,23 @@ class _GyroscopeCardState extends State<GyroscopeCard> {
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(
alignment: Alignment.topLeft,
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(
alignment: Alignment.topLeft,
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),
),
),
]),
Expand Down
Loading