Skip to content

Commit

Permalink
got rid of last Dart analyzer warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
dave-doty committed Sep 13, 2024
1 parent daab310 commit ece74bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions lib/src/constants.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:html';

import 'package:color/color.dart';
import 'package:over_react/components.dart';
import 'package:platform_detect/platform_detect.dart';

import 'state/geometry.dart';
Expand Down Expand Up @@ -68,6 +69,15 @@ Try loading an example by selecting <em>File&rarr;Load example</em>,
or select <em>File&rarr;Open</em> to load a .sc file from your local drive.
You can also drag and drop a .sc file from your file system to the browser.</p>''';

//FIXME: OverReact's defaultErrorBoundaryLoggerName is 'over_react.ErrorBoundary' as of version 5.3.0,
// but if we access it directly, we get a warning
// "info: The member 'defaultErrorBoundaryLoggerName' can only be used within
// 'package:over_react/src/component/error_boundary_api.dart' or a test."
// So to avoid the warning, we hard-code the name. Honestly I don't even really know what an
// ErrorBoundary logger is, so I'm not sure if this is the right thing to do.
// const default_error_boundary_logger_name = defaultErrorBoundaryLoggerName;
const default_error_boundary_logger_name = 'over_react.ErrorBoundary';

const OXVIEW_URL = 'https://sulcgroup.github.io/oxdna-viewer/';

// https://www.w3schools.com/jsref/event_button.asp
Expand Down
4 changes: 2 additions & 2 deletions lib/src/view/design_main_error_boundary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class DesignMainErrorBoundaryComponent<T extends DesignMainErrorBoundaryProps,
@override
get defaultProps => (newProps()
..identicalErrorFrequencyTolerance = Duration(seconds: 5)
..loggerName = defaultErrorBoundaryLoggerName
..loggerName = constants.default_error_boundary_logger_name
..shouldLogErrors = true);

@override
Expand Down Expand Up @@ -100,7 +100,7 @@ class DesignMainErrorBoundaryComponent<T extends DesignMainErrorBoundaryProps,
String get _loggerName {
if (props.logger != null) return props.logger!.name;

return props.loggerName ?? defaultErrorBoundaryLoggerName;
return props.loggerName ?? constants.default_error_boundary_logger_name;
}

void _logErrorCaughtByErrorBoundary(/*Error|Exception*/ dynamic error, ReactErrorInfo info) {
Expand Down

0 comments on commit ece74bc

Please sign in to comment.