Skip to content
Snippets Groups Projects
Commit 4871ae1b authored by Benoît Harrault's avatar Benoît Harrault
Browse files

Merge branch '17-remove-deprecations' into 'master'

Resolve "Remove deprecations"

Closes #17

See merge request !16
parents 61ca2ebc accbc000
No related branches found
No related tags found
1 merge request!16Resolve "Remove deprecations"
Pipeline #7376 passed
## 0.8.2
- Remove deprecations
## 0.8.1 ## 0.8.1
- Fix autosized text in styled buttons - Fix autosized text in styled buttons
......
...@@ -42,7 +42,7 @@ final ColorScheme lightColorScheme = ColorScheme.light( ...@@ -42,7 +42,7 @@ final ColorScheme lightColorScheme = ColorScheme.light(
onSurface: textSwatch.shade500, onSurface: textSwatch.shade500,
surface: textSwatch.shade50, surface: textSwatch.shade50,
surfaceContainerHighest: Colors.white, surfaceContainerHighest: Colors.white,
shadow: textSwatch.shade900.withOpacity(.1), shadow: textSwatch.shade900.withValues(alpha: .1),
); );
final ColorScheme darkColorScheme = ColorScheme.dark( final ColorScheme darkColorScheme = ColorScheme.dark(
...@@ -53,7 +53,7 @@ final ColorScheme darkColorScheme = ColorScheme.dark( ...@@ -53,7 +53,7 @@ final ColorScheme darkColorScheme = ColorScheme.dark(
onSurface: textSwatch.shade300, onSurface: textSwatch.shade300,
surface: const Color(0xFF262630), surface: const Color(0xFF262630),
surfaceContainerHighest: const Color(0xFF282832), surfaceContainerHighest: const Color(0xFF282832),
shadow: textSwatch.shade900.withOpacity(.2), shadow: textSwatch.shade900.withValues(alpha: .2),
); );
final ThemeData lightTheme = ThemeData( final ThemeData lightTheme = ThemeData(
......
...@@ -4,30 +4,31 @@ extension ColorExtension on Color { ...@@ -4,30 +4,31 @@ extension ColorExtension on Color {
Color darken([int percent = 40]) { Color darken([int percent = 40]) {
assert(1 <= percent && percent <= 100); assert(1 <= percent && percent <= 100);
final value = 1 - percent / 100; final value = 1 - percent / 100;
return Color.fromARGB( return Color.from(
alpha, alpha: a,
(red * value).round(), red: r * value,
(green * value).round(), green: g * value,
(blue * value).round(), blue: b * value,
); );
} }
Color lighten([int percent = 40]) { Color lighten([int percent = 40]) {
assert(1 <= percent && percent <= 100); assert(1 <= percent && percent <= 100);
final value = percent / 100; final value = percent / 100;
return Color.fromARGB( return Color.from(
alpha, alpha: a,
(red + ((255 - red) * value)).round(), red: r + ((1 - r) * value),
(green + ((255 - green) * value)).round(), green: g + ((1 - g) * value),
(blue + ((255 - blue) * value)).round(), blue: b + ((1 - b) * value),
); );
} }
Color avg(Color other) { Color avg(Color other) {
final red = (this.red + other.red) ~/ 2; return Color.from(
final green = (this.green + other.green) ~/ 2; alpha: (a + other.a) / 2,
final blue = (this.blue + other.blue) ~/ 2; red: (r + other.r) / 2,
final alpha = (this.alpha + other.alpha) ~/ 2; green: (g + other.g) / 2,
return Color.fromARGB(alpha, red, green, blue); blue: (b + other.b) / 2,
);
} }
} }
...@@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects." ...@@ -3,7 +3,7 @@ description: "Flutter custom toolbox for org.benoitharrault.* projects."
publish_to: "none" publish_to: "none"
version: 0.8.1 version: 0.8.2
homepage: https://git.harrault.fr/android/flutter-toolbox homepage: https://git.harrault.fr/android/flutter-toolbox
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment