wear_os_scrollbar 0.0.3 copy "wear_os_scrollbar: ^0.0.3" to clipboard
wear_os_scrollbar: ^0.0.3 copied to clipboard

PlatformAndroid

A Flutter plugin to show Material 3 Expressive scroll indicator for WearOS with customizable haptic response.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final ScrollController _controller = ScrollController();

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        useMaterial3: true,
        brightness: Brightness.dark,
        scaffoldBackgroundColor: Colors.black,
      ),
      home: Scaffold(
        body: SizedBox.expand(
          child: WearOsScrollbar(
            controller: _controller,
            hapticFeedback: WearOsHapticFeedback.lightImpact,
            child: Padding(
              padding: const EdgeInsets.symmetric(horizontal: 16),
              child: ListView.builder(
                controller: _controller,
                itemCount: 20,
                itemBuilder: (context, index) {
                  return ListTile(
                    shape: const RoundedRectangleBorder(
                      borderRadius: BorderRadius.all(Radius.circular(12)),
                    ),
                    title: Text(
                      'Item ${index + 1}',
                      textAlign: TextAlign.center,
                    ),
                    onTap: () {
                      ScaffoldMessenger.of(context).hideCurrentSnackBar();
                      ScaffoldMessenger.of(context).showSnackBar(
                        SnackBar(
                          content: Text(
                            'Tapped on Item ${index + 1}',
                            textAlign: TextAlign.center,
                          ),
                        ),
                      );
                    },
                  );
                },
              ),
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
160
points
221
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin to show Material 3 Expressive scroll indicator for WearOS with customizable haptic response.

Repository (GitHub)
View/report issues

Topics

#wearos #smartwatch #ui #scrollbar #haptic

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on wear_os_scrollbar

Packages that implement wear_os_scrollbar