demoflu 1.2.0 copy "demoflu: ^1.2.0" to clipboard
demoflu: ^1.2.0 copied to clipboard

Package demo builder. Web application to display package widgets usage.

DemoFlu #

Package demo builder. Web application to display package widgets usage.

Tutorial #

main.dart #

Use the DemoFluApp to configure the menu.

import 'package:demoflu/demoflu.dart';
import 'package:flutter/material.dart';
import 'package:tutorial/examples/stateless.dart';

void main() {
  runApp(DemoFluApp(title: 'Tutorial', rootMenus: [_firstExample, _section]));
}

DemoMenuItem get _firstExample =>
    DemoMenuItem('First', example: StatelessExample());

DemoMenuItem get _section =>
    DemoMenuItem('Section', children: [_secondExample]);

DemoMenuItem get _secondExample =>
    DemoMenuItem('Second', example: StatelessExample());

Examples #

Create examples using your package.

import 'package:demoflu/demoflu.dart';
import 'package:flutter/material.dart';

class StatelessExample extends Example {
  StatelessExample()
      : super(
            widget: const MainWidget(),
            codeFile: 'lib/examples/stateless.dart',
            resizable: true);
}

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

  @override
  Widget build(BuildContext context) {
    return Container(
        color: Colors.blue[200], child: const Center(child: Text('Stateless')));
  }
}

pubspec.yaml #

Configure the assets to make the source code available.

  assets:
    - lib/examples/

Build for web #

flutter clean
flutter build web --release

Use --base-href if necessary

Need more? #

See the committed example for more details.

9
likes
0
pub points
0%
popularity

Publisher

verified publishercaduandrade.net

Package demo builder. Web application to display package widgets usage.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flex_color_picker, flutter, flutter_highlight, url_launcher

More

Packages that depend on demoflu