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

outdated

This package enhances the looks of Flutter applications on Linux by providing modern-looking Handy windows with rounded bottom corners.

example/lib/main.dart

import 'dart:math' as math;

import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:yaru/yaru.dart';

void main() {
  runApp(
    MaterialApp(
      theme: yaruLight,
      darkTheme: yaruDark,
      home: const HandyPage(),
      debugShowCheckedModeBanner: false,
    ),
  );
}

class HandyPage extends StatelessWidget {
  const HandyPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Handy Window'),
      ),
      body: const Center(
        child: ClickableLink(
          url: 'https://gnome.pages.gitlab.gnome.org/libhandy',
          child: Text(
            'gitlab.gnome.org/libhandy',
            style: TextStyle(fontSize: 28),
          ),
        ),
      ),
      bottomNavigationBar: Row(
        children: const [
          RotatedArrow(angle: math.pi / 4),
          Spacer(),
          RotatedArrow(angle: -math.pi / 4),
        ],
      ),
    );
  }
}

class ClickableLink extends StatelessWidget {
  const ClickableLink({
    Key? key,
    required this.url,
    required this.child,
  }) : super(key: key);

  final String url;
  final Widget child;

  @override
  Widget build(BuildContext context) {
    return MouseRegion(
      cursor: SystemMouseCursors.click,
      child: GestureDetector(
        onTap: () => launch(url),
        child: DefaultTextStyle(
          style: TextStyle(
            color: Colors.blue.shade700,
            decoration: TextDecoration.underline,
          ),
          child: child,
        ),
      ),
    );
  }
}

class RotatedArrow extends StatelessWidget {
  const RotatedArrow({Key? key, required this.angle}) : super(key: key);

  final double angle;

  @override
  Widget build(BuildContext context) {
    return Transform.rotate(
      angle: angle,
      child: Icon(
        Icons.arrow_downward,
        color: Theme.of(context).primaryColor,
        size: 72,
      ),
    );
  }
}
27
likes
0
pub points
90%
popularity

Publisher

verified publisherubuntu.com

This package enhances the looks of Flutter applications on Linux by providing modern-looking Handy windows with rounded bottom corners.

Homepage
Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on handy_window