Skip to content

Add package as a dependency to the package created by EvalWidget? #94

@dlabs-matic-leva

Description

@dlabs-matic-leva

When we are using EvalWidget, we are creating new package with libraries, right? Is it possible to add some 3rd party package as dependency and then import a library from included package?

Using example from docs, I'd like to achieve this:

EvalWidget(
  packages: const {
    'example': {
      'main.dart': '''
        import 'package:flutter/material.dart';
        import 'package:url_launcher/url_launcher.dart';
    
        class MyWidget extends StatelessWidget {
          MyWidget();
    
          @override
          Widget build(BuildContext context) {
            return TextButton(
              child: Text('Click me '),
              onPressed: () {
                launchUrl(
                  Uri.parse(
                    "https://google.com",
                  ),
                );
              },
            );
          }
        }
''',
    }
  },
  assetPath: 'assets/program.evc',
  library: 'package:example/main.dart',
  function: 'MyWidget.',
  args: [],
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions