Skip to content

Commit fd0d6a9

Browse files
committed
Miscellaneous Cleanup 20241110 #1
1 parent 2ab82ef commit fd0d6a9

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

lib/src/functions/functions_repository.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ class FunctionsRepository {
6767
}
6868
DebugLogger.instance.printInfo('Performing action: $action', name: name);
6969

70-
final Codelessly codelessly = context.read<Codelessly>();
7170
switch (action.type) {
7271
case ActionType.loadFromCloudStorage || ActionType.setCloudStorage:
7372
StatTracker.instance.track(StatType.cloudAction, action.type.name);

lib/src/logging/stat_tracker.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ class StatTracker {
2222

2323
/// Whether this tracker should collect and send stats.
2424
/// Defaults to true. Set to false to disable all tracking for this instance.
25-
final bool enabled;
25+
bool enabled = true;
2626

27-
StatTracker._({this.enabled = true});
27+
StatTracker._();
2828

2929
Uri? serverUrl;
3030

@@ -47,9 +47,11 @@ class StatTracker {
4747
void init({
4848
required String projectId,
4949
required Uri serverUrl,
50+
bool enabled = true,
5051
}) {
5152
this.projectId = projectId;
5253
this.serverUrl = serverUrl;
54+
this.enabled = enabled;
5355

5456
// Send a batch if stats were tracked while this wasn't initialized yet.
5557
if (statBatch.isNotEmpty && !disabled) {

lib/src/ui/codelessly_widget.dart

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ import 'package:provider/provider.dart';
66

77
import '../../codelessly_sdk.dart';
88
import '../logging/debug_logger.dart';
9+
import '../logging/error_logger.dart';
910
import '../logging/stat_tracker.dart';
1011
import 'codelessly_error_screen.dart';
1112
import 'codelessly_loading_screen.dart';
1213
import 'layout_builder.dart';
13-
import '../logging/error_logger.dart';
1414

1515
/// Allows wrapping a loaded [Codelessly] layout with any widget for additional
1616
/// control over the rendering.
@@ -236,9 +236,6 @@ class _CodelesslyWidgetState extends State<CodelesslyWidget> {
236236
CodelesslyWidgetController get _effectiveController =>
237237
widget.controller ?? _controller!;
238238

239-
Codelessly get _effectiveCodelessly =>
240-
_effectiveController.effectiveCodelessly;
241-
242239
/// The [CodelesslyContext] that will hold the data and functions that will be
243240
/// used to render the layout.
244241
///

0 commit comments

Comments
 (0)