Skip to content

Commit e429fed

Browse files
update dependencies and local theme colors (#106)
Co-authored-by: aguskoll <[email protected]>
1 parent 3d9db32 commit e429fed

File tree

8 files changed

+74
-16
lines changed

8 files changed

+74
-16
lines changed

app/lib/presentation/resources/custom_network_image.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'package:app/presentation/themes/local_theme.dart';
12
import 'package:flutter/material.dart';
23
import 'package:flutter_svg/svg.dart';
34

@@ -45,7 +46,7 @@ class CustomNetworkImage extends StatelessWidget {
4546
decoration: BoxDecoration(boxShadow: [
4647
if ((shadow ?? false))
4748
BoxShadow(
48-
color: Colors.black.withValues(alpha: _shadowOpacity),
49+
color: Colors.black.shadow(_shadowOpacity),
4950
spreadRadius: 0,
5051
blurRadius: _blurRadius,
5152
offset: const Offset(5, 5),
@@ -62,7 +63,7 @@ class CustomNetworkImage extends StatelessWidget {
6263
decoration: BoxDecoration(boxShadow: [
6364
if ((shadow ?? false))
6465
BoxShadow(
65-
color: Colors.black.withValues(alpha: _shadowOpacity),
66+
color: Colors.black.shadow(_shadowOpacity),
6667
spreadRadius: 0,
6768
blurRadius: _blurRadius,
6869
offset: const Offset(5, 5),

app/lib/presentation/themes/local_theme.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,14 @@ abstract class LocalTheme {
251251
}
252252

253253
extension ColorShadow on Color {
254+
/// Returns a color with the specified shadow opacity.
255+
/// If no opacity is specified, it defaults to 1.0 (fully opaque).
256+
/// @param opacity value between 0.0 and 1.0
257+
Color shadow(double opacity) {
258+
assert(opacity >= 0.0 && opacity <= 1.0);
259+
return withValues(alpha: opacity);
260+
}
261+
254262
Color variant(int variant) {
255263
try {
256264
return (this as MaterialColor)[variant] ?? this;

app/lib/presentation/themes/resources/dark_theme_colors.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class DarkThemeColors implements ThemeColors {
99
/// 100: onPrimary
1010
@override
1111
// TODO: implement primary
12-
MaterialColor get primary => const MaterialColor(40, {
12+
MaterialColor get primary => const MaterialColor(0xFFFFFFDE, {
1313
0: Color(0xFFFFFFDE),
1414
10: Color(0xFFFFFFDE),
1515
20: Color(0xFFFFFFDE),
@@ -31,7 +31,7 @@ class DarkThemeColors implements ThemeColors {
3131
/// 100: onSecondary
3232
@override
3333
// TODO: implement secondary
34-
MaterialColor get secondary => const MaterialColor(40, {
34+
MaterialColor get secondary => const MaterialColor(0xFFFFFFFD, {
3535
0: Color(0xFFFFFFDE),
3636
10: Color(0xFF1D192B),
3737
20: Color(0xFFFFFFDE),
@@ -53,7 +53,7 @@ class DarkThemeColors implements ThemeColors {
5353
/// 100: onTertiary
5454
@override
5555
// TODO: implement tertiary
56-
MaterialColor get tertiary => const MaterialColor(40, {
56+
MaterialColor get tertiary => const MaterialColor(0xFFFFFFDE, {
5757
0: Color(0xFFFFFFDE),
5858
10: Color(0xFFFFFFDE),
5959
20: Color(0xFFFFFFDE),
@@ -75,7 +75,7 @@ class DarkThemeColors implements ThemeColors {
7575
/// 100: onError
7676
@override
7777
// TODO: implement error
78-
MaterialColor get error => const MaterialColor(40, {
78+
MaterialColor get error => const MaterialColor(0xFFB3261E, {
7979
0: Color(0xFFFFFFDE),
8080
10: Color(0xFF410E0B),
8181
20: Color(0xFFF0524D),
@@ -96,7 +96,7 @@ class DarkThemeColors implements ThemeColors {
9696
/// 99: background / surface
9797
@override
9898
// TODO: implement neutral
99-
MaterialColor get neutral => const MaterialColor(40, {
99+
MaterialColor get neutral => const MaterialColor(0xFF410E0B, {
100100
0: Color(0xFF410E0B),
101101
10: Color(0xFF410E0B),
102102
20: Color(0xFF410E0B),
@@ -118,7 +118,7 @@ class DarkThemeColors implements ThemeColors {
118118
/// 90: surfaceVariant
119119
@override
120120
// TODO: implement neutralVariant
121-
MaterialColor get neutralVariant => const MaterialColor(40, {
121+
MaterialColor get neutralVariant => const MaterialColor(0xFFFDDDDE, {
122122
0: Color(0xFF000000),
123123
10: Color(0xFF49454F),
124124
20: Color(0xFFF0524D),

app/lib/presentation/themes/resources/light_theme_colors.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class LightThemeColors implements ThemeColors {
88
/// 100: onPrimary
99
@override
1010
// TODO: implement primary
11-
MaterialColor get primary => const MaterialColor(40, {
11+
MaterialColor get primary => const MaterialColor(0xFF6750A4, {
1212
0: Color(0xFF000000),
1313
10: Color(0xFF21005D), // Default Bottom navigation bar labels
1414
20: Color(0xFFF0524D),
@@ -30,7 +30,7 @@ class LightThemeColors implements ThemeColors {
3030
/// 100: onSecondary
3131
@override
3232
// TODO: implement secondary
33-
MaterialColor get secondary => const MaterialColor(40, {
33+
MaterialColor get secondary => const MaterialColor(0xFF625B71, {
3434
0: Color(0xFF000000),
3535
10: Color(0xFF1D192B),
3636
20: Color(0xFFF0524D),
@@ -52,7 +52,7 @@ class LightThemeColors implements ThemeColors {
5252
/// 100: onTertiary
5353
@override
5454
// TODO: implement tertiary
55-
MaterialColor get tertiary => const MaterialColor(40, {
55+
MaterialColor get tertiary => const MaterialColor(0xFF7D5260, {
5656
0: Color(0xFF000000),
5757
10: Color(0xFF31111D),
5858
20: Color(0xFFF0524D),
@@ -74,7 +74,7 @@ class LightThemeColors implements ThemeColors {
7474
/// 100: onError
7575
@override
7676
// TODO: implement error
77-
MaterialColor get error => const MaterialColor(40, {
77+
MaterialColor get error => const MaterialColor(0xFFB3261E, {
7878
0: Color(0xFF000000),
7979
10: Color(0xFF410E0B),
8080
20: Color(0xFFF0524D),
@@ -95,7 +95,7 @@ class LightThemeColors implements ThemeColors {
9595
/// 99: background / surface
9696
@override
9797
// TODO: implement neutral
98-
MaterialColor get neutral => const MaterialColor(40, {
98+
MaterialColor get neutral => const MaterialColor(0xFFFFFFFF, {
9999
0: Color(0xFFFFFFFF), // Default Shadow
100100
10: Color(0xFFFFFFFF), // Default Text color
101101
20: Color(0xFFFFFFFF),
@@ -117,7 +117,7 @@ class LightThemeColors implements ThemeColors {
117117
/// 90: surfaceVariant
118118
@override
119119
// TODO: implement neutralVariant
120-
MaterialColor get neutralVariant => const MaterialColor(40, {
120+
MaterialColor get neutralVariant => const MaterialColor(0xFFF0524D, {
121121
0: Color(0xFF000000),
122122
10: Color(0xFF49454F),
123123
20: Color(0xFFF0524D),
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
4+
5+
// clang-format off
6+
7+
#include "generated_plugin_registrant.h"
8+
9+
10+
void fl_register_plugins(FlPluginRegistry* registry) {
11+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//
2+
// Generated file. Do not edit.
3+
//
4+
5+
// clang-format off
6+
7+
#ifndef GENERATED_PLUGIN_REGISTRANT_
8+
#define GENERATED_PLUGIN_REGISTRANT_
9+
10+
#include <flutter_linux/flutter_linux.h>
11+
12+
// Registers Flutter plugins.
13+
void fl_register_plugins(FlPluginRegistry* registry);
14+
15+
#endif // GENERATED_PLUGIN_REGISTRANT_
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Generated file, do not edit.
3+
#
4+
5+
list(APPEND FLUTTER_PLUGIN_LIST
6+
)
7+
8+
list(APPEND FLUTTER_FFI_PLUGIN_LIST
9+
)
10+
11+
set(PLUGIN_BUNDLED_LIBRARIES)
12+
13+
foreach(plugin ${FLUTTER_PLUGIN_LIST})
14+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin})
15+
target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin)
16+
list(APPEND PLUGIN_BUNDLED_LIBRARIES $<TARGET_FILE:${plugin}_plugin>)
17+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries})
18+
endforeach(plugin)
19+
20+
foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST})
21+
add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin})
22+
list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries})
23+
endforeach(ffi_plugin)

app/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ environment:
2323
dependencies:
2424
flutter:
2525
sdk: flutter
26-
flutter_svg: ^2.0.5
26+
flutter_svg: ^2.2.0
2727
shared_preferences: ^2.5.3
2828
intl: ^0.20.2
2929
intl_utils: ^2.8.7
@@ -57,7 +57,7 @@ dependencies:
5757
example_presentation:
5858
path: ../example/example_presentation
5959

60-
http: ^0.13.6
60+
http: ^1.5.0
6161
melos: ^3.4.0
6262
dev: ^1.0.0
6363

0 commit comments

Comments
 (0)