Skip to main content

keycaps 0.1.1 copy "keycaps: ^0.1.1" to clipboard
keycaps: ^0.1.1 copied to clipboard

Keycap and keyboard-shortcut widgets for Flutter. Draws ⌘⇧P or Ctrl+Shift+P from a string, a LogicalKeyboardKey or a ShortcutActivator, themed and labelled per platform.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'app_theme.dart';
import 'gallery_page.dart';
import 'settings.dart';

void main() => runApp(const ExampleApp());

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

  @override
  State<ExampleApp> createState() => _ExampleAppState();
}

class _ExampleAppState extends State<ExampleApp> {
  final GallerySettings _settings = GallerySettings();

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

  @override
  Widget build(BuildContext context) {
    return GalleryScope(
      notifier: _settings,
      child: AnimatedBuilder(
        animation: _settings,
        builder: (BuildContext context, Widget? child) {
          return MaterialApp(
            title: 'keycaps',
            debugShowCheckedModeBanner: false,
            themeMode: _settings.mode,
            theme: AppTheme.of(Brightness.light),
            darkTheme: AppTheme.of(Brightness.dark),
            home: child,
          );
        },
        child: const GalleryPage(),
      ),
    );
  }
}
1
likes
160
points
127
downloads
screenshot

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Keycap and keyboard-shortcut widgets for Flutter. Draws ⌘⇧P or Ctrl+Shift+P from a string, a LogicalKeyboardKey or a ShortcutActivator, themed and labelled per platform.

Repository (GitHub)
View/report issues

Topics

#keyboard #shortcuts #widget #ui

License

MIT (license)

Dependencies

flutter, phosphor_icons

More

Packages that depend on keycaps