Skip to content

Commit 56bdd3e

Browse files
committed
feat: support for large screen sizes
1 parent b6d4455 commit 56bdd3e

File tree

8 files changed

+798
-750
lines changed

8 files changed

+798
-750
lines changed

ios/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,7 @@
5555
<true/>
5656
<key>UIFileSharingEnabled</key>
5757
<true/>
58+
<key>UIRequiresFullScreen</key>
59+
<true/>
5860
</dict>
5961
</plist>

lib/view/instruments_screen.dart

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -310,18 +310,43 @@ class _InstrumentsScreenState extends State<InstrumentsScreen> {
310310
)
311311
: ScrollConfiguration(
312312
behavior: const ScrollBehavior(),
313-
child: ListView.builder(
314-
itemCount: _filteredIndices.length,
315-
itemBuilder: (context, index) {
316-
final int originalIndex = _filteredIndices[index];
317-
return GestureDetector(
318-
onTap: () => _onItemTapped(originalIndex),
319-
child: ApplicationsListItem(
320-
heading: instrumentHeadings[originalIndex],
321-
description: instrumentDesc[originalIndex],
322-
instrumentIcon: instrumentIcons[originalIndex],
323-
),
324-
);
313+
child: LayoutBuilder(
314+
builder: (context, constraints) {
315+
return constraints.maxWidth < constraints.maxHeight
316+
? ListView.builder(
317+
itemCount: _filteredIndices.length,
318+
itemBuilder: (context, index) {
319+
final int originalIndex = _filteredIndices[index];
320+
return GestureDetector(
321+
onTap: () => _onItemTapped(originalIndex),
322+
child: ApplicationsListItem(
323+
heading: instrumentHeadings[originalIndex],
324+
description: instrumentDesc[originalIndex],
325+
instrumentIcon:
326+
instrumentIcons[originalIndex],
327+
),
328+
);
329+
},
330+
)
331+
: GridView.builder(
332+
gridDelegate:
333+
SliverGridDelegateWithFixedCrossAxisCount(
334+
crossAxisCount: 2,
335+
childAspectRatio: 2.5,
336+
),
337+
itemBuilder: (context, index) {
338+
final int originalIndex = _filteredIndices[index];
339+
return GestureDetector(
340+
onTap: () => _onItemTapped(originalIndex),
341+
child: ApplicationsListItem(
342+
heading: instrumentHeadings[originalIndex],
343+
description: instrumentDesc[originalIndex],
344+
instrumentIcon:
345+
instrumentIcons[originalIndex],
346+
),
347+
);
348+
},
349+
);
325350
},
326351
),
327352
),

lib/view/multimeter_screen.dart

Lines changed: 196 additions & 170 deletions
Large diffs are not rendered by default.

lib/view/oscilloscope_screen.dart

Lines changed: 69 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -119,72 +119,81 @@ class _OscilloscopeScreenState extends State<OscilloscopeScreen> {
119119
title: appLocalizations.oscilloscope,
120120
body: SafeArea(
121121
minimum: const EdgeInsets.only(right: 0, bottom: 0),
122-
child: Container(
123-
margin: const EdgeInsets.only(left: 5, top: 5),
124-
child: Row(
125-
children: [
126-
Expanded(
127-
flex: 87,
128-
child: Container(
129-
margin: const EdgeInsets.only(right: 5),
130-
child: Stack(
131-
children: [
132-
Column(
122+
child: LayoutBuilder(
123+
builder: (context, constraints) {
124+
return Container(
125+
margin: const EdgeInsets.only(left: 5, top: 5),
126+
child: Row(
127+
children: [
128+
Expanded(
129+
flex: 87,
130+
child: Container(
131+
margin: const EdgeInsets.only(right: 5),
132+
child: Stack(
133133
children: [
134-
Expanded(
135-
flex: 66,
136-
child: Container(
137-
padding:
138-
const EdgeInsets.only(bottom: 20),
139-
color: Colors.black,
140-
child: const OscilloscopeGraph(),
141-
),
142-
),
143-
Expanded(
144-
flex: 34,
145-
child: Selector<OscilloscopeStateProvider,
146-
int>(
147-
selector: (context, provider) =>
148-
provider.selectedIndex,
149-
builder: (context, selectedIndex, _) {
150-
switch (selectedIndex) {
151-
case 0:
152-
return const ChannelParametersWidget();
153-
case 1:
154-
return const TimebaseTriggerWidget();
155-
case 2:
156-
return const DataAnalysisWidget();
157-
case 3:
158-
return const XYPlotWidget();
159-
default:
160-
return const ChannelParametersWidget();
161-
}
162-
},
163-
),
134+
Column(
135+
children: [
136+
Expanded(
137+
flex: constraints.maxHeight < 600
138+
? 66
139+
: 80,
140+
child: Container(
141+
padding: const EdgeInsets.only(
142+
bottom: 20),
143+
color: Colors.black,
144+
child: const OscilloscopeGraph(),
145+
),
146+
),
147+
Expanded(
148+
flex: constraints.maxHeight < 600
149+
? 34
150+
: 20,
151+
child: Selector<
152+
OscilloscopeStateProvider, int>(
153+
selector: (context, provider) =>
154+
provider.selectedIndex,
155+
builder:
156+
(context, selectedIndex, _) {
157+
switch (selectedIndex) {
158+
case 0:
159+
return const ChannelParametersWidget();
160+
case 1:
161+
return const TimebaseTriggerWidget();
162+
case 2:
163+
return const DataAnalysisWidget();
164+
case 3:
165+
return const XYPlotWidget();
166+
default:
167+
return const ChannelParametersWidget();
168+
}
169+
},
170+
),
171+
),
172+
],
164173
),
174+
provider.isMeasurementsChecked
175+
? Positioned(
176+
right: 0,
177+
top: 0,
178+
child: SizedBox(
179+
width: 135,
180+
child: MeasurementsList(
181+
dataParamsChannels: provider
182+
.dataParamsChannels)),
183+
)
184+
: const SizedBox.shrink(),
165185
],
166186
),
167-
provider.isMeasurementsChecked
168-
? Positioned(
169-
right: 0,
170-
top: 0,
171-
child: SizedBox(
172-
width: 135,
173-
child: MeasurementsList(
174-
dataParamsChannels: provider
175-
.dataParamsChannels)),
176-
)
177-
: const SizedBox.shrink(),
178-
],
187+
),
179188
),
180-
),
189+
const Expanded(
190+
flex: 13,
191+
child: OscilloscopeScreenTabs(),
192+
)
193+
],
181194
),
182-
const Expanded(
183-
flex: 13,
184-
child: OscilloscopeScreenTabs(),
185-
)
186-
],
187-
),
195+
);
196+
},
188197
),
189198
),
190199
actions: [

0 commit comments

Comments
 (0)