Skip to content

Commit 5fc74b1

Browse files
authored
Merge pull request #1020 from UC-Davis-molecular-computing/#1019-upgrade-to-Dart-3.7-and-run-dart-format
#1019 upgrade to dart 3.7 and run dart format
2 parents 7f09411 + 207a76d commit 5fc74b1

206 files changed

Lines changed: 11369 additions & 7584 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

lib/src/actions/actions.dart

Lines changed: 408 additions & 273 deletions
Large diffs are not rendered by default.

lib/src/app.dart

Lines changed: 48 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -132,23 +132,41 @@ class App {
132132
// for null-safety we need to make up default values here, but the reducer code
133133
// assumes that the first time the reducer is called it could be null, meaning
134134
// it won't matter what non-null state we assign to initialState
135-
store_selection_rope = Store<SelectionRope?>(optimized_selection_rope_reducer,
136-
initialState: null, middleware: [throttle_middleware]);
137-
138-
store_selection_box = Store<SelectionBox?>(optimized_selection_box_reducer,
139-
initialState: null, middleware: [throttle_middleware]);
140-
141-
store_potential_crossover = Store<PotentialCrossover?>(optimized_potential_crossover_reducer,
142-
initialState: null, middleware: [throttle_middleware]);
143-
144-
store_extensions_move = Store<DNAExtensionsMove?>(optimized_dna_extensions_move_reducer,
145-
initialState: null, middleware: [throttle_middleware]);
146-
147-
store_dna_ends_move = Store<DNAEndsMove?>(optimized_dna_ends_move_reducer,
148-
initialState: null, middleware: [throttle_middleware]);
149-
150-
store_helix_group_move = Store<HelixGroupMove?>(optimized_helix_group_move_reducer,
151-
initialState: null, middleware: [throttle_middleware]);
135+
store_selection_rope = Store<SelectionRope?>(
136+
optimized_selection_rope_reducer,
137+
initialState: null,
138+
middleware: [throttle_middleware],
139+
);
140+
141+
store_selection_box = Store<SelectionBox?>(
142+
optimized_selection_box_reducer,
143+
initialState: null,
144+
middleware: [throttle_middleware],
145+
);
146+
147+
store_potential_crossover = Store<PotentialCrossover?>(
148+
optimized_potential_crossover_reducer,
149+
initialState: null,
150+
middleware: [throttle_middleware],
151+
);
152+
153+
store_extensions_move = Store<DNAExtensionsMove?>(
154+
optimized_dna_extensions_move_reducer,
155+
initialState: null,
156+
middleware: [throttle_middleware],
157+
);
158+
159+
store_dna_ends_move = Store<DNAEndsMove?>(
160+
optimized_dna_ends_move_reducer,
161+
initialState: null,
162+
middleware: [throttle_middleware],
163+
);
164+
165+
store_helix_group_move = Store<HelixGroupMove?>(
166+
optimized_helix_group_move_reducer,
167+
initialState: null,
168+
middleware: [throttle_middleware],
169+
);
152170
}
153171

154172
Future<T> disable_keyboard_shortcuts_while<T>(Future<T> f()) async {
@@ -239,8 +257,9 @@ class App {
239257
// Each time the oxView frame loads, tell it to adjust the camera to be the same angle as the
240258
// main view in scadnano: y down, z right, x out of the screen.
241259
this.view.oxview_view.frame.onLoad.listen((event) {
242-
Blob blob_js_camera_commands =
243-
new Blob(['camera.up.multiplyScalar(-1)'], blob_type_to_string(BlobType.text));
260+
Blob blob_js_camera_commands = new Blob([
261+
'camera.up.multiplyScalar(-1)',
262+
], blob_type_to_string(BlobType.text));
244263
Map<String, dynamic> message = {
245264
'message': 'iframe_drop',
246265
'files': [blob_js_camera_commands],
@@ -256,7 +275,8 @@ class App {
256275

257276
warn_wrong_browser() {
258277
if (!(browser.isChrome || browser.isFirefox) || browser.isEdgeChrome) {
259-
var msg = 'You appear to be using ${browser.name}. '
278+
var msg =
279+
'You appear to be using ${browser.name}. '
260280
'scadnano does not currently support this browser. '
261281
'Please use Chrome, Firefox, or Edge instead.';
262282
window.alert(msg);
@@ -269,14 +289,14 @@ setup_undo_redo_keyboard_listeners() {
269289
// previous solution with onKeyPress used event.code == 'KeyZ' and worked inconsistently
270290
window.onKeyDown.listen((KeyboardEvent event) {
271291
int key = event.which!;
272-
// print('*' * 100);
273-
// print('charCode: ${event.charCode}');
274-
// print(' keyCode: ${event.keyCode}');
275-
// print(' code: ${event.code}');
276-
// print(' key: ${event.key}');
277-
// print(' which: ${event.which}');
278-
// print("Control: ${event.getModifierState('control')}"); // modifiers.control);
279-
// print("KeyCode: ${event.key.codeUnitAt(0)}");
292+
// print('*' * 100);
293+
// print('charCode: ${event.charCode}');
294+
// print(' keyCode: ${event.keyCode}');
295+
// print(' code: ${event.code}');
296+
// print(' key: ${event.key}');
297+
// print(' which: ${event.which}');
298+
// print("Control: ${event.getModifierState('control')}"); // modifiers.control);
299+
// print("KeyCode: ${event.key.codeUnitAt(0)}");
280300

281301
// ctrl+Z to undo
282302
if ((event.ctrlKey || event.metaKey) && !event.shiftKey && key == KeyCode.Z && !event.altKey) {

lib/src/constants.dart

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,8 @@ const design_modifications_5p_key = 'modifications_5p_in_design';
228228
const design_modifications_3p_key = 'modifications_3p_in_design';
229229
const design_modifications_int_key = 'modifications_int_in_design';
230230
const groups_key = 'groups';
231-
final design_keys = [
231+
final design_keys =
232+
[
232233
version_key,
233234
grid_key,
234235
helices_key,
@@ -251,7 +252,8 @@ const bases_per_turn_key = 'bases_per_turn';
251252
const minor_groove_angle_key = 'minor_groove_angle';
252253
const legacy_minor_groove_angle_keys = ['groove_angle'];
253254
const inter_helix_gap_key = 'inter_helix_gap';
254-
final geometry_keys = [
255+
final geometry_keys =
256+
[
255257
rise_per_base_pair_key,
256258
helix_radius_key,
257259
bases_per_turn_key,
@@ -277,7 +279,8 @@ const major_tick_distance_key = 'major_tick_distance';
277279
const major_tick_start_key = 'major_tick_start';
278280
const major_tick_periodic_distances_key = 'major_tick_periodic_distances';
279281
const group_key = 'group';
280-
final helix_keys = [
282+
final helix_keys =
283+
[
281284
idx_on_helix_key,
282285
max_offset_key,
283286
min_offset_key,
@@ -319,7 +322,8 @@ const legacy_substrands_keys = ['substrands'];
319322
const modification_5p_key = '5prime_modification';
320323
const modification_3p_key = '3prime_modification';
321324
const modifications_int_key = 'internal_modifications';
322-
final strand_keys = [
325+
final strand_keys =
326+
[
323327
color_key,
324328
dna_sequence_key,
325329
vendor_fields_key,
@@ -342,7 +346,8 @@ const mod_vendor_code_key = 'vendor_code';
342346
const legacy_mod_vendor_code_keys = ['idt_text'];
343347
const mod_allowed_bases_key = 'allowed_bases';
344348
const mod_connector_length_key = 'connector_length';
345-
final modification_keys = [
349+
final modification_keys =
350+
[
346351
mod_location_key,
347352
mod_display_text_key,
348353
mod_vendor_code_key,
@@ -373,7 +378,8 @@ const start_key = 'start';
373378
const end_key = 'end';
374379
const deletions_key = 'deletions';
375380
const insertions_key = 'insertions';
376-
final domain_keys = [
381+
final domain_keys =
382+
[
377383
helix_idx_key,
378384
forward_key,
379385
start_key,
@@ -388,12 +394,7 @@ final domain_keys = [
388394

389395
// Loopout keys
390396
const loopout_key = 'loopout';
391-
const loopout_keys = [
392-
loopout_key,
393-
label_key,
394-
name_key,
395-
color_key,
396-
];
397+
const loopout_keys = [loopout_key, label_key, name_key, color_key];
397398

398399
// Extension keys
399400
const extension_key = 'extension_num_bases';
@@ -493,5 +494,5 @@ enum strand_bounds_status {
493494
max_offset_out_of_bounds,
494495
in_bounds_with_min_offset_changes,
495496
in_bounds_with_max_offset_changes,
496-
in_bounds
497+
in_bounds,
497498
}

lib/src/dna_sequence_constants.dart

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ class DNASequencePredefined extends EnumClass {
1515
static const DNASequencePredefined Tilibit_CS4 = _$Tilibit_CS4;
1616

1717
//XXX: change this if we change the variants
18-
static BuiltList<String> get display_names => [
18+
static BuiltList<String> get display_names =>
19+
[
1920
'M13 (p7249, standard variant)',
2021
'M13 (p7560)',
2122
'M13 (p8064)',
@@ -41,8 +42,9 @@ class DNASequencePredefined extends EnumClass {
4142

4243
static Serializer<DNASequencePredefined> get serializer => _$dNASequencePredefinedSerializer;
4344

44-
static BuiltList<String> get names => [
45-
for (var dna_sequence_predefined in DNASequencePredefined.values) dna_sequence_predefined.name
45+
static BuiltList<String> get names =>
46+
[
47+
for (var dna_sequence_predefined in DNASequencePredefined.values) dna_sequence_predefined.name,
4648
].toBuiltList();
4749

4850
int get default_rotation => this == M13p7249 ? 5587 : 0;
@@ -183,8 +185,7 @@ CAGACTCTCAGGCAATGACCTGATAGCCTTTGTAGATCTCTCAAAAATAGCTACCCTCTCCGGCATTAATTTATCAGCTA
183185
GATGGTGATTTGACTGTCTCCGGCCTTTCTCACCCTTTTGAATCTTTACCTACACATTACTCAGGCATTGCATTTAAAATATATGAGGGTTCTAAAAATT
184186
TTTATCCTTGCGTTGAAATAAAGGCTTCTCCCGCAAAAGTATTACAGGGTCATAATGTTTTTGGTACAACCGATTTAGCTTTATGCTCTGAGGCTTTATT
185187
GCTTAATTTTGCTAATTCTTTGCCTTGCCTGTATGATTTATTGGATGTT
186-
"""
187-
.replaceAll(RegExp(r'\s'), '');
188+
""".replaceAll(RegExp(r'\s'), '');
188189

189190
final _m13_p7560 = """
190191
AGCTTGGCACTGGCCGTCGTTTTACAACGTCGTGACTGGGAAAACCCTGGCGTTACCCAACTTAATCGCCTTGCAGCACATCCCCCTTTCGCCAGCTGGC
@@ -263,8 +264,7 @@ TTCGAGCTCGGTACCCGGGGATCCTCCGTCTTTATCGAGGTAACAAGCACCACGTAGCTTAAGCCCTGTTTACTCATTAC
263264
TCGGAGAAATGATTTATGTGAAATGCGTCAGCCGATTCAAGGCCCCTATATTCGTGCCCACCGACGAGTTGCTTACAGATGGCAGGGCCGCACTGTCGGT
264265
ATCATAGAGTCACTCCAGGGCGAGCGTAAATAGATTAGAAGCGGGGTTATTTTGGCGGGACATTGTCATAAGGTTGACAATTCAGCACTAAGGACACTTA
265266
AGTCGTGCGCATGAATTCACAACCACTTAGAAGAACATCCACCCTGGCTTCTCCTGAGAA
266-
"""
267-
.replaceAll(RegExp(r'\s'), '');
267+
""".replaceAll(RegExp(r'\s'), '');
268268

269269
final _m13_p8064 = """
270270
GGCAATGACCTGATAGCCTTTGTAGATCTCTCAAAAATAGCTACCCTCTCCGGCATTAATTTATCAGCTAGAACGGTTGAATATCATATTGATGGTGATT
@@ -348,8 +348,7 @@ TGCACGGTTACGATGCGCCCATCTACACCAACGTGACCTATCCCATTACGGTCAATCCGCCGTTTGTTCCCACGGAGAAT
348348
CACATTTAATGTTGATGAAAGCTGGCTACAGGAAGGCCAGACGCGAATTATTTTTGATGGCGTTCCTATTGGTTAAAAAATGAGCTGATTTAACAAAAAT
349349
TTAATGCGAATTTTAACAAAATATTAACGTTTACAATTTAAATATTTGCTTATACAATCTTCCTGTTTTTGGGGCTTTTCTGATTATCAACCGGGGTACA
350350
TATGATTGACATGCTAGTTTTACGATTACCGTTCATCGATTCTCTTGTTTGCTCCAGACTCTCA
351-
"""
352-
.replaceAll(RegExp(r'\s'), '');
351+
""".replaceAll(RegExp(r'\s'), '');
353352

354353
final _m13_p8634 = """
355354
GAGTCCACGTTCTTTAATAGTGGACTCTTGTTCCAAACTGGAACAACACTCAACCCTATCTCGGGCTATTCTTTTGATTTATAAGGGATTTTGCCGATTT
@@ -439,8 +438,7 @@ CGCTCTGATTCTAACGAGGAAAGCACGTTATACGTGCTCGTCAAAGCAACCATAGTACGCGCCCTGTAGCGGCGCATTAA
439438
ACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTCCTTTCGCTTTCTTCCCTTCCTTTCTCGCCACGTTCGCCGGCTTTCCCCGTCAAG
440439
CTCTAAATCGGGGGCTCCCTTTAGGGTTCCGATTTAGTGCTTTACGGCACCTCGACCCCAAAAAACTTGATTTGGGTGATGGTTCACGTAGTGGGCCATC
441440
GCCCTGATAGACGGTTTTTCGCCCTTTGACGTTG
442-
"""
443-
.replaceAll(RegExp(r'\s'), '');
441+
""".replaceAll(RegExp(r'\s'), '');
444442

445443
final _tilibit_cs3_l = """
446444
CATTAAGCGCGGCGGGTGTGGTGGTTACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTCCTTTCGCTTTCTTCCCTTCCTTTCTCGC
@@ -519,8 +517,7 @@ GTCCCACGGCATGGCCAAATGAGTTCTTGAGTAGCAAAAGGTGCACGAGACCCCGGTGCCTAAGATTTTATACGCTTCAT
519517
TTGCTTTCGTGTTAATAATTTCGACGTAACGGTGCTGTCTAACATCGAGACTGCAATTACCCCGCCAGACCTTTGCACTTCCACACTAATTTGGTCGATC
520518
TTTGCTTAACCGGGAACTATGTAGTCTATATGAGAATATTGAGCATAAGGTGTCAGCCAGCCTTTATCCTTGAGGCAGATCAGGTCTATTCGCTCAGAGT
521519
AAGATGCTAACACCCAGTAGATGACGACGTTTAATTAGGGCCGAGAGACCAATGTCACG
522-
"""
523-
.replaceAll(RegExp(r'\s'), '');
520+
""".replaceAll(RegExp(r'\s'), '');
524521

525522
final _tilibit_cs4 = """
526523
CATTGACCGGGAGCGCCCTGTAGCGGCGCATTAAGCGCGGCGGGTGTGGTGGTTACGCGCAGCGTGACCGCTACACTTGCCAGCGCCCTAGCGCCCGCTC
@@ -599,5 +596,4 @@ GCAAAAGCACATAGGGTAATGGATTCGCGTGTAAAGTAGAAATAGAGCGCGCTCCATGAACTTGGATAAGTAATATAGCC
599596
CAGTCGGCTAAACAACGCACCCGCCACGTGCATCGACACAGTGAGCTGTAATCTAGTATTAGGAACTATTGCATTATTGACACTATGGGTCCTCTAACCC
600597
GCGTCCATACCCTGTTCGAGTCGACTTAGCTTGCGCACTCATCCATATTTATGAACCGTACTCGCGACGTGCGATATCAAACTCACAACTCATTACACAC
601598
GACTGGCCCGCGATACCCCCGAGGTAGGCAAAGCGCTCACACTACAGGCTGTTGTCT
602-
"""
603-
.replaceAll(RegExp(r'\s'), '');
599+
""".replaceAll(RegExp(r'\s'), '');

lib/src/json_serializable.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ class SuppressableIndentEncoder {
3535
final JsonEncoder encoder_indent;
3636

3737
SuppressableIndentEncoder(Replacer replacer, {String this.indent = " ", bool this.suppress = true})
38-
: this.replacer = replacer,
39-
this.encoder_indent = JsonEncoder.withIndent(indent, replacer.default_encode);
38+
: this.replacer = replacer,
39+
this.encoder_indent = JsonEncoder.withIndent(indent, replacer.default_encode);
4040

4141
String convert(Object? obj) {
4242
String result = this.encoder_indent.convert(obj);

lib/src/middleware/autostaple_and_autobreak.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ _autobreak(Store<AppState> store, actions.Autobreak action) async {
4141
'maxStapleLen': action.max_length,
4242
'tgtStapleLen': action.target_length,
4343
},
44-
'design': store.state.design.to_json_serializable()
44+
'design': store.state.design.to_json_serializable(),
4545
});
4646
var response = await http.post(
4747
Uri.parse(constants.autobreak_url),

0 commit comments

Comments
 (0)