Skip to content

Commit f7985f3

Browse files
dart format . (#63)
1 parent 192ae01 commit f7985f3

17 files changed

+283
-317
lines changed

example/lib/example_authenticator.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ class _ExampleAuthenticatorState extends State<ExampleAuthenticator> {
7272
child: Authenticator(
7373
oAuthUserConfigurations:
7474
_authenticationType == _AuthenticationType.oauth
75-
? _oAuthUserConfigurations
76-
: [],
75+
? _oAuthUserConfigurations
76+
: [],
7777
// Add a map view as the child to the Authenticator, and set a controller.
7878
child: ArcGISMapView(
7979
controllerProvider: () => _mapViewController,
80-
onMapViewReady:
81-
() => _mapViewController.arcGISMap = _emptyMap,
80+
onMapViewReady: () =>
81+
_mapViewController.arcGISMap = _emptyMap,
8282
),
8383
),
8484
),
@@ -107,10 +107,9 @@ class _ExampleAuthenticatorState extends State<ExampleAuthenticator> {
107107
// revoke any OAuth tokens and remove all credentials.
108108
ElevatedButton(
109109
onPressed: _mapState == _MapState.unloaded ? load : unload,
110-
child:
111-
_mapState == _MapState.unloaded
112-
? const Text('Load')
113-
: const Text('Unload'),
110+
child: _mapState == _MapState.unloaded
111+
? const Text('Load')
112+
: const Text('Unload'),
114113
),
115114
],
116115
),

example/lib/example_compass.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ class ExampleCompass extends StatelessWidget {
9292
body: ListView.builder(
9393
padding: const EdgeInsets.all(10),
9494
itemCount: CompassExample.values.length,
95-
itemBuilder:
96-
(context, index) => CompassExample.values[index].buildCard(context),
95+
itemBuilder: (context, index) =>
96+
CompassExample.values[index].buildCard(context),
9797
),
9898
);
9999
}

example/lib/example_overview_map.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ class ExampleOverviewMap extends StatelessWidget {
8686
body: ListView.builder(
8787
padding: const EdgeInsets.all(10),
8888
itemCount: OverviewMapExample.values.length,
89-
itemBuilder:
90-
(context, index) =>
91-
OverviewMapExample.values[index].buildCard(context),
89+
itemBuilder: (context, index) =>
90+
OverviewMapExample.values[index].buildCard(context),
9291
),
9392
);
9493
}

example/lib/example_popup.dart

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,19 @@ class _PopupExampleState extends State<PopupExample> {
7979
Widget? getBottomSheet(BuildContext context) {
8080
return _identifiedPopup != null
8181
? SizedBox(
82-
height: MediaQuery.sizeOf(context).height * 0.7,
83-
child: PopupView(
84-
// Pass a popup to the popup view widget to display it.
85-
popup: _identifiedPopup!,
86-
// Optionally, pass a callback for when the popup view is closed.
87-
// Here we reset the identifiedPopup variable back to null.
88-
onClose: () {
89-
setState(() {
90-
_identifiedPopup = null;
91-
});
92-
},
93-
),
94-
)
82+
height: MediaQuery.sizeOf(context).height * 0.7,
83+
child: PopupView(
84+
// Pass a popup to the popup view widget to display it.
85+
popup: _identifiedPopup!,
86+
// Optionally, pass a callback for when the popup view is closed.
87+
// Here we reset the identifiedPopup variable back to null.
88+
onClose: () {
89+
setState(() {
90+
_identifiedPopup = null;
91+
});
92+
},
93+
),
94+
)
9595
: null;
9696
}
9797

example/lib/main.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,8 @@ class ExampleApp extends StatelessWidget {
9898
body: ListView.builder(
9999
padding: const EdgeInsets.all(10),
100100
itemCount: ComponentExample.values.length,
101-
itemBuilder:
102-
(context, index) =>
103-
ComponentExample.values[index].buildCard(context),
101+
itemBuilder: (context, index) =>
102+
ComponentExample.values[index].buildCard(context),
104103
),
105104
);
106105
}

lib/src/authenticator/authenticator.dart

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,13 @@ class _AuthenticatorState extends State<Authenticator>
135135
void dispose() {
136136
if (_errorMessage.isEmpty) {
137137
ArcGISEnvironment
138-
.authenticationManager
139-
.arcGISAuthenticationChallengeHandler = null;
138+
.authenticationManager
139+
.arcGISAuthenticationChallengeHandler =
140+
null;
140141
ArcGISEnvironment
141-
.authenticationManager
142-
.networkAuthenticationChallengeHandler = null;
142+
.authenticationManager
143+
.networkAuthenticationChallengeHandler =
144+
null;
143145
}
144146

145147
super.dispose();
@@ -159,13 +161,12 @@ class _AuthenticatorState extends State<Authenticator>
159161
ArcGISAuthenticationChallenge challenge,
160162
) {
161163
// If an OAuth configuration matches, use it. Else use token login.
162-
final configuration =
163-
widget.oAuthUserConfigurations
164-
.where(
165-
(configuration) =>
166-
configuration.canBeUsedForUri(challenge.requestUri),
167-
)
168-
.firstOrNull;
164+
final configuration = widget.oAuthUserConfigurations
165+
.where(
166+
(configuration) =>
167+
configuration.canBeUsedForUri(challenge.requestUri),
168+
)
169+
.firstOrNull;
169170

170171
if (configuration != null) {
171172
_oauthLogin(challenge, configuration);
@@ -203,9 +204,8 @@ class _AuthenticatorState extends State<Authenticator>
203204
// Show an _AuthenticatorLogin dialog, which will answer the challenge.
204205
showDialog(
205206
context: context,
206-
builder:
207-
(context) =>
208-
_AuthenticatorLogin(challenge: _ArcGISLoginChallenge(challenge)),
207+
builder: (context) =>
208+
_AuthenticatorLogin(challenge: _ArcGISLoginChallenge(challenge)),
209209
);
210210
}
211211

@@ -226,10 +226,8 @@ class _AuthenticatorState extends State<Authenticator>
226226
// Show an _AuthenticatorLogin dialog, which will answer the challenge.
227227
await showDialog(
228228
context: context,
229-
builder:
230-
(context) => _AuthenticatorLogin(
231-
challenge: _NetworkLoginChallenge(challenge),
232-
),
229+
builder: (context) =>
230+
_AuthenticatorLogin(challenge: _NetworkLoginChallenge(challenge)),
233231
);
234232
case ClientCertificateAuthenticationChallenge():
235233
await _clientCertificateWorkflow(challenge);
@@ -242,8 +240,8 @@ class _AuthenticatorState extends State<Authenticator>
242240
// Show an _AuthenticatorCertificateRequired dialog.
243241
final browse = await showDialog<bool>(
244242
context: context,
245-
builder:
246-
(context) => _AuthenticatorCertificateRequired(challenge: challenge),
243+
builder: (context) =>
244+
_AuthenticatorCertificateRequired(challenge: challenge),
247245
);
248246

249247
if (browse == null || !browse) {
@@ -271,11 +269,8 @@ class _AuthenticatorState extends State<Authenticator>
271269
// will answer the challenge.
272270
await showDialog(
273271
context: context,
274-
builder:
275-
(context) => _AuthenticatorCertificatePassword(
276-
challenge: challenge,
277-
file: file,
278-
),
272+
builder: (context) =>
273+
_AuthenticatorCertificatePassword(challenge: challenge, file: file),
279274
);
280275
}
281276
}

lib/src/compass/compass_needle_painter.dart

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ class _CompassNeedlePainter extends CustomPainter {
2424
/// The angle (in radians) at which the needle is rotated.
2525
final double angleRadians;
2626

27-
static final _bronzePaint =
28-
Paint()..color = const Color.fromARGB(255, 241, 169, 59);
27+
static final _bronzePaint = Paint()
28+
..color = const Color.fromARGB(255, 241, 169, 59);
2929

30-
static final _darkGreyPaint =
31-
Paint()..color = const Color.fromARGB(255, 128, 128, 128);
30+
static final _darkGreyPaint = Paint()
31+
..color = const Color.fromARGB(255, 128, 128, 128);
3232

33-
static final _darkRedPaint =
34-
Paint()..color = const Color.fromARGB(255, 124, 22, 13);
33+
static final _darkRedPaint = Paint()
34+
..color = const Color.fromARGB(255, 124, 22, 13);
3535

36-
static final _lightGreyPaint =
37-
Paint()..color = const Color.fromARGB(255, 169, 168, 168);
36+
static final _lightGreyPaint = Paint()
37+
..color = const Color.fromARGB(255, 169, 168, 168);
3838

39-
static final _lightRedPaint =
40-
Paint()..color = const Color.fromARGB(255, 233, 51, 35);
39+
static final _lightRedPaint = Paint()
40+
..color = const Color.fromARGB(255, 233, 51, 35);
4141

4242
@override
4343
void paint(Canvas canvas, Size size) {
@@ -59,12 +59,12 @@ class _CompassNeedlePainter extends CustomPainter {
5959
canvas.save();
6060

6161
// One quadrant of the needle.
62-
final path =
63-
Path()..addPolygon([
64-
Offset.zero,
65-
const Offset(-0.5, 0),
66-
const Offset(0, -0.5),
67-
], true);
62+
final path = Path()
63+
..addPolygon([
64+
Offset.zero,
65+
const Offset(-0.5, 0),
66+
const Offset(0, -0.5),
67+
], true);
6868

6969
// Squeeze the quadrants to 1/3 of the width.
7070
canvas.scale(1 / 3, 1);

lib/src/popups/attachments_popup_element_view.dart

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ class _AttachmentsPopupElementViewState
9898
tilePadding: const EdgeInsets.symmetric(horizontal: 10),
9999
childrenPadding: const EdgeInsets.all(10),
100100
title: _PopupElementHeader(
101-
title:
102-
widget.attachmentsElement.title.isEmpty
103-
? 'Attachments'
104-
: widget.attachmentsElement.title,
101+
title: widget.attachmentsElement.title.isEmpty
102+
? 'Attachments'
103+
: widget.attachmentsElement.title,
105104
description: widget.attachmentsElement.description,
106105
),
107106
initiallyExpanded: isExpanded,
@@ -112,15 +111,12 @@ class _AttachmentsPopupElementViewState
112111
children: [
113112
SizedBox(
114113
height: 200,
115-
child:
116-
widget.attachmentsElement.attachments.isEmpty
117-
? const Center(
118-
child: Text('No attachments available'),
119-
)
120-
: widget.attachmentsElement.displayType ==
121-
PopupAttachmentsDisplayType.preview
122-
? _buildGridView()
123-
: _buildListView(),
114+
child: widget.attachmentsElement.attachments.isEmpty
115+
? const Center(child: Text('No attachments available'))
116+
: widget.attachmentsElement.displayType ==
117+
PopupAttachmentsDisplayType.preview
118+
? _buildGridView()
119+
: _buildListView(),
124120
),
125121
],
126122
),
@@ -218,8 +214,8 @@ class _PopupAttachmentViewInGalleryState
218214
if (attachment.contentType.startsWith('image') && mounted) {
219215
await showDialog(
220216
context: context,
221-
builder:
222-
(context) => _DetailsScreenImageDialog(filePath: filePath!),
217+
builder: (context) =>
218+
_DetailsScreenImageDialog(filePath: filePath!),
223219
);
224220
} else {
225221
await OpenFile.open(filePath, type: attachment.contentType);
@@ -333,10 +329,9 @@ class _PopupAttachmentViewInListState
333329
context,
334330
).textTheme.labelSmall?.copyWith(color: Colors.grey),
335331
),
336-
trailing:
337-
filePath == null
338-
? (downloadFuture == null
339-
? IconButton(
332+
trailing: filePath == null
333+
? (downloadFuture == null
334+
? IconButton(
340335
icon: Icon(
341336
Icons.download,
342337
color: Theme.of(context).colorScheme.primary,
@@ -347,7 +342,7 @@ class _PopupAttachmentViewInListState
347342
});
348343
},
349344
)
350-
: FutureBuilder<void>(
345+
: FutureBuilder<void>(
351346
future: downloadFuture,
352347
builder: (context, snapshot) {
353348
if (snapshot.connectionState == ConnectionState.waiting) {
@@ -373,7 +368,7 @@ class _PopupAttachmentViewInListState
373368
}
374369
},
375370
))
376-
: const Icon(Icons.check, color: Colors.green),
371+
: const Icon(Icons.check, color: Colors.green),
377372
onTap: () {
378373
if (filePath == null) {
379374
if (downloadFuture == null) {
@@ -385,8 +380,8 @@ class _PopupAttachmentViewInListState
385380
if (widget.popupAttachment.contentType.startsWith('image')) {
386381
showDialog(
387382
context: context,
388-
builder:
389-
(context) => _DetailsScreenImageDialog(filePath: filePath!),
383+
builder: (context) =>
384+
_DetailsScreenImageDialog(filePath: filePath!),
390385
);
391386
} else {
392387
OpenFile.open(filePath, type: widget.popupAttachment.contentType);

lib/src/popups/fields_popup_element_view.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,9 @@ class _FieldsPopupElementViewState extends State<_FieldsPopupElementView> {
6868
),
6969
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
7070
title: _PopupElementHeader(
71-
title:
72-
widget.fieldsElement.title.isEmpty
73-
? 'Fields'
74-
: widget.fieldsElement.title,
71+
title: widget.fieldsElement.title.isEmpty
72+
? 'Fields'
73+
: widget.fieldsElement.title,
7574
description: widget.fieldsElement.description,
7675
),
7776
initiallyExpanded: isExpanded,
@@ -86,12 +85,11 @@ class _FieldsPopupElementViewState extends State<_FieldsPopupElementView> {
8685
shrinkWrap: true,
8786
physics: const NeverScrollableScrollPhysics(),
8887
itemCount: widget.fieldsElement.labels.length,
89-
separatorBuilder:
90-
(context, index) => Divider(
91-
color: Theme.of(context).dividerTheme.color ?? Colors.grey,
92-
height: 5,
93-
thickness: Theme.of(context).dividerTheme.thickness ?? 1,
94-
),
88+
separatorBuilder: (context, index) => Divider(
89+
color: Theme.of(context).dividerTheme.color ?? Colors.grey,
90+
height: 5,
91+
thickness: Theme.of(context).dividerTheme.thickness ?? 1,
92+
),
9593
itemBuilder: (context, index) {
9694
return _FieldRow(
9795
field: _DisplayField(

lib/src/popups/media_popup_element_view.dart

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,9 @@ class _MediaPopupElementViewState extends State<_MediaPopupElementView> {
7070
borderRadius: BorderRadius.circular(8),
7171
),
7272
title: _PopupElementHeader(
73-
title:
74-
widget.mediaElement.title.isEmpty
75-
? 'Media'
76-
: widget.mediaElement.title,
73+
title: widget.mediaElement.title.isEmpty
74+
? 'Media'
75+
: widget.mediaElement.title,
7776
description: widget.mediaElement.description,
7877
),
7978
initiallyExpanded: isExpanded,
@@ -126,16 +125,15 @@ class _PopupMediaView extends StatelessWidget {
126125
return SizedBox(
127126
height: mediaSize.height,
128127
// Display either a list of media elements or a single media element.
129-
child:
130-
(popupMedia.length > 1)
131-
? _buildMediaListWidgets(mediaSize)
132-
: Container(
133-
decoration: BoxDecoration(
134-
borderRadius: BorderRadius.circular(8),
135-
color: const Color.fromARGB(255, 255, 252, 252),
136-
),
137-
child: _buildMediaWidget(popupMedia.first, mediaSize),
128+
child: (popupMedia.length > 1)
129+
? _buildMediaListWidgets(mediaSize)
130+
: Container(
131+
decoration: BoxDecoration(
132+
borderRadius: BorderRadius.circular(8),
133+
color: const Color.fromARGB(255, 255, 252, 252),
138134
),
135+
child: _buildMediaWidget(popupMedia.first, mediaSize),
136+
),
139137
);
140138
}
141139

0 commit comments

Comments
 (0)