Skip to content

Commit 29b6274

Browse files
committed
Firebase dynamic environment #4
- Provide BuildContext in CodelesslyFunction.
1 parent 0d0b1cb commit 29b6274

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lib/src/functions/functions.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
import 'package:flutter/widgets.dart';
2+
13
import '../../codelessly_sdk.dart';
24

35
// typedef CodelesslyCallback<T> = T Function(CodelesslyContext reference);
46

57
class CodelesslyFunction<T> {
6-
final T Function(CodelesslyContext reference) call;
8+
final T Function(BuildContext context, CodelesslyContext reference) call;
79

810
CodelesslyFunction(this.call);
911
}

lib/src/functions/functions_repository.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,6 @@ class FunctionsRepository {
612612
context.read<CodelesslyContext>();
613613
final CodelesslyFunction? function =
614614
codelesslyContext.functions[action.name];
615-
function?.call(codelesslyContext);
615+
function?.call(context, codelesslyContext);
616616
}
617617
}

0 commit comments

Comments
 (0)