flutter_deck icon indicating copy to clipboard operation
flutter_deck copied to clipboard

fix: Some things aren't exported from the `flutter_deck` package

Open matthew-carroll opened this issue 5 months ago • 0 comments

I'm trying to create a custom slide. To start this process, I copied the build() method from FlutterDeckBigFactSlide expecting to modify it to meet my needs.

However, it appears that a number of classes referenced in that build() method aren't exported from flutter_deck, preventing me from even compiling a direct copy of the code.

Here's the code that I copied:

@override
  Widget build(BuildContext context) {
    final theme = FlutterDeckBigFactSlideTheme.of(context);
    final FlutterDeckSlideConfiguration(
      footer: footerConfiguration,
      header: headerConfiguration,
    ) = context.flutterDeck.configuration;

    return FlutterDeckSlideBase(
      backgroundBuilder: backgroundBuilder,
      contentBuilder: (context) => Padding(
        padding: FlutterDeckLayout.slidePadding * 4,
        child: Center(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              Flexible(
                child: AutoSizeText(
                  title,
                  style: theme.titleTextStyle,
                  textAlign: TextAlign.center,
                  maxLines: 1,
                ),
              ),
              if (subtitle != null) ...[
                const SizedBox(height: 16),
                Flexible(
                  child: AutoSizeText(
                    subtitle!,
                    style: theme.subtitleTextStyle,
                    textAlign: TextAlign.center,
                    maxLines: subtitleMaxLines,
                  ),
                ),
              ],
            ],
          ),
        ),
      ),
      footerBuilder: footerConfiguration.showFooter ? _buildFooter : null,
      headerBuilder: headerConfiguration.showHeader ? _buildHeader : null,
    );
  }

The artifacts that I can't seem to import include: FlutterDeckSlideBase, FlutterDeckLayout, AutoSizeText. There may be more.

I would suggest a heuristic that says "export everything, unless there's a strong reason to hide something".

matthew-carroll avatar Sep 17 '24 03:09 matthew-carroll