Skip to content

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

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: [],
);

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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