Skip to content

Commit 086c81b

Browse files
committed
fix: fix lint issues.
1 parent 14584af commit 086c81b

File tree

82 files changed

+521
-529
lines changed

Some content is hidden

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

82 files changed

+521
-529
lines changed

webf/example/lib/custom_elements/extended_nested_scroll_view_part.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ class _ExtendedNestedScrollCoordinator extends _NestedScrollCoordinator {
137137
final RenderViewport? parent = findParentRenderViewport(renderObject);
138138
if (parent != null && parent.axis == axis) {
139139
for (final RenderSliver childrenInPaint
140+
// ignore: invalid_use_of_protected_member
140141
in parent.childrenInHitTestOrder) {
141142
return childIsVisible(childrenInPaint, renderObject) &&
142143
renderObjectIsVisible(parent, axis);

webf/example/lib/custom_elements/search.dart

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ class FlutterSearchState extends WebFWidgetElementState {
4040
@override
4141
Widget build(BuildContext context) {
4242
final renderStyle = widgetElement.renderStyle;
43-
return Container(
44-
child: TextField(
43+
return TextField(
4544
maxLines: 1,
4645
controller: _controller,
4746
decoration: InputDecoration(
@@ -85,7 +84,6 @@ class FlutterSearchState extends WebFWidgetElementState {
8584
style: TextStyle(
8685
overflow: TextOverflow.visible,
8786
fontSize: renderStyle.fontSize.computedValue), // Handles text overflow gracefully
88-
),
89-
);
87+
);
9088
}
9189
}

webf/example/lib/flutter_interaction_handler.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,12 @@ class FlutterInteractionHandler {
404404

405405
// Get the WebF controller for react_use_cases
406406
WebFController? controller = await WebFControllerManager.instance.getController('react_use_cases');
407+
if (!context.mounted) {
408+
return {
409+
'success': false,
410+
'error': 'Context is no longer mounted for theme switching',
411+
};
412+
}
407413

408414
// Toggle theme using AdaptiveTheme
409415
if (targetTheme == 'dark') {

webf/example/lib/main.dart

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -331,16 +331,16 @@ class MyAppState extends State<MyApp> {
331331
print('Set page to react_use_cases with route: $targetRoute');
332332

333333
// Use a delayed navigation to ensure the Navigator is ready
334-
Future.delayed(Duration(milliseconds: 100), () async {
335-
final context = navigatorKey.currentContext;
336-
if (context != null && mounted) {
337-
Navigator.push(context, MaterialPageRoute(builder: (context) {
338-
return WebFDemo(
339-
webfPageName: 'react_use_cases',
340-
initialRoute: targetRoute,
341-
);
342-
}));
343-
}
334+
Future.delayed(Duration(milliseconds: 100), () {
335+
if (!mounted) return;
336+
final navigator = navigatorKey.currentState;
337+
if (navigator == null) return;
338+
navigator.push(MaterialPageRoute(builder: (_) {
339+
return WebFDemo(
340+
webfPageName: 'react_use_cases',
341+
initialRoute: targetRoute,
342+
);
343+
}));
344344
});
345345
}
346346
}
@@ -659,7 +659,7 @@ class WebFDemo extends StatefulWidget {
659659
const WebFDemo({super.key, required this.webfPageName, this.initialRoute = '/', this.initialState});
660660

661661
@override
662-
_WebFDemoState createState() => _WebFDemoState();
662+
State<WebFDemo> createState() => _WebFDemoState();
663663
}
664664

665665
class _WebFDemoState extends State<WebFDemo> {

webf/example/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ dependencies:
3939
shared_preferences: ^2.5.3
4040
visibility_detector: ^0.4.0+2
4141
cronet_http: ^1.5.0
42+
dio: ^5.4.0
4243

4344
# When depending on this package from a real application,
4445
# you should remove the following overrides.

webf/lib/src/bridge/binding_object.dart

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ mixin StaticDefinedBindingObject<T> on BindingObject<T> {
184184

185185
abstract class DynamicBindingObject<T> extends BindingObject<T> {
186186
DynamicBindingObject([super.context]) {
187-
initializeProperties(_dynamicProperties);
188-
initializeMethods(_dynamicMethods);
187+
initializeDynamicProperties(_dynamicProperties);
188+
initializeDynamicMethods(_dynamicMethods);
189189
}
190190

191191
final Map<String, BindingObjectProperty> _dynamicProperties = {};
@@ -196,6 +196,18 @@ abstract class DynamicBindingObject<T> extends BindingObject<T> {
196196

197197
Map<String, BindingObjectMethod> get dynamicMethods => _dynamicMethods;
198198

199+
@mustCallSuper
200+
void initializeDynamicProperties(Map<String, BindingObjectProperty> properties) {
201+
// ignore: deprecated_member_use_from_same_package
202+
initializeProperties(properties);
203+
}
204+
205+
@mustCallSuper
206+
void initializeDynamicMethods(Map<String, BindingObjectMethod> methods) {
207+
// ignore: deprecated_member_use_from_same_package
208+
initializeMethods(methods);
209+
}
210+
199211
@Deprecated(
200212
'''
201213
Migrate to use property defined map instead as follows.

0 commit comments

Comments
 (0)