Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add DevToolsExtension template to devtools_extension package #6066

Merged
merged 7 commits into from
Jul 20, 2023

Conversation

kenzieschmoll
Copy link
Member

Work towards #1632.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about moving template out of lib to example and make it separate package with its own pubspec.yaml?
You will have to create example anyway, because it will be requested by pub.get publishing code.

Copy link
Member Author

@kenzieschmoll kenzieschmoll Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the template isn't an example - it is actually the file an extension author would import to write a devtools extension.

import 'package:devtools_extensions/api.dart';
import 'package:flutter/material.dart';

import 'package:devtools_extensions/template.dart';

void main() {
  runApp(const FooPackageDevToolsExtension());
}

class FooPackageDevToolsExtension extends StatelessWidget {
  const FooPackageDevToolsExtension({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Foo DevTools Extension',
      home: const DevToolsExtension(
        child: FooExtensionHomePage(),
      ),
    );
  }
}

Copy link
Member Author

@kenzieschmoll kenzieschmoll Jul 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed to devtools_extensions.dart to make that more clear

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added an example dir in #6069

@kenzieschmoll kenzieschmoll merged commit 4146bf7 into flutter:master Jul 20, 2023
15 checks passed
@kenzieschmoll kenzieschmoll deleted the dte-template branch July 20, 2023 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants