Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu logo and example fix #114

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
File renamed without changes
6 changes: 6 additions & 0 deletions example/lib/example_page_items.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import 'package:yaru_widgets_example/pages/slider_page.dart';
import 'package:yaru_widgets_example/pages/switch_row_page.dart';
import 'package:yaru_widgets_example/pages/tabbed_page_page.dart';
import 'package:yaru_widgets_example/pages/toggle_buttons_row_page.dart';
import 'package:yaru_widgets_example/pages/ubuntu_logo.dart';
import 'package:yaru_widgets_example/widgets/option_button_list.dart';
import 'package:yaru_widgets_example/widgets/row_list.dart';

Expand Down Expand Up @@ -123,5 +124,10 @@ final examplePageItems = <YaruPageItem>[
titleBuilder: (context) => Text('YaruColorDisk'),
builder: (context) => ColorDiskPage(),
iconData: YaruIcons.color_select,
),
YaruPageItem(
titleBuilder: (context) => Text('UbuntuLogo'),
builder: (context) => UbuntuLogoPage(),
iconData: YaruIcons.ubuntu_logo,
)
];
23 changes: 12 additions & 11 deletions example/lib/pages/color_disk_page.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:yaru/yaru.dart';
import 'package:yaru_colors/yaru_colors.dart';
import 'package:yaru_widgets/yaru_widgets.dart';
import 'package:yaru_widgets_example/theme.dart';

Expand Down Expand Up @@ -43,52 +44,52 @@ final List<GlobalTheme> globalThemeList = [
GlobalTheme(
lightTheme: yaruLight,
darkTheme: yaruDark,
primaryColor: YaruColors.ubuntuOrange,
primaryColor: YaruColors.orange,
),
GlobalTheme(
lightTheme: yaruSageLight,
darkTheme: yaruSageDark,
primaryColor: sageMaterialColor,
primaryColor: YaruColors.sage,
),
GlobalTheme(
lightTheme: yaruBarkLight,
darkTheme: yaruBarkDark,
primaryColor: barkMaterialColor,
primaryColor: YaruColors.bark,
),
GlobalTheme(
lightTheme: yaruOliveLight,
darkTheme: yaruOliveDark,
primaryColor: oliveMaterialColor,
primaryColor: YaruColors.olive,
),
GlobalTheme(
lightTheme: yaruViridianLight,
darkTheme: yaruViridianDark,
primaryColor: viridianMaterialColor,
primaryColor: YaruColors.viridian,
),
GlobalTheme(
lightTheme: yaruPrussianGreenLight,
darkTheme: yaruPrussianGreenDark,
primaryColor: prussianGreenMaterialColor,
primaryColor: YaruColors.prussianGreen,
),
GlobalTheme(
lightTheme: yaruBlueLight,
darkTheme: yaruBlueDark,
primaryColor: blueMaterialColor,
primaryColor: YaruColors.blue,
),
GlobalTheme(
lightTheme: yaruPurpleLight,
darkTheme: yaruPurpleDark,
primaryColor: purpleMaterialColor,
primaryColor: YaruColors.purple,
),
GlobalTheme(
lightTheme: yarMagentaLight,
lightTheme: yaruMagentaLight,
darkTheme: yaruMagentaDark,
primaryColor: magentaMaterialColor,
primaryColor: YaruColors.magenta,
),
GlobalTheme(
lightTheme: yaruRedLight,
darkTheme: yaruRedDark,
primaryColor: lightRedMaterialColor,
primaryColor: YaruColors.red,
),
];

Expand Down
20 changes: 20 additions & 0 deletions example/lib/pages/ubuntu_logo.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
import 'package:yaru_widgets/yaru_widgets.dart';

class UbuntuLogoPage extends StatefulWidget {
const UbuntuLogoPage({Key? key}) : super(key: key);

@override
_UbuntuLogoPageState createState() => _UbuntuLogoPageState();
}

class _UbuntuLogoPageState extends State<UbuntuLogoPage> {
@override
Widget build(BuildContext context) {
return YaruPage(
children: [
UbuntuLogo(),
],
);
}
}
1 change: 1 addition & 0 deletions example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
provider: ^6.0.2
yaru:
git: http://github.com/ubuntu/yaru.dart
yaru_colors: ^0.1.0
yaru_icons: ^0.2.0
yaru_widgets:
path: ../
Expand Down
11 changes: 3 additions & 8 deletions lib/src/ubuntu_logo.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'dart:io';

import 'package:flutter/material.dart';

/// The official Ubuntu Logo
Expand All @@ -6,13 +8,6 @@ class UbuntuLogo extends StatelessWidget {

@override
Widget build(BuildContext context) {
// This must be a ClipOval or else if the image is colored using BlendMode
// the transparent parts of the png make it look like a square.

return const ClipOval(
child: Image(
image: AssetImage('assets/ubuntu_logo.png'),
),
);
return Image.file(File('../assets/ubuntu.png'));
}
}
3 changes: 2 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ environment:
dependencies:
flutter:
sdk: flutter
yaru_colors: ^0.1.0

dev_dependencies:
flutter_test:
Expand All @@ -19,5 +20,5 @@ dev_dependencies:

flutter:
assets:
- assets/
- assets/ubuntu.png
uses-material-design: true