flutter_onboard 2.0.0 copy "flutter_onboard: ^2.0.0" to clipboard
flutter_onboard: ^2.0.0 copied to clipboard

A simple, elegant and easy to use onboard widget for both android and ios devices(Null-Safety).

[2.0.0] #

dependencies updated.

[2.0.0-dev.1] #

BreakingChange:

  • OnBorad widget no longer depend on Provider package to get the onboard state for custom UI.

previously

    Provider<OnBoardState>( // changes
      create: (_) => OnBoardState(),
      child: Scaffold(
        body: OnBoard(
          pageController: _pageController,
          // Either Provide onSkip Callback or skipButton Widget to handle skip state
          onSkip: () {
            // print('skipped');
          },
          // Either Provide onDone Callback or nextButton Widget to handle done state
          onDone: () {
            // print('done tapped');
          },
          onBoardData: onBoardData,
          titleStyles: const TextStyle(
            color: Colors.deepOrange,
            fontSize: 18,
            fontWeight: FontWeight.w900,
            letterSpacing: 0.15,
          ),
          descriptionStyles: TextStyle(
            fontSize: 16,
            color: Colors.brown.shade300,
          ),
          pageIndicatorStyle: const PageIndicatorStyle(
            width: 100,
            inactiveColor: Colors.deepOrangeAccent,
            activeColor: Colors.deepOrange,
            inactiveSize: Size(8, 8),
            activeSize: Size(12, 12),
          ),
          // Either Provide onSkip Callback or skipButton Widget to handle skip state
          skipButton: TextButton(
            onPressed: () {
              // print('skipped');
            },
            child: const Text(
              "Skip",
              style: TextStyle(color: Colors.deepOrangeAccent),
            ),
          ),
          // Either Provide onDone Callback or nextButton Widget to handle done state
          nextButton: Consumer<OnBoardState>( // Changes
            builder: (BuildContext context, OnBoardState state, Widget? child) {
              return InkWell(
                onTap: () => _onNextTap(state),
                child: Container(
                  width: 230,
                  height: 50,
                  alignment: Alignment.center,
                  decoration: BoxDecoration(
                    borderRadius: BorderRadius.circular(30),
                    gradient: const LinearGradient(
                      colors: [Colors.redAccent, Colors.deepOrangeAccent],
                    ),
                  ),
                  child: Text(
                    state.isLastPage ? "Done" : "Next",
                    style: const TextStyle(
                      color: Colors.white,
                      fontWeight: FontWeight.bold,
                    ),
                  ),
                ),
              );
            },
          ),
        ),
      ),
    );

Now

    OnBoard(
        pageController: _pageController,
        // Either Provide onSkip Callback or skipButton Widget to handle skip state
        onSkip: () {
          // print('skipped');
        },
        // Either Provide onDone Callback or nextButton Widget to handle done state
        onDone: () {
          // print('done tapped');
        },
        onBoardData: onBoardData,
        titleStyles: const TextStyle(
          color: Colors.deepOrange,
          fontSize: 18,
          fontWeight: FontWeight.w900,
          letterSpacing: 0.15,
        ),
        descriptionStyles: TextStyle(
          fontSize: 16,
          color: Colors.brown.shade300,
        ),
        pageIndicatorStyle: const PageIndicatorStyle(
          width: 100,
          inactiveColor: Colors.deepOrangeAccent,
          activeColor: Colors.deepOrange,
          inactiveSize: Size(8, 8),
          activeSize: Size(12, 12),
        ),
        // Either Provide onSkip Callback or skipButton Widget to handle skip state
        skipButton: TextButton(
          onPressed: () {
            // print('skipButton pressed');
          },
          child: const Text(
            "Skip",
            style: TextStyle(color: Colors.deepOrangeAccent),
          ),
        ),
        // Either Provide onDone Callback or nextButton Widget to handle done state
        nextButton: OnBoardConsumer( // import OnBoardConsumer from flutter_onboard
          builder: (context, ref, child) {
            final state = ref.watch(onBoardStateProvider); // import onBoardStateProvider from flutter_onboard and use ref.watch to listen for onboard state changes
            return InkWell(
              onTap: () => _onNextTap(state),
              child: Container(
                width: 230,
                height: 50,
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  borderRadius: BorderRadius.circular(30),
                  gradient: const LinearGradient(
                    colors: [Colors.redAccent, Colors.deepOrangeAccent],
                  ),
                ),
                child: Text(
                  state.isLastPage ? "Done" : "Next",
                  style: const TextStyle(
                    color: Colors.white,
                    fontWeight: FontWeight.bold,
                  ),
                ),
              ),
            );
          },
        ),
    ),

[1.0.4] #

  • provider package updated to v6.0.0

[1.0.3] #

  • Docs updated.

[1.0.2] #

  • Overflow issue fixed for smaller devices.

[1.0.1] #

  • onSkip callback is now not a required field but either "onSkip callback" or "skipButton" needs to be provided to OnBoard widget, else it will throw exception.
  • onDone callback is now not a required field but either "onDone callback" or "nextButton" needs to be provided to OnBoard widget, else it will throw exception.

[1.0.0] #

  • Migrated to Null-Safety
  • Linting added

[0.1.0] #

  • Updated to latest version of provider package

[0.0.3+1] #

  • Minor Enhancement

[0.0.3] #

  • Custom styles for page indicator using pageIndicatorStyle

[0.0.2+1] #

  • Bug fix and Enhancement

[0.0.2] #

  • Accessing OnBoardState using GlobalKey has been removed
  • OnBoard widget is now StatelessWidget
  • OnBoardState implemented using provider package

[0.0.1] #

  • Initial release
137
likes
110
pub points
89%
popularity

Publisher

verified publishermohanasundaram.in

A simple, elegant and easy to use onboard widget for both android and ios devices(Null-Safety).

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, flutter_hooks, freezed_annotation, hooks_riverpod

More

Packages that depend on flutter_onboard