Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
  • 21-add-onlongpress-with-popup-on-parameters
  • 23-center-vertically-buttons
  • 30-highlight-bin-when-selecting-disabled-item
  • master
  • 0.0.1
  • 0.0.2
  • 0.1.0
  • 0.1.1
  • 0.2.0
  • 0.3.0
  • 0.4.0
  • 0.5.0
  • 0.6.0
  • 0.6.1
  • 0.7.0
  • 0.8.0
  • 0.8.1
  • 0.8.2
  • 0.8.3
  • 0.8.4
  • 0.9.0
  • 0.9.1
  • 1.0.0
  • 1.0.2
  • 1.0.3
  • 1.0.4
  • 1.0.5
  • 1.0.6
  • 1.0.7
  • 1.0.8
30 results

Target

Select target project
  • android/flutter-toolbox
1 result
Select Git revision
  • 21-add-onlongpress-with-popup-on-parameters
  • 23-center-vertically-buttons
  • 30-highlight-bin-when-selecting-disabled-item
  • master
  • 0.0.1
  • 0.0.2
  • 0.1.0
  • 0.1.1
  • 0.2.0
  • 0.3.0
  • 0.4.0
  • 0.5.0
  • 0.6.0
  • 0.6.1
  • 0.7.0
  • 0.8.0
  • 0.8.1
  • 0.8.2
  • 0.8.3
  • 0.8.4
  • 0.9.0
  • 0.9.1
  • 1.0.0
  • 1.0.2
  • 1.0.3
  • 1.0.4
  • 1.0.5
  • 1.0.6
  • 1.0.7
  • 1.0.8
30 results
Show changes

Commits on Source 6

## 0.8.3
- Improve topbar buttons
## 0.8.2
- Remove deprecations
## 0.8.1
- Fix autosized text in styled buttons
## 0.8.0 ## 0.8.0
- Allow multiline parameter item - Allow multiline parameter item
......
...@@ -77,10 +77,10 @@ class AppBarButton { ...@@ -77,10 +77,10 @@ class AppBarButton {
}); });
Widget render(BuildContext context) { Widget render(BuildContext context) {
return ElevatedButton( return TextButton(
onPressed: () => onPressed!(context), onPressed: () => onPressed!(context),
onLongPress: () => onLongPress!(context), onLongPress: () => onLongPress!(context),
style: ElevatedButton.styleFrom( style: TextButton.styleFrom(
shape: const CircleBorder(), shape: const CircleBorder(),
iconColor: Theme.of(context).colorScheme.onSurface, iconColor: Theme.of(context).colorScheme.onSurface,
), ),
......
...@@ -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,
);
} }
} }
...@@ -2,8 +2,6 @@ import 'dart:math'; ...@@ -2,8 +2,6 @@ import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:flutter_custom_toolbox/utils/color_extensions.dart'; import 'package:flutter_custom_toolbox/utils/color_extensions.dart';
class StyledButton extends StatelessWidget { class StyledButton extends StatelessWidget {
...@@ -27,11 +25,13 @@ class StyledButton extends StatelessWidget { ...@@ -27,11 +25,13 @@ class StyledButton extends StatelessWidget {
required String caption, required String caption,
required Color color, required Color color,
}) { }) {
final Widget captionWidget = AutoSizeText( final Widget captionWidget = FittedBox(
fit: BoxFit.scaleDown,
child: Text(
caption, caption,
maxLines: 1,
style: TextStyle( style: TextStyle(
inherit: true, inherit: true,
fontSize: 99,
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: color.darken(60), color: color.darken(60),
shadows: [ shadows: [
...@@ -57,6 +57,7 @@ class StyledButton extends StatelessWidget { ...@@ -57,6 +57,7 @@ class StyledButton extends StatelessWidget {
), ),
], ],
), ),
),
); );
return StyledButton( return StyledButton(
......
...@@ -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.0 version: 0.8.3
homepage: https://git.harrault.fr/android/flutter-toolbox homepage: https://git.harrault.fr/android/flutter-toolbox
...@@ -16,7 +16,6 @@ dependencies: ...@@ -16,7 +16,6 @@ dependencies:
sdk: flutter sdk: flutter
# base # base
auto_size_text: ^3.0.0
easy_localization: ^3.0.1 easy_localization: ^3.0.1
equatable: ^2.0.5 equatable: ^2.0.5
flutter_bloc: ^8.1.1 flutter_bloc: ^8.1.1
......