@@ -11,6 +11,7 @@ import 'hive_executor.dart' as hive;
11
11
import 'isar_sync_executor.dart' as isar_sync;
12
12
import 'obx_executor.dart' as obx;
13
13
import 'sqf_executor.dart' as sqf;
14
+
14
15
// import 'hive_lazy_executor.dart' as hive_lazy;
15
16
import 'time_tracker.dart' ;
16
17
@@ -183,7 +184,7 @@ class _MyHomePageState extends State<MyHomePage> {
183
184
184
185
Future <void > printResult (String value) async {
185
186
setState (() => _result = value);
186
- await Future .delayed (Duration (seconds: 0 )); // yield to re-render
187
+ await Future .delayed (const Duration (seconds: 0 )); // yield to re-render
187
188
}
188
189
189
190
/// Waits for the given future to complete. Returns true if the benchmark
@@ -421,13 +422,13 @@ class _MyHomePageState extends State<MyHomePage> {
421
422
mainAxisAlignment: MainAxisAlignment .center,
422
423
children: [
423
424
Row (children: [
424
- Spacer (),
425
+ const Spacer (),
425
426
DropdownButton (
426
427
value: _db,
427
428
items: enumDropDownItems (DbEngine .values),
428
429
onChanged: (DbEngine ? value) =>
429
430
configure (value! , _mode, _indexed)),
430
- Spacer (),
431
+ const Spacer (),
431
432
DropdownButton (
432
433
value: _mode,
433
434
// TODO items: enumDropDownItems(Mode.values),
@@ -444,71 +445,70 @@ class _MyHomePageState extends State<MyHomePage> {
444
445
(mode != Mode .Queries && mode != Mode .QueryById ))
445
446
.toList ()),
446
447
onChanged: (Mode ? value) => configure (_db, value! , _indexed)),
447
- Spacer (),
448
- Text ('Index' ),
448
+ const Spacer (),
449
+ const Text ('Index' ),
449
450
if (_db == DbEngine .Hive )
450
- Text (' not available' )
451
+ const Text (' not available' )
451
452
else
452
453
Switch (
453
454
value: _indexed,
454
455
onChanged: (bool value) => configure (_db, _mode, value),
455
456
activeTrackColor: Colors .yellow,
456
457
activeColor: Colors .orangeAccent,
457
458
),
458
- Spacer (),
459
+ const Spacer (),
459
460
]),
460
461
Row (children: [
461
- Spacer (),
462
+ const Spacer (),
462
463
Expanded (
463
464
child: TextField (
464
465
keyboardType: TextInputType .number,
465
466
controller: _runsController,
466
- decoration: InputDecoration (
467
+ decoration: const InputDecoration (
467
468
labelText: 'Runs' ,
468
469
),
469
470
)),
470
- if (_mode == Mode .Queries ) Spacer (),
471
+ if (_mode == Mode .Queries ) const Spacer (),
471
472
if (_mode == Mode .Queries )
472
473
Expanded (
473
474
child: TextField (
474
475
keyboardType: TextInputType .number,
475
476
controller: _operationsController,
476
- decoration: InputDecoration (
477
+ decoration: const InputDecoration (
477
478
labelText: 'Operations' ,
478
479
),
479
480
)),
480
- if (_mode == Mode .QueryById ) Spacer (),
481
+ if (_mode == Mode .QueryById ) const Spacer (),
481
482
if (_mode == Mode .QueryById )
482
483
Expanded (
483
484
child: TextField (
484
485
keyboardType: TextInputType .number,
485
486
controller: _resultsController,
486
- decoration: InputDecoration (
487
+ decoration: const InputDecoration (
487
488
labelText: 'Results' ,
488
489
),
489
490
)),
490
- Spacer (),
491
+ const Spacer (),
491
492
Expanded (
492
493
child: TextField (
493
494
keyboardType: TextInputType .number,
494
495
controller: _objectsController,
495
- decoration: InputDecoration (
496
+ decoration: const InputDecoration (
496
497
labelText: 'Objects' ,
497
498
),
498
499
)),
499
- Spacer (),
500
+ const Spacer (),
500
501
]),
501
- Spacer (),
502
+ const Spacer (),
502
503
Text (_result),
503
- Spacer (),
504
+ const Spacer (),
504
505
Container (
505
- padding: EdgeInsets .symmetric (horizontal: 30 ),
506
+ padding: const EdgeInsets .symmetric (horizontal: 30 ),
506
507
child: Table (
507
- border: TableBorder (
508
- horizontalInside:
509
- BorderSide (color: const Color (0x55000000 ))),
508
+ border: const TableBorder (
509
+ horizontalInside: BorderSide (color: Color (0x55000000 ))),
510
510
children: _resultRows)),
511
- Spacer (),
511
+ const Spacer (),
512
512
],
513
513
)),
514
514
),
@@ -518,12 +518,12 @@ class _MyHomePageState extends State<MyHomePage> {
518
518
? FloatingActionButton (
519
519
onPressed: _stopBenchmark,
520
520
tooltip: 'Stop' ,
521
- child: Icon (Icons .stop),
521
+ child: const Icon (Icons .stop),
522
522
)
523
523
: FloatingActionButton (
524
524
onPressed: _runBenchmark,
525
525
tooltip: 'Start' ,
526
- child: Icon (Icons .play_arrow),
526
+ child: const Icon (Icons .play_arrow),
527
527
), // This trailing comma makes auto-formatting nicer for build methods.
528
528
);
529
529
}
0 commit comments