Skip to main content

wear_os_scrollbar 1.1.4 copy "wear_os_scrollbar: ^1.1.4" to clipboard
wear_os_scrollbar: ^1.1.4 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:material_ui/material_ui.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.rotaryTick,
            child: Padding(
              padding: const EdgeInsets.symmetric(horizontal: 16),
              child: ListView.builder(
                controller: _controller,
                itemCount: 100,
                itemBuilder: (context, index) {
                  return 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
330
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, material_ui, plugin_platform_interface

More

Packages that depend on wear_os_scrollbar

Packages that implement wear_os_scrollbar