Skip to content

Commit

Permalink
Merge pull request #300 from takenet/develop
Browse files Browse the repository at this point in the history
[Release] 0.3.6
  • Loading branch information
mpamaro authored Feb 7, 2025
2 parents 7a11f20 + fe57f6a commit 3cd5840
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 37 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.3.6

- Improved link color contrast in Dark Mode.

## 0.3.5

- Added support for Reactions.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/services/ds_dialog.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class DSDialogService {
child: Container(
constraints: const BoxConstraints(maxWidth: 400.0),
decoration: BoxDecoration(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow,
borderRadius: const BorderRadius.all(Radius.circular(15.0)),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/services/ds_theme.service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import '../themes/colors/ds_colors.theme.dart';
abstract class DSThemeService {
static ThemeMode _themeMode = ThemeMode.light;

static setThemeMode(final ThemeMode themeMode) => _themeMode = themeMode;
static void setThemeMode(final ThemeMode themeMode) => _themeMode = themeMode;

static isDarkMode() => _themeMode == ThemeMode.dark;
static bool get isDarkMode => _themeMode == ThemeMode.dark;

static Color get foregoundColor => _themeMode == ThemeMode.dark
? DSColors.neutralLightSnow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class DSAudioResumeButton extends DSTertiaryButton {
'assets/images/microphone.svg',
package: DSUtils.packageName,
colorFilter: ColorFilter.mode(
DSThemeService.isDarkMode()
DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralDarkRooftop,
BlendMode.srcIn,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DSCustomRepliesIconButton extends StatelessWidget {
onPressed: onPressed,
icon: Icon(
DSIcons.message_talk_outline,
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralDarkRooftop,
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/buttons/ds_secondary_button.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ class DSSecondaryButton extends DSButton {
Color? borderColor,
}) : super(
backgroundColor: backgroundColor ??
(DSThemeService.isDarkMode()
(DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow),
foregroundColor: foregroundColor ??
(isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.primaryNight
: DSColors.neutralMediumElephant),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/buttons/ds_tertiary_button.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ class DSTertiaryButton extends DSButton {
}) : super(
backgroundColor: Colors.transparent,
foregroundColor: isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralDarkCity
: DSThemeService.isDarkMode()
: DSThemeService.isDarkMode
? DSColors.neutralDarkCity
: DSColors.neutralMediumElephant,
);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/chat/ds_highlight.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class _DSTesteState extends State<DSHighlight> with TickerProviderStateMixin {
decoration: DecorationTween(
begin: BoxDecoration(),
end: BoxDecoration(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSDarkColors.surface1
: Colors.black.withValues(alpha: 0.1),
),
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/fields/ds_input_container.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ class DSInputContainer extends StatelessWidget {
: DSColors.neutralLightBox,
),
color: isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow
: DSThemeService.isDarkMode()
: DSThemeService.isDarkMode
? DSDarkColors.surface1
: DSColors.neutralLightWhisper,
),
Expand Down
6 changes: 3 additions & 3 deletions lib/src/widgets/fields/ds_phone_input.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class _DSPhoneInputState extends State<DSPhoneInput> {
() => Container(
padding: const EdgeInsets.fromLTRB(12.0, 0.0, 4.0, 0.0),
decoration: BoxDecoration(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow,
border: Border.all(color: _borderColor.value),
Expand All @@ -118,7 +118,7 @@ class _DSPhoneInputState extends State<DSPhoneInput> {
style: DSTextStyle(
fontSize: 9.0,
fontWeight: DSFontWeights.bold,
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralMediumCloud,
),
Expand Down Expand Up @@ -271,7 +271,7 @@ class _DSPhoneInputState extends State<DSPhoneInput> {
} else if (_focusNode.hasFocus && widget.shouldFocus) {
return DSColors.primaryNight;
} else {
return DSThemeService.isDarkMode()
return DSThemeService.isDarkMode
? DSDarkColors.surface0
: DSColors.neutralMediumWave;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/widgets/fields/ds_search_input.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DSSearchInput extends StatelessWidget {
controller: controller,
onChanged: onSearch,
style: DSBodyTextStyle(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralDarkCity),
autofocus: false,
Expand All @@ -58,7 +58,7 @@ class DSSearchInput extends StatelessWidget {
),
),
),
fillColor: DSThemeService.isDarkMode()
fillColor: DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow,
prefixIconConstraints: const BoxConstraints(
Expand Down Expand Up @@ -107,7 +107,7 @@ class DSSearchInput extends StatelessWidget {
OutlineInputBorder _getBorder() => OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSDarkColors.surface0
: DSColors.neutralMediumWave,
width: 1.0,
Expand Down
6 changes: 3 additions & 3 deletions lib/src/widgets/fields/ds_select_input.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class DSSelectInput extends StatelessWidget {
controller: controller,
onChanged: onChanged,
style: DSBodyTextStyle(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralDarkCity,
),
Expand All @@ -65,7 +65,7 @@ class DSSelectInput extends StatelessWidget {
color: DSColors.neutralMediumCloud,
),
),
fillColor: DSThemeService.isDarkMode()
fillColor: DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow,
contentPadding: const EdgeInsets.all(10.0),
Expand All @@ -79,7 +79,7 @@ class DSSelectInput extends StatelessWidget {
enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.circular(8.0),
borderSide: BorderSide(
color: DSThemeService.isDarkMode()
color: DSThemeService.isDarkMode
? DSDarkColors.surface0
: DSColors.neutralMediumWave,
width: 1.0,
Expand Down
4 changes: 2 additions & 2 deletions lib/src/widgets/fields/ds_text_field.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ class _DSTextFieldState extends State<DSTextField> {
onTapOutside: widget.onTapOutside,
decoration: InputDecoration(
fillColor: widget.isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow
: DSThemeService.isDarkMode()
: DSThemeService.isDarkMode
? DSDarkColors.surface1
: DSColors.neutralLightWhisper,
filled: true,
Expand Down
16 changes: 8 additions & 8 deletions lib/src/widgets/fields/ds_text_form_field.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ class _DSTextFormFieldState extends State<DSTextFormField> {
padding: const EdgeInsets.fromLTRB(12.0, 6.0, 4.0, 6.0),
decoration: BoxDecoration(
color: widget.isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow
: DSThemeService.isDarkMode()
: DSThemeService.isDarkMode
? DSDarkColors.surface1
: DSColors.neutralLightWhisper,
border: Border.all(color: _borderColor.value),
Expand All @@ -82,7 +82,7 @@ class _DSTextFormFieldState extends State<DSTextFormField> {
onChanged: widget.onChanged,
style: DSBodyTextStyle(
color: widget.isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralDarkCity
: DSColors.neutralMediumSilver,
Expand All @@ -92,10 +92,10 @@ class _DSTextFormFieldState extends State<DSTextFormField> {
inputFormatters: widget.inputFormatters,
decoration: InputDecoration(
fillColor: widget.isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSDarkColors.surface3
: DSColors.neutralLightSnow
: DSThemeService.isDarkMode()
: DSThemeService.isDarkMode
? DSDarkColors.surface1
: DSColors.neutralLightWhisper,
contentPadding: EdgeInsets.zero,
Expand All @@ -104,7 +104,7 @@ class _DSTextFormFieldState extends State<DSTextFormField> {
labelStyle: DSCaptionSmallTextStyle(
fontWeight: DSFontWeights.bold,
color: widget.isEnabled
? DSThemeService.isDarkMode()
? DSThemeService.isDarkMode
? DSColors.neutralLightSnow
: DSColors.neutralMediumCloud
: DSColors.neutralMediumSilver,
Expand Down Expand Up @@ -148,11 +148,11 @@ class _DSTextFormFieldState extends State<DSTextFormField> {
} else if (_focusNode.hasFocus) {
return DSColors.primaryNight;
} else if (widget.isEnabled) {
return DSThemeService.isDarkMode()
return DSThemeService.isDarkMode
? DSDarkColors.surface0
: DSColors.neutralMediumWave;
} else {
return DSThemeService.isDarkMode()
return DSThemeService.isDarkMode
? DSDarkColors.surface0
: DSColors.neutralLightBox;
}
Expand Down
12 changes: 9 additions & 3 deletions lib/src/widgets/texts/ds_text.widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flutter/material.dart';

import '../../services/ds_theme.service.dart';
import '../../services/ds_security.service.dart';
import '../../services/ds_theme.service.dart';
import '../../themes/colors/ds_colors.theme.dart';
import '../../themes/texts/utils/ds_font_weights.theme.dart';
import '../../utils/ds_linkify.util.dart';
Expand Down Expand Up @@ -31,7 +31,7 @@ class DSText extends StatelessWidget {
this.fontWeight = DSFontWeights.regular,
this.fontStyle = FontStyle.normal,
Color? color,
this.linkColor = DSColors.primaryNight,
Color? linkColor,
this.overflow = TextOverflow.ellipsis,
this.decoration,
this.textAlign,
Expand All @@ -40,6 +40,9 @@ class DSText extends StatelessWidget {
this.isSelectable = false,
this.height,
}) : color = DSThemeService.foregoundColor,
linkColor = DSThemeService.isDarkMode
? DSColors.primaryLight
: DSColors.primaryNight,
span = null;

DSText.rich(
Expand All @@ -49,7 +52,7 @@ class DSText extends StatelessWidget {
this.fontWeight = DSFontWeights.regular,
this.fontStyle = FontStyle.normal,
Color? color,
this.linkColor = DSColors.primaryNight,
Color? linkColor,
this.overflow = TextOverflow.ellipsis,
this.decoration,
this.textAlign,
Expand All @@ -58,6 +61,9 @@ class DSText extends StatelessWidget {
this.isSelectable = false,
this.height,
}) : color = DSThemeService.foregoundColor,
linkColor = DSThemeService.isDarkMode
? DSColors.primaryLight
: DSColors.primaryNight,
text = null;

@override
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/utils/ds_bottomsheet_countries.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ abstract class DSBottomSheetCountries {

static Future<void> _bottomSheetCountries() {
return DSBottomSheetService(
darkMode: DSThemeService.isDarkMode() ? RxBool(true) : RxBool(false),
darkMode: DSThemeService.isDarkMode ? RxBool(true) : RxBool(false),
fixedHeader: Column(
children: [
Padding(
Expand Down
2 changes: 1 addition & 1 deletion lib/src/widgets/utils/ds_divider.widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class DSDivider extends Divider {
Color? color,
}) : super(
color: color ??
(DSThemeService.isDarkMode()
(DSThemeService.isDarkMode
? DSDarkColors.surface1
: DSColors.neutralMediumWave),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: blip_ds
description: Blip Design System for Flutter.
version: 0.3.5
version: 0.3.6
homepage: https://github.com/takenet/blip-ds-flutter#readme
repository: https://github.com/takenet/blip-ds-flutter

Expand Down

0 comments on commit 3cd5840

Please sign in to comment.