Skip to content

Commit 1f4c04f

Browse files
committed
Added new field controller, Resolved issue #15 and Enhanced documentation
1 parent 5c866b6 commit 1f4c04f

File tree

18 files changed

+264
-312
lines changed

18 files changed

+264
-312
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.2.2
2+
3+
- Added field `controller`
4+
- Resolved issue [#15](https://github.com/srinivasa-dev/wheel_slider/issues/15)
5+
- Enhanced documentation
6+
17
## 1.2.1
28

39
- Added support for `double`

README.md

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,51 @@
11
# Wheel Slider
22

3-
Wheel Slider offers a lot of customisation and enables you to scroll around with a wheel-like appearance.
3+
A versatile and highly customizable slider widget for Flutter, with a wheel-like scrolling appearance.
44

55
[![pub package](https://img.shields.io/pub/v/wheel_slider)](https://pub.dev/packages/wheel_slider) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
66

77
![gif of wheel slider](https://media.giphy.com/media/2NHFjGDJ9AZsQL02SD/giphy.gif)
88
![gif of wheel slider](https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExdnd3cHZxeXpoNHUzOHZkY2c5ZjczY3Y5cmNoNTUwaGFxc2ZoZ2lwdCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/m7yxCFXyJZIAOWTSI2/giphy.gif)
99

10-
> Wheel Slider is built upon [`wheel_chooser`](https://pub.dev/packages/wheel_chooser)
10+
> Built on top of [`wheel_chooser`](https://pub.dev/packages/wheel_chooser) for an enhanced experience.
1111
12-
## Features
12+
## Features
1313

14-
* 🔢 Display numbers instead of lines.
15-
* ↔↕ Horizontal/Vertical scroll.
16-
* 📳 Vibrate on scroll.
17-
* 🔧 Custom widgets.
18-
* 🔧 Custom pointer.
19-
* 🖼️ Add background widget to the slider.
20-
* 🎨 Change _Lines_ or _Pointer_ color.
14+
- **🔢 Number Display**: Show numbers instead of simple lines.
15+
- **↔↕ Scroll Orientation**: Horizontal and vertical scrolling options.
16+
- **📳 Haptic Feedback**: Vibrates during scroll for a tactile experience.
17+
- **🔧 Custom Widgets**: Fully customizable items and pointers.
18+
- **🖼️ Background Support**: Add a widget as the slider's background.
19+
- **🎨 Styling Options**: Easily customize line and pointer colors.
2120

22-
## Getting started
21+
## 🚀 Getting Started
2322

24-
#### Installation
25-
26-
Add `wheel_slider:` to your `pubspec.yaml` dependencies then run `flutter pub get`.
23+
### Installation
24+
Add the following to your `pubspec.yaml` under `dependencies`:
2725

2826
```yaml
2927
dependencies:
3028
wheel_slider:
3129
```
3230
#### Import
33-
Add this line to import the package.
3431
3532
```dart
3633
import 'package:wheel_slider/wheel_slider.dart';
3734
```
3835

39-
### Android
40-
41-
Add the vibrate permission to your AndroidManifest.xml file, located in `<project root>/android/app/src/main/AndroidManifest.xml`.
36+
### Android Permissions
4237

43-
* `android.permission.VIBRATE` - allows access to the vibrator.
38+
Add the vibration permission to your `AndroidManifest.xml` file:
4439

4540
```xml
4641
<uses-permission android:name="android.permission.VIBRATE"/>
4742
```
4843

49-
### IOS
44+
### IOS Compatibility
5045

5146
Supports vibration with duration and pattern on CoreHaptics devices. On older devices, the pattern is emulated with 500ms long vibrations.
5247

53-
## Usage
48+
## 📖 Usage
5449

5550
To use __Line Slider__:
5651

@@ -150,8 +145,9 @@ WheelSlider.customWidget(
150145
),
151146
```
152147

153-
#### Properties
148+
#### 🛠️ Properties
154149

150+
* `controller` - A `FixedExtentScrollController` that allows you to manage and control the scroll position of the slider.
155151
* `interval` - To display decimal values. By default it is set to 1, when changed `totalCount` also to be updated accordingly.
156152
* `currentIndex` - Gets the current value as you scroll the Number Slider.
157153
* `perspective` - Change the way you want the slider to look from a flat to a wheel like shape and the value must be <= 0.01.

analysis_options.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
include: package:flutter_lints/flutter.yaml
22

3-
# Additional information about this file can be found at
4-
# https://dart.dev/guides/language/analysis-options
3+
linter:
4+
rules:
5+
- public_member_api_docs

example/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
.pub-cache/
3131
.pub/
3232
/build/
33+
/pubspec.lock
3334

3435
# Web related
3536
lib/generated_plugin_registrant.dart

example/android/app/build.gradle

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
1-
def localProperties = new Properties()
2-
def localPropertiesFile = rootProject.file('local.properties')
3-
if (localPropertiesFile.exists()) {
4-
localPropertiesFile.withReader('UTF-8') { reader ->
5-
localProperties.load(reader)
6-
}
7-
}
8-
9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
14-
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
15-
if (flutterVersionCode == null) {
16-
flutterVersionCode = '1'
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
175
}
186

19-
def flutterVersionName = localProperties.getProperty('flutter.versionName')
20-
if (flutterVersionName == null) {
21-
flutterVersionName = '1.0'
22-
}
23-
24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
287
android {
8+
namespace "com.example.example"
299
compileSdkVersion flutter.compileSdkVersion
3010

3111
compileOptions {
@@ -42,27 +22,24 @@ android {
4222
}
4323

4424
defaultConfig {
45-
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
4625
applicationId "com.example.example"
4726
minSdkVersion flutter.minSdkVersion
4827
targetSdkVersion flutter.targetSdkVersion
49-
versionCode flutterVersionCode.toInteger()
50-
versionName flutterVersionName
28+
versionCode flutter.versionCode
29+
versionName flutter.versionName
5130
}
5231

5332
buildTypes {
5433
release {
55-
// TODO: Add your own signing config for the release build.
56-
// Signing with the debug keys for now, so `flutter run --release` works.
5734
signingConfig signingConfigs.debug
5835
}
5936
}
6037
}
6138

6239
flutter {
63-
source '../..'
40+
source = "../.."
6441
}
6542

6643
dependencies {
6744
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
68-
}
45+
}

example/android/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
buildscript {
2-
ext.kotlin_version = '1.6.10'
2+
ext.kotlin_version = '1.7.10'
33
repositories {
44
google()
55
mavenCentral()
66
}
7-
87
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.0.4'
8+
classpath 'com.android.tools.build:gradle:8.7.3'
109
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1110
}
1211
}
@@ -28,4 +27,4 @@ subprojects {
2827

2928
tasks.register("clean", Delete) {
3029
delete rootProject.buildDir
31-
}
30+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Sun Dec 15 19:43:40 IST 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version '8.7.3' apply false
22+
id "org.jetbrains.kotlin.android" version "1.8.22" apply false
23+
}
24+
25+
include ":app"

example/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>9.0</string>
24+
<string>12.0</string>
2525
</dict>
2626
</plist>

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 54;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -127,7 +127,7 @@
127127
97C146E61CF9000F007C117D /* Project object */ = {
128128
isa = PBXProject;
129129
attributes = {
130-
LastUpgradeCheck = 1300;
130+
LastUpgradeCheck = 1510;
131131
ORGANIZATIONNAME = "";
132132
TargetAttributes = {
133133
97C146ED1CF9000F007C117D = {
@@ -171,10 +171,12 @@
171171
/* Begin PBXShellScriptBuildPhase section */
172172
3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
173173
isa = PBXShellScriptBuildPhase;
174+
alwaysOutOfDate = 1;
174175
buildActionMask = 2147483647;
175176
files = (
176177
);
177178
inputPaths = (
179+
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
178180
);
179181
name = "Thin Binary";
180182
outputPaths = (
@@ -185,6 +187,7 @@
185187
};
186188
9740EEB61CF901F6004384FC /* Run Script */ = {
187189
isa = PBXShellScriptBuildPhase;
190+
alwaysOutOfDate = 1;
188191
buildActionMask = 2147483647;
189192
files = (
190193
);
@@ -272,7 +275,7 @@
272275
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
273276
GCC_WARN_UNUSED_FUNCTION = YES;
274277
GCC_WARN_UNUSED_VARIABLE = YES;
275-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
278+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
276279
MTL_ENABLE_DEBUG_INFO = NO;
277280
SDKROOT = iphoneos;
278281
SUPPORTED_PLATFORMS = iphoneos;
@@ -288,6 +291,7 @@
288291
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
289292
CLANG_ENABLE_MODULES = YES;
290293
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
294+
DEVELOPMENT_TEAM = QDLY2799J8;
291295
ENABLE_BITCODE = NO;
292296
INFOPLIST_FILE = Runner/Info.plist;
293297
LD_RUNPATH_SEARCH_PATHS = (
@@ -349,7 +353,7 @@
349353
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
350354
GCC_WARN_UNUSED_FUNCTION = YES;
351355
GCC_WARN_UNUSED_VARIABLE = YES;
352-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
356+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
353357
MTL_ENABLE_DEBUG_INFO = YES;
354358
ONLY_ACTIVE_ARCH = YES;
355359
SDKROOT = iphoneos;
@@ -398,7 +402,7 @@
398402
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
399403
GCC_WARN_UNUSED_FUNCTION = YES;
400404
GCC_WARN_UNUSED_VARIABLE = YES;
401-
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
405+
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
402406
MTL_ENABLE_DEBUG_INFO = NO;
403407
SDKROOT = iphoneos;
404408
SUPPORTED_PLATFORMS = iphoneos;
@@ -416,6 +420,7 @@
416420
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
417421
CLANG_ENABLE_MODULES = YES;
418422
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
423+
DEVELOPMENT_TEAM = QDLY2799J8;
419424
ENABLE_BITCODE = NO;
420425
INFOPLIST_FILE = Runner/Info.plist;
421426
LD_RUNPATH_SEARCH_PATHS = (
@@ -438,6 +443,7 @@
438443
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
439444
CLANG_ENABLE_MODULES = YES;
440445
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
446+
DEVELOPMENT_TEAM = QDLY2799J8;
441447
ENABLE_BITCODE = NO;
442448
INFOPLIST_FILE = Runner/Info.plist;
443449
LD_RUNPATH_SEARCH_PATHS = (

0 commit comments

Comments
 (0)