wear_os_scrollbar 0.2.1 copy "wear_os_scrollbar: ^0.2.1" to clipboard
wear_os_scrollbar: ^0.2.1 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';
import 'package:wear_os_scrollbar_example/widgets/card_action.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,
        cardTheme: CardThemeData(
          shape: RoundedRectangleBorder(
            borderRadius: BorderRadius.circular(24),
          ),
          margin: EdgeInsets.zero,
        ),
      ),
      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 WearOsExpressiveItem(
                    scrollController: _controller,
                    child: Container(
                      width: double.infinity,
                      margin: const EdgeInsets.symmetric(vertical: 2),
                      child: CardAction(
                        content: Text('Item ${index + 1}'),
                        onPressed: () {
                          ScaffoldMessenger.of(context).hideCurrentSnackBar();
                          ScaffoldMessenger.of(context).showSnackBar(
                            SnackBar(
                              content: Text(
                                'Tapped on Item ${index + 1}',
                                textAlign: TextAlign.center,
                              ),
                            ),
                          );
                        },
                      ),
                    ),
                  );
                },
              ),
            ),
          ),
        ),
      ),
    );
  }
}
1
likes
160
points
44
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