time_range_selector_widget 2.0.2 copy "time_range_selector_widget: ^2.0.2" to clipboard
time_range_selector_widget: ^2.0.2 copied to clipboard

Quickly select the hourly time range by dragging the circular bar.

Time Range Selector Widget #

Easily select a time range.

NOTE #

Now Material 3 theme is enabled.

Getting Started #

To use the TimeRangeSelectorWidget widget in your project, follow these steps:

  1. Add the following code to your project:

    TimeRangeSelectorWidget(
        onChangeValue: (currentTime) {
            // TODO: Add your callback function here
        },
        childBuilder: (currentTime) {
            // TODO: Add your widget here
            return Center(
                child: Column(
                    mainAxisSize: MainAxisSize.min,
                    children: [
                        Text(currentTime.toString(), style: const TextStyle(fontSize: 70, fontWeight: FontWeight.bold, height: 1)),
                        Text(currentTime > 1 ? "Hours" : "Hour", style: const TextStyle(fontSize: 20, fontWeight: FontWeight.normal)),
                    ],
                ),
            );
        },
    )
    

Example #

Example

Handler Builder #

handleBuilder: (itemIndex, offset) {
    return Container(
        width: stockWidth - 8,
        height: stockWidth - 8,
        padding: const EdgeInsets(8),
        decoration: const BoxDecoration(
            color: Colors.white,
            shape: BoxShape circle,
        ),
        child: FittedBox(child: Text((itemIndex + minTime).toString(), style: Theme.of(context).textTheme.headlineSmall?.copyWith(fontWeight: FontWeight.bold))),
    );
}

Example - Handler Builder #

Example - Handler Builder

Index Builder #

positionalDotBuilder: (itemIndex, offset) {
    return FittedBox(child: Text((itemIndex + minTime).toString()));
}

Example - Index Builder

Example - Index Builder #

Child Builder for Hour #

childBuilder: (currentTime) {
    return Container(
        decoration: BoxDecoration(
            gradient: LinearGradient(
                colors: [
                    Colors.black.withOpacity(0.05),
                    Colors.black.withOpacity(0.1)
                ],
            ),
        ),
        child: Center(
            child: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                    Text(currentTime.toString(), style: const TextStyle(fontSize: 70, fontWeight: FontWeight.bold, height: 1)),
                    Text(currentTime > 1 ? "Hours" : "Hour", style: const TextStyle(fontSize: 20, fontWeight: FontWeight.normal)),
                ],
            ),
        ),
    );
}

Example - Child Builder for Hour

Example - Child Builder for Hour #

Child Builder for Minute #

childBuilder: (currentTime) {
    return Container(
        decoration: BoxDecoration(
            gradient: LinearGradient(
                colors: [
                    Colors.black.withOpacity(0.05),
                    Colors black.withOpacity(0.1)
                ],
            ),
        ),
        child: Center(
            child: Column(
                mainAxisSize: MainAxisSize.min,
                children: [
                    Text((currentTime * 5).toString(), style: const TextStyle(fontSize: 70, fontWeight: FontWeight.bold, height: 1)),
                    Text(currentTime > 0 ? "Minutes" : "Minute", style: const TextStyle(fontSize: 20, fontWeight: FontWeight.normal)),
                ],
            ),
        ),
    );
}

Example - Child Builder for Minute

Example - Child Builder for Minute #

Easily Customizable #

Easily Customizable

6
likes
160
pub points
70%
popularity
screenshot

Publisher

unverified uploader

Quickly select the hourly time range by dragging the circular bar.

Repository (GitHub)
View/report issues

Topics

#time-range #time #time-selector

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_inset_box_shadow

More

Packages that depend on time_range_selector_widget