Skip to content

Commit

Permalink
Patch HTML widgets package generator
Browse files Browse the repository at this point in the history
  • Loading branch information
hamsbrar committed Aug 25, 2022
1 parent a7af02a commit df87d68
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tool/pkg-gen-html-widgets/assets/pubspec.yaml
Expand Up @@ -15,7 +15,7 @@ platforms:

dependencies:
meta: ^1.8.0
rad: '>=1.0.1 <2.0.0'
rad: '>=1.2.0 <2.0.0'

dev_dependencies:
build: ^2.3.0
Expand Down
11 changes: 11 additions & 0 deletions tool/pkg-gen-html-widgets/gen.py
Expand Up @@ -418,6 +418,17 @@ def apply_commons(file_name, contents):
'''

# =======================================================================
# patch (1) | Can be removed when NullableElementCallback is available.

if 'NullableElementCallback?' in contents:
contents = contents.replace('NullableElementCallback?', 'void Function(Element? element)?')

if "import 'dart:html';" not in contents:
contents = contents.replace("import 'package:rad/rad.dart';", "import 'dart:html';import 'package:rad/rad.dart';")

# =======================================================================

return contents

# =======================================================================
Expand Down

0 comments on commit df87d68

Please sign in to comment.