kherel / animated_theme_switcher

Flutter animated theme switcher
https://pub.dev/packages/animated_theme_switcher
MIT License
278 stars 28 forks source link

Github to pub.dev source mismatch - Missing builder parameter (Latest updates not publish to pub.dev) #29

Closed omerasif57 closed 3 years ago

omerasif57 commented 3 years ago

I think, pub dev is not up to date with github source:

with 1.0.9, getting error "parameter builder is not defined"

@override
  Widget build(BuildContext context) {
    return ThemeProvider(
      initTheme: theme,
      builder: (_, theme) {
        return MaterialApp(
          title: 'Flutter Demo',
          theme: theme,
          home: MyHomePage(),
        );
      },
    );
  }
}

Github source:

class ThemeProvider extends StatefulWidget {
  ThemeProvider({
    this.initTheme,
    Key? key,
    this.child,
    this.builder,
    this.duration = const Duration(milliseconds: 300),
  })  : assert(!(child == null && builder == null),
            'You should provide either a child or a builder'),
        super(key: key);

1.0.9 source as seen in vs code:

class ThemeProvider extends StatefulWidget {
  ThemeProvider({
    this.initTheme,
    Key key,
    @required this.child,
    this.duration = const Duration(milliseconds: 300),
  })  : assert(duration != null),
        super(key: key);

  final Widget child;
  final ThemeData initTheme;
  final Duration duration;
omerasif57 commented 3 years ago

Published Nov 12, 2020

kherel commented 3 years ago

Thanks, it was in prerelease. I've mark it as stable.