Skip to content

Commit a266e0d

Browse files
committed
feat: added layout
1 parent 4e9f76c commit a266e0d

10 files changed

+866
-2
lines changed

assets/icons/ic_sin.png

1 KB
Loading

assets/icons/ic_triangular.png

1.09 KB
Loading

lib/l10n/app_en.arb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@
100100
"pinPV3": "PV3",
101101
"pinPCS": "PCS",
102102
"analyze": "ANALYZE",
103+
"analog": "Analog",
104+
"digital": "Digital",
105+
"wave1": "Wave 1",
106+
"wave2": "Wave 2",
107+
"sqr1": "sqr1",
108+
"sqr2": "sqr2",
109+
"sqr3": "sqr3",
110+
"sqr4": "sqr4",
111+
"freq": "Freq",
112+
"phase": "Phase",
113+
"duty": "Duty",
114+
"produceSound": "Produce Sound",
103115
"settings": "Settings",
104116
"autoStart": "Auto Start",
105117
"autoStartText": "Auto start app when PSLab device is connected",

lib/l10n/app_localizations.dart

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,78 @@ abstract class AppLocalizations {
694694
/// **'ANALYZE'**
695695
String get analyze;
696696

697+
/// No description provided for @analog.
698+
///
699+
/// In en, this message translates to:
700+
/// **'Analog'**
701+
String get analog;
702+
703+
/// No description provided for @digital.
704+
///
705+
/// In en, this message translates to:
706+
/// **'Digital'**
707+
String get digital;
708+
709+
/// No description provided for @wave1.
710+
///
711+
/// In en, this message translates to:
712+
/// **'Wave 1'**
713+
String get wave1;
714+
715+
/// No description provided for @wave2.
716+
///
717+
/// In en, this message translates to:
718+
/// **'Wave 2'**
719+
String get wave2;
720+
721+
/// No description provided for @sqr1.
722+
///
723+
/// In en, this message translates to:
724+
/// **'sqr1'**
725+
String get sqr1;
726+
727+
/// No description provided for @sqr2.
728+
///
729+
/// In en, this message translates to:
730+
/// **'sqr2'**
731+
String get sqr2;
732+
733+
/// No description provided for @sqr3.
734+
///
735+
/// In en, this message translates to:
736+
/// **'sqr3'**
737+
String get sqr3;
738+
739+
/// No description provided for @sqr4.
740+
///
741+
/// In en, this message translates to:
742+
/// **'sqr4'**
743+
String get sqr4;
744+
745+
/// No description provided for @freq.
746+
///
747+
/// In en, this message translates to:
748+
/// **'Freq'**
749+
String get freq;
750+
751+
/// No description provided for @phase.
752+
///
753+
/// In en, this message translates to:
754+
/// **'Phase'**
755+
String get phase;
756+
757+
/// No description provided for @duty.
758+
///
759+
/// In en, this message translates to:
760+
/// **'Duty'**
761+
String get duty;
762+
763+
/// No description provided for @produceSound.
764+
///
765+
/// In en, this message translates to:
766+
/// **'Produce Sound'**
767+
String get produceSound;
768+
697769
/// No description provided for @settings.
698770
///
699771
/// In en, this message translates to:

lib/l10n/app_localizations_en.dart

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,42 @@ class AppLocalizationsEn extends AppLocalizations {
319319
@override
320320
String get analyze => 'ANALYZE';
321321

322+
@override
323+
String get analog => 'Analog';
324+
325+
@override
326+
String get digital => 'Digital';
327+
328+
@override
329+
String get wave1 => 'Wave 1';
330+
331+
@override
332+
String get wave2 => 'Wave 2';
333+
334+
@override
335+
String get sqr1 => 'sqr1';
336+
337+
@override
338+
String get sqr2 => 'sqr2';
339+
340+
@override
341+
String get sqr3 => 'sqr3';
342+
343+
@override
344+
String get sqr4 => 'sqr4';
345+
346+
@override
347+
String get freq => 'Freq';
348+
349+
@override
350+
String get phase => 'Phase';
351+
352+
@override
353+
String get duty => 'Duty';
354+
355+
@override
356+
String get produceSound => 'Produce Sound';
357+
322358
@override
323359
String get settings => 'Settings';
324360

lib/view/wave_generator_screen.dart

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
import 'package:flutter/widgets.dart';
1+
import 'package:flutter/material.dart';
2+
import 'package:pslab/l10n/app_localizations.dart';
3+
import 'package:pslab/providers/locator.dart';
4+
import 'package:pslab/theme/colors.dart';
25
import 'package:pslab/view/widgets/common_scaffold_widget.dart';
6+
import 'package:pslab/view/widgets/analog_waveform_controls.dart';
7+
import 'package:pslab/view/widgets/wave_generator_graph.dart';
8+
import 'package:pslab/view/widgets/wave_generator_main_controls.dart';
39

410
class WaveGeneratorScreen extends StatefulWidget {
511
const WaveGeneratorScreen({super.key});
@@ -9,11 +15,105 @@ class WaveGeneratorScreen extends StatefulWidget {
915
}
1016

1117
class _WaveGeneratorScreenState extends State<WaveGeneratorScreen> {
18+
AppLocalizations appLocalizations = getIt.get<AppLocalizations>();
1219
@override
1320
Widget build(BuildContext context) {
1421
return CommonScaffold(
1522
title: 'Wave Generator',
16-
body: Container(),
23+
body: Container(
24+
margin: const EdgeInsets.all(8.0),
25+
child: Column(
26+
children: [
27+
Expanded(
28+
flex: 30,
29+
child: Container(
30+
color: chartBackgroundColor,
31+
child: WaveGeneratorGraph(),
32+
),
33+
),
34+
Expanded(
35+
flex: 30,
36+
child: Column(
37+
children: [
38+
Expanded(
39+
flex: 70,
40+
child: AnalogWaveformControls(),
41+
),
42+
Expanded(
43+
flex: 30,
44+
child: Row(
45+
crossAxisAlignment: CrossAxisAlignment.stretch,
46+
children: [
47+
Expanded(
48+
child: TextButton(
49+
style: TextButton.styleFrom(
50+
backgroundColor: primaryRed,
51+
shape: RoundedRectangleBorder(
52+
borderRadius: BorderRadius.circular(6),
53+
),
54+
),
55+
child: Text(
56+
appLocalizations.produceSound,
57+
textAlign: TextAlign.center,
58+
style: TextStyle(
59+
color: Colors.white,
60+
fontSize: 14,
61+
),
62+
),
63+
onPressed: () => {},
64+
),
65+
),
66+
const SizedBox(width: 4),
67+
Expanded(
68+
child: TextButton(
69+
style: TextButton.styleFrom(
70+
backgroundColor: primaryRed,
71+
shape: RoundedRectangleBorder(
72+
borderRadius: BorderRadius.circular(6),
73+
),
74+
),
75+
child: Text(
76+
appLocalizations.analog,
77+
style: TextStyle(
78+
color: Colors.white,
79+
fontSize: 14,
80+
),
81+
),
82+
onPressed: () => {},
83+
),
84+
),
85+
const SizedBox(width: 4),
86+
Expanded(
87+
child: TextButton(
88+
style: TextButton.styleFrom(
89+
backgroundColor: primaryRed,
90+
shape: RoundedRectangleBorder(
91+
borderRadius: BorderRadius.circular(6),
92+
),
93+
),
94+
child: Text(
95+
appLocalizations.digital,
96+
style: TextStyle(
97+
color: Colors.white,
98+
fontSize: 14,
99+
),
100+
),
101+
onPressed: () => {},
102+
),
103+
),
104+
],
105+
),
106+
),
107+
],
108+
),
109+
),
110+
Expanded(
111+
flex: 40,
112+
child: WaveGeneratorMainControls(),
113+
),
114+
],
115+
),
116+
),
17117
);
18118
}
19119
}

0 commit comments

Comments
 (0)