|
| 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'; |
| 5 | +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'; |
| 9 | + |
| 10 | +class WaveGeneratorScreen extends StatefulWidget { |
| 11 | + const WaveGeneratorScreen({super.key}); |
| 12 | + |
| 13 | + @override |
| 14 | + State<StatefulWidget> createState() => _WaveGeneratorScreenState(); |
| 15 | +} |
| 16 | + |
| 17 | +class _WaveGeneratorScreenState extends State<WaveGeneratorScreen> { |
| 18 | + AppLocalizations appLocalizations = getIt.get<AppLocalizations>(); |
| 19 | + @override |
| 20 | + Widget build(BuildContext context) { |
| 21 | + return CommonScaffold( |
| 22 | + title: 'Wave Generator', |
| 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 | + ), |
| 117 | + ); |
| 118 | + } |
| 119 | +} |
0 commit comments