搜尋套件、儲存庫與 APP 分類

vertical_weight_slider 封面
套件詳情v2.6.0

vertical_weight_slider

此套件提供易於使用且可滾動的垂直重量滑桿。相容於 Android、iOS 與 Web。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
664
喜歡數
79
Pub 分數
160

安裝套件

flutter pub add vertical_weight_slider

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

vertical_weight_slider 套件為 Flutter 應用程式提供了一個可滾動的垂直滑桿,讓使用者能直觀地選擇重量或數值。專為跨平台使用設計,支援 Android、iOS、Web、macOS、Windows 與 Linux。此滑桿易於整合與自訂,提供順暢的滾動與即時回饋。適用於需要透過垂直移動進行精確輸入的場景,例如調整音量、強度或以緊湊形式輸入數值。該套件輕量且與現代 Flutter 版本相容。

適用情境

  • 調整音訊音量
  • 設定強度等級
  • 輸入數值
  • 自定義 UI 控制項
  • 互動式儀表板
  • 表單輸入

主要特色

  • 垂直滾動介面
  • 跨平台相容性
  • 輕鬆整合
  • 平滑滾動
  • 響應式設計
  • 可自訂外觀

適合對象

  • 開發互動式表單的開發者
  • 需要緊湊輸入元件的設計師
  • 需要垂直值調整的應用
  • 跨平台 Flutter 專案
  • 以UI為主的應用程式

使用建議

  • 可能需要額外的樣式設定以實現自訂外觀
  • 僅限垂直方向
  • 不適用於水平佈局
  • 效能可能在低階設備上有所差異
  • 需要 Flutter 3.0+ 才能完全相容

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Vertical Weight Slider

This package provides easy-to-use and scrollable vertical weight slider.

Compatible with Android & iOS & Web. :heart_eyes:

pub


Showcase


Getting Started

In the pubspec.yaml of your flutter project, add the following dependency:

dependencies:
  vertical_weight_slider : "^lastest_version"

Usage

Need to include the import the package to the dart file where it will be used, refer the below command

import 'package:vertical_weight_slider/vertical_weight_slider.dart';

Complete example

import 'package:flutter/material.dart';
import 'package:vertical_weight_slider/vertical_weight_slider.dart';

void main() {
  runApp(const MaterialApp(home: MyApp()));
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  late WeightSliderController _controller;
  double _weight = 30.0;

  @override
  void initState() {
    super.initState();
    _controller = WeightSliderController(initialWeight: _weight, minWeight: 0, interval: 0.1);
  }

  @override
  void dispose() {
    _controller.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Vertical Weight Slider Example"),
        centerTitle: true,
      ),
      body: Column(
        children: [
          Container(
            height: 200.0,
            alignment: Alignment.center,
            child: Text(
              "${_weight.toStringAsFixed(1)} kg",
              style: TextStyle(fontSize: 40.0, fontWeight: FontWeight.w500),
            ),
          ),
          VerticalWeightSlider(
            controller: _controller,
            decoration: const PointerDecoration(
              width: 130.0,
              height: 3.0,
              largeColor: Color(0xFF898989),
              mediumColor: Color(0xFFC5C5C5),
              smallColor: Color(0xFFF0F0F0),
              gap: 30.0,
            ),
            onChanged: (double value) {
              setState(() {
                _weight = value;
              });
            },
            indicator: Container(
              height: 3.0,
              width: 200.0,
              alignment: Alignment.centerLeft,
              color: Colors.red[300],
            ),
          ),
        ],
      ),
    );
  }
}


License

Copyright 2020, the Flutter project authors. All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above
      copyright notice, this list of conditions and the following
      disclaimer in the documentation and/or other materials provided
      with the distribution.
    * Neither the name of Google Inc. nor the names of its
      contributors may be used to endorse or promote products derived
      from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

所屬分類

原始碼儲存庫

使用此套件的專案

暫無相關資料。