Skip to content

Commit

Permalink
Revert "Merge branch 'v-3-4-0' into master"
Browse files Browse the repository at this point in the history
This reverts commit f304389, reversing
changes made to 34f6b06.
  • Loading branch information
rydmike committed Jan 21, 2024
1 parent f304389 commit 454e77b
Show file tree
Hide file tree
Showing 14 changed files with 119 additions and 209 deletions.
15 changes: 1 addition & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,6 @@

All notable changes to the **FlexColorPicker** package are documented in this file.

## 3.4.0

**Nov 16, 2023**

**NEW**

- Add transparent color option

**FIX**

- Web demo: Reset to defaults did not reset settings for...


## 3.3.1

**January 21, 2024**
Expand All @@ -37,7 +24,7 @@ All notable changes to the **FlexColorPicker** package are documented in this fi
- When clicking on the color wheels square color box part inside the Hue circle, the click moved the selection on wheel when clicking close to the square edge. This is now fixed. The fix also introduces exact wheel tap/drag to start an operation of Hue wheel. Previously, the Hue wheel would start operating when taping or dragging on the square containing the Hue wheel, but outside the squared color area inside it. Now to start dragging or make a tap action, it must start on the Hue wheel. Dragging around outside it or inside it, once a drag operation has started, works as before.

- Fixed issue [#66 White color selects multiple colors](https://github.com/rydmike/flex_color_picker/issues/66).
- Part of original design with the picker was to only have a given color value appear in one color palette. When adding custom color palettes or using tonal palettes, the same color values may appear in multiple palettes. Selecting such a color value would highlight all the palettes the color appears in. Tonal palettes always contain white and black colors, so it is particularly problematic when using them. This fix prevents showing the main color as selected in multiple palettes and avoids switching Material swatch palette when operating on a tonal palettes. The main Material swatch shade color index 500 or for Material accent swatch shade color index 200, are only shown as selected when its color is actually selected in a Material swatch or Material tonal color tone.
- Part of original design with the picker was to only have a given color value appear in one color palette. When adding custom color palettes or using tonal palettes, the same color values may appear in multiple palettes. Selecting such a color value would highlight all the palettes the color appears in. Tonal palettes always contain white and black colors, so it is particularly problematic when using them. This fix prevents showing the main color as selected in multiple palettes and avoids switching Material swatch palette when operating on a tonal palettes. As a part of this FIX, main Material swatch shade color index 500, or for Material accent swatch shade, color index 200, is only shown as selected when its color is actually selected in a Material swatch or Material tonal color tone.

## 3.2.2

Expand Down
7 changes: 0 additions & 7 deletions example/lib/demo/pods/pods.dart
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,6 @@ final StateProvider<bool> enableOpacityPod =
defaultValue: Keys.defaults[Keys.enableOpacity]! as bool) as bool;
}, name: Keys.enableOpacity);

// State of enabling transparency for custom colors.
final StateProvider<bool> enableTransparencyPod =
StateProvider<bool>((StateProviderRef<bool> ref) {
return hiveStore.get(Keys.enableTransparency,
defaultValue: Keys.defaults[Keys.enableTransparency]! as bool) as bool;
}, name: Keys.enableTransparency);

// State of showing Material color name.
final StateProvider<bool> showMaterialNamePod =
StateProvider<bool>((StateProviderRef<bool> ref) {
Expand Down
6 changes: 0 additions & 6 deletions example/lib/demo/pods/pods_reset.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,6 @@ void resetSettings(WidgetRef ref) {
ref.read(wheelWidthPod.notifier).state =
Keys.defaults[Keys.wheelWidth]! as double;

ref.read(wheelSquarePaddingPod.notifier).state =
Keys.defaults[Keys.wheelSquarePadding]! as double;

ref.read(wheelSquareBorderRadiusPod.notifier).state =
Keys.defaults[Keys.wheelSquareBorderRadius]! as double;

ref.read(wheelHasBorderPod.notifier).state =
Keys.defaults[Keys.wheelHasBorder]! as bool;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ class ColorPickerCard extends ConsumerWidget {
showRecentColors: ref.watch(showRecentColorsPod),
recentColors: ref.watch(cardRecentColorsPod),
maxRecentColors: 8,
enableTransparentCustomColors: ref.watch(enableTransparencyPod),
customColorSwatchesAndNames: App.colorsNameMap,
colorCodeTextStyle: Theme.of(context).textTheme.titleMedium,
colorCodePrefixStyle: Theme.of(context).textTheme.bodySmall,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ Future<bool> colorPickerDialog(
? ref.watch(cardRecentColorsPod)
: ref.watch(dialogRecentColorsPod),
maxRecentColors: cardRemote ? 8 : 5,
enableTransparentCustomColors: ref.watch(enableTransparencyPod),
customColorSwatchesAndNames: App.colorsNameMap,
).showPickerDialog(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import '../../widgets/flex_app_bar.dart';
import 'about.dart';
import 'all_control_widgets.dart';
import 'color_picker_card.dart';
import 'picker_switches/transparency_switch.dart';
import 'picker_text_fields/text_field_focus_demo.dart';
import 'picker_toggle_buttons/actions_order_switch.dart';

Expand Down Expand Up @@ -234,7 +233,6 @@ class _Column2 extends StatelessWidget {
const Index850Switch(),
const TonalSwitch(),
const OpacitySwitch(),
const TransparencySwitch(),
const Divider(),
//
const MaterialNameSwitch(),
Expand Down

This file was deleted.

48 changes: 13 additions & 35 deletions example/lib/demo/utils/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,6 @@ class App {
static const Color blueJean = Color(0xFF4f75b8);
static const Color deepBlueSea = Color(0xFF132b80);

// Add a custom white to black grey scale.
static const MaterialColor whiteBlueBlack = MaterialColor(
0xFF4355B9, // Set the 500 index value here.
<int, Color>{
50: Color(0xFFFFFFFF),
100: Color(0xFFF0EFFF),
200: Color(0xFFBAC3FF),
300: Color(0xFF7789F0),
400: Color(0xFF5D6FD4),
500: Color(0xFF4355B9),
600: Color(0xFF293CA0),
700: Color(0xFF08218A),
800: Color(0xFF00105C),
900: Color(0xFF000000),
},
);

// Add a custom white to black grey scale.
static const MaterialColor whiteToBlack = MaterialColor(
0xFF7C7D80, // Set the 500 index value here.
Expand All @@ -89,24 +72,20 @@ class App {
},
);

// Add a custom black transparency.
//
// Index 50 is fully transparent black.
//
// Index 100 is 10% of max alpha value or 10% opacity, and so on.
static const MaterialColor blackTransparency = MaterialColor(
0x7F000000, // Set the 500 index value here.
// Add a custom white to black grey scale.
static const MaterialColor whiteBlueBlack = MaterialColor(
0xFF4355B9, // Set the 500 index value here.
<int, Color>{
50: Color(0x00000000),
100: Color(0x19000000),
200: Color(0x33000000),
300: Color(0x4C000000),
400: Color(0x66000000),
500: Color(0x7F000000),
600: Color(0x99000000),
700: Color(0xB2000000),
800: Color(0xCC000000),
900: Color(0xE5000000),
50: Color(0xFFFFFFFF),
100: Color(0xFFF0EFFF),
200: Color(0xFFBAC3FF),
300: Color(0xFF7789F0),
400: Color(0xFF5D6FD4),
500: Color(0xFF4355B9),
600: Color(0xFF293CA0),
700: Color(0xFF08218A),
800: Color(0xFF00105C),
900: Color(0xFF000000),
},
);

Expand Down Expand Up @@ -134,6 +113,5 @@ class App {
ColorTools.createPrimarySwatch(deepBlueSea): 'Deep blue sea',
whiteBlueBlack: 'White via Blue to Black',
whiteToBlack: 'White to black',
blackTransparency: 'Black transparency',
};
}
2 changes: 0 additions & 2 deletions example/lib/demo/utils/keys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class Keys {
static const String tonalSameSize = 'tonalSameSize';
static const String includeIndex850 = 'includeIndex850';
static const String enableOpacity = 'enableOpacity';
static const String enableTransparency = 'enableTransparency';
static const String showMaterialName = 'showMaterialName';
static const String showColorName = 'showColorName';
static const String showColorCode = 'showColorCode';
Expand Down Expand Up @@ -100,7 +99,6 @@ class Keys {
tonalSameSize: false,
includeIndex850: false,
enableOpacity: true,
enableTransparency: false,
showMaterialName: true,
showColorName: true,
showColorCode: true,
Expand Down
2 changes: 0 additions & 2 deletions example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,6 @@ class _ColorPickerPageState extends State<ColorPickerPage> {
ColorPickerType.custom: true,
ColorPickerType.wheel: true,
},
enableTonalPalette: true, // Enable tonal palette

customColorSwatchesAndNames: colorsNameMap,
).showPickerDialog(
context,
Expand Down
Loading

0 comments on commit 454e77b

Please sign in to comment.