Git Product home page Git Product logo

yaru.dart's Introduction

The official Flutter Yaru Theme and Widgets Suite

Pub Package

This repository and package contains:

  • flutter widgets useful for building desktop and web applications, following but also expanding the yaru theme for the gnome desktop in Ubuntu 22.04+.
  • a theme for widgets from material.dart and from this repository
  • a complete icon set for flutter apps following the yaru design language

LIVE DEMO IN YOUR BROWSER

screenshot screenshot screenshot

Contributing

  • for everything you need

    • flutter

      sudo apt -y install git curl cmake meson make clang libgtk-3-dev pkg-config && mkdir -p ~/development && cd ~/development && git clone https://github.com/flutter/flutter.git -b stable && echo 'export PATH="$PATH:$HOME/development/flutter/bin"' >> ~/.bashrc && source ~/.bashrc
    • VsCode

      sudo snap install code --classic
  • to work on the icons and then build the font, you need to install the icon_font_generator tool:

    dart pub global activate -sgit https://github.com/Jupi007/icon_font_generator.git --git-ref yaru
  • Source SVGs files are located inside ./icons. The final icon name is determined by subfolder_name + icon_name (Ex: icons/mimetype/text-plain.svg will be named mimetype_text_plain).

  • After modifying or adding icons, you must run the build script, which will generate the icon font:

    ./build-icons.sh

    or run

    yaru_icon_font_generator assets/icons assets/yaru_icons.otf --output-class-file=lib/src/yaru_icons.dart -r

Copying or Reusing

The theme and widgets are licensed under Mozilla Public License Version 2.0.

The icons have mixed licencing. You are free to copy, redistribute and/or modify aspects of this work under the terms of each licence accordingly (unless otherwise specified).

The icon assets (any and all source .svg files or rendered .ttf font) are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0 License.

Included scripts are free software licensed under the terms of the GNU General Public License, version 3.

yaru.dart's People

Contributors

abhishek01039 avatar arishsultan avatar blkkkbvsik avatar carlosnihelton avatar d-loose avatar defuncart avatar dependabot[bot] avatar elbeicktalat avatar elioqoshi avatar fcole90 avatar feichtmeier avatar github-actions[bot] avatar gumbarros avatar hrx03 avatar itzswirlz avatar jpnurmi avatar jupi007 avatar kenvandine avatar larsb24 avatar mivoligo avatar muqtxdir avatar osomon avatar pablojimpas avatar pietrotambu avatar robert-ancell avatar shan-shaji avatar theliux avatar timo-schroeder avatar whiskeypeak avatar ymauray avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yaru.dart's Issues

YaruImageTile: replace path with an image widget

A String path property is problematic because it doesn't let apps specify the desired type of image widget. For example, the Ubuntu Desktop Installer needs to pass a FlavorImage widget for looking up flavor theme thumbnails in canonical/ubuntu-desktop-installer#656. Please consider changing the property to a usual Widget child as it is in 95% of cases in Flutter. This would give apps full control over the image.

NarrowLayout: sync selection style with WideLayout selection

Posted by @madsrh in https://github.com/ubuntu-flutter-community/software/issues/234

ATM active selections have both icon and label colored:
image

We should only add color to the "pill" background and change the text weight.

https://api.flutter.dev/flutter/material/NavigationBar-class.html

image


This is an issue in material.dart in the stable channel not being 100% material 3 compatible
I think, when they are done with the migration this issue should be resolved for us "automatically"

Create a tabbed view widget

The default tab styling is a bit unsatisfying.

Created a tabbed view which makes sense for different layers on a page, like for example in the settings app in the connections page:
grafik

and the keyboard page:
grafik

  • tab count
  • list of titles
  • list of icons
  • list of view widgets
  • and a better idea than hardcoded height "1000" 🙄 😆
class KeyboardPage extends StatefulWidget {
  const KeyboardPage({Key? key}) : super(key: key);

  static Widget create(BuildContext context) {
    return const KeyboardPage();
  }

  @override
  State<KeyboardPage> createState() => _KeyboardPageState();
}

class _KeyboardPageState extends State<KeyboardPage>
    with TickerProviderStateMixin {
  late TabController tabController;

  @override
  void initState() {
    tabController = TabController(length: 2, vsync: this);
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          width: 516,
          height: 60,
          decoration: BoxDecoration(borderRadius: BorderRadius.circular(4)),
          child: TabBar(
              controller: tabController,
              indicator: BoxDecoration(
                  borderRadius: BorderRadius.circular(4),
                  color:
                      Theme.of(context).colorScheme.onSurface.withOpacity(0.1)),
              tabs: const [
                Tab(
                    icon: Icon(YaruIcons.input_keyboard),
                    child: Text("Keyboard Settings")),
                Tab(
                    icon: Icon(YaruIcons.font),
                    child: Text("Keyboard Shortcuts")),
              ]),
        ),
        Padding(
          padding: const EdgeInsets.only(top: 30),
          child: SizedBox(
            height: 1000,
            child: TabBarView(
              controller: tabController,
              children: const [KeyboardSettingsPage(), KeyboardShortcutsPage()],
            ),
          ),
        ),
      ],
    );
  }
}

YaruMasterDetailPage wish-list

  • full control over master list tiles
    • replace "icon" & "title" with a "tile" builder?
    • tooltips, semantics, badges, animations, custom tiles, ...
  • full control over detail page app bar
    • replace "title" with an "app bar" builder?
    • leading icon, trailing actions, bottom widget, ...
  • themable constraints, padding, spacings, ...

TODO: update the docs when all the refactoring is done!

Feature Request: Radio Button Group

Once again thank you for creating this package :)

Are Radio Buttons planned? I'm not a regular ubuntu user, however AFAIK radio buttons are part of yaru design.

Carousel: make animation finish correctly

Sometimes if you change the page where the carousel sits (in software by navigating around) the carousel gets stuck somewhere in the animation and sits in an odd size and is unclickable. When the next image animated in the error is gone

grafik

@Jupi007 any idea how to fix this? or is this rather an issue for software?
(edit: sorry jp for tagging you... your names both start with J -.-)

Remove YaruAlertDialg and YaruSimpleDialog

Eventually we should just remove those dialogs from yaruwidgets as they do not bring anything really except complexity. What one wants is the close button the rest can be done by the content inside or the dialog theme in yaru.dart

WDYT @Jupi007 ?

src becomes messy

The /src folder is becoming a bit messy with 37 class files.
I think it would be nice to organize all those into subfolder (layout, controls, dialog, ...).

I don't think it would break something in apps, as we rely on a root yaru_widgets.dart index file which export all files, but maybe I'm wrong.

Wdyt @Feichtmeier ?

Change the content padding of the `YaruAlertDialog`

Currently, the contentPadding property of the AlertDialog that is build by the YaruAlertDialog widget is set to EdgeInsets.zero. This results in dialogs with content that run right up to the left and right edges, as seen in the screenshot below.

It would be great if you guys could update this property with some default padding. Alternatively, you could expose this property for developers to set themselves.

Screen Shot 2022-03-01 at 10 47 03 AM

Remove Yaru*Row widgets

They are basically only material rows with something inside. We should move them back to settings

Mouse cursors for buttons and alike

Flutter specifies "click" and "forbidden" mouse cursors for normal and disabled buttons, respectively.

Enabled Disabled
yaru-enabled disabled

While this is the appropriate behavior on the web, it feels somewhat awkward on the desktop where buttons normally don't change the mouse cursor.

Thus, I would like to propose that Yaru specifies SystemMouseCursors.basic for all button-like widgets.

Enabled Disabled
proposal proposal-disabled

YaruPageItem title creates new lines

When becoming too long, the YaruPageItem wrap the title text into a new line, which isn't looking good:

Capture d’écran du 2022-08-07 17-29-18

A potential "fix" for apps could be to set the exactly needed sidebar width, but with internationalization it is not possible to deal with so much line size.
IMO the best solution is to ellipse the text like in nautilus:

Capture d’écran du 2022-08-07 17-36-43

As the title is not a string but a free widget, I propose to locally change the max-line to 1 and the overflow to TextOverflow.ellipsis, with something like a YaruPageItemTitle widget, so this is optional.

Context menu for Search widget sometimes doesn't appear

I am using Ubuntu, I copied some text and then tried to paste in the Search Widget by right clicking on the Search widget to show me the context menu so that I can paste the text but it sometimes doesn't appear at all although Ctrl+V works fine.

Replace NavigationRail with YaruNavigationRail

First, the selected icon is using the accent color, while tabbed page isn't:

2022-08-07_17-32

Secondly, the selection background isn't wrapping the label, and the hover background isn't fitting the full width, btw it also uses the accent with opacity on hover, but grey on click and this blends bad:

Capture d’écran du 2022-08-07 17-34-25

I tried to take a look into the code, but I think that the NavigationRail customization is very limited.

Add icons for the web PWA

grafik

Favicon works, just copied the new ubuntu CoF

But the other icons seem to have special formats and sizes
grafik
and they are needed for the PWA icon

Make row widgets configurable

All Yaru*Row widgets have pump hardcoded properties into the material row. This makes them hard to use outside of the settings app, where those values come from

We should forward everything a row has from the Yaru*Row widgets to the row. And also never force a child widget to be a text

more widgets?

Hi. Great Job! I was wondering if the library contains basic widgets like textbook, combobox, multiple selected combobox, tree widgets , etc.
Thank you.

YaruPageItem: add more flexibility

Hiding ListTile children was most of the time a lazy decision and limits further design ideas in apps.
To leave maximum freedom material.dart provides for ListTiles and still keep the build in navigation of the layout pages, we could to use iconBuilder, titleBuilder, trailingBuilder, subTileBuilder instead of hiding ListTile children.

This probably needs a refactoring in all layout pages, YaruPageItemList view and YaruPageItem

Post-work is inside Settings, Software and firmware-updater app to not change any looks

Alternatively to forward all children, we could use any ListTile as a title. Could become tricky with the onTap though

Enhancement for arrows on image carousel

The difference between the active and deactivated arrows in the image carousel are too subtle IMHO. I think a better solution would be if the images could just loop ♾️ or alternatively, to hide the left arrow on the first image (and right arrow for the last ofc).

For accessibility the keyboard left/right arrows should work when I click the arrows, the dots and when the image is enlarged.

image

Remove YaruSafeImage

YaruSafeImage would be better moved back to the software app.

  • It assumes a network image
  • It exposes only a couple of Image's properties
  • It masks some of Image's default values (filter quality low -> medium, fit null -> height)
  • It uses an arbitrary default size of 65

All of these are fine assumptions for an application widget but problematic, limiting, and surprising for a framework widget.

Flutter 3.1 deprecations

info • lib/src/pages/rows/yaru_row.dart:78:43 • 'bodyText1' is deprecated and shouldn't be used. Use bodyLarge instead. This feature was deprecated after
          v3.1.0-0.0.pre.. Try replacing the use of the deprecated member with the replacement. • deprecated_member_use
info • lib/src/pages/rows/yaru_row.dart:109:61 • 'caption' is deprecated and shouldn't be used. Use bodySmall instead. This feature was deprecated after
          v3.1.0-0.0.pre.. Try replacing the use of the deprecated member with the replacement. • deprecated_member_use
info • lib/src/pages/rows/yaru_row.dart:110:61 • 'caption' is deprecated and shouldn't be used. Use bodySmall instead. This feature was deprecated after
          v3.1.0-0.0.pre.. Try replacing the use of the deprecated member with the replacement. • deprecated_member_use
info • lib/src/pages/yaru_section.dart:64:62 • 'headline6' is deprecated and shouldn't be used. Use titleLarge instead. This feature was deprecated after
          v3.1.0-0.0.pre.. Try replacing the use of the deprecated member with the replacement. • deprecated_member_use
info • lib/src/utilities/yaru_carousel.dart:250:42 • 'caption' is deprecated and shouldn't be used. Use bodySmall instead. This feature was deprecated after
          v3.1.0-0.0.pre.. Try replacing the use of the deprecated member with the replacement. • deprecated_member_use

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.