Skip to content

Commit 7e6f7d3

Browse files
committed
Release Flet 1.0 Beta and update color handling
Bump package version to 0.80.0 for Flet 1.0 Beta release. Improve color handling by replacing withOpacity with withValues and updating color conversion logic to use 8-bit components. Refactor deprecated properties and clean up unused variables and imports. Update dependencies in pubspec.yaml to use caret versions.
1 parent d8207d0 commit 7e6f7d3

File tree

15 files changed

+59
-39
lines changed

15 files changed

+59
-39
lines changed

client/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ packages:
295295
path: "../packages/flet"
296296
relative: true
297297
source: path
298-
version: "0.70.0"
298+
version: "0.80.0"
299299
flet_ads:
300300
dependency: "direct main"
301301
description:

packages/flet/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 0.80.0
2+
3+
* **Flet 1.0 Beta Release**[Read the announcement](https://flet.dev/blog/flet-1-0-beta)
4+
15
# 0.70.0
26

37
* **Flet 1.0 Alpha Released**[Read the announcement](https://flet.dev/blog/introducing-flet-1-0-alpha)

packages/flet/lib/src/controls/button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class _ButtonControlState extends State<ButtonControl> with FletStoreMixin {
104104
widget.control.getColor("color", context, theme.colorScheme.primary)!,
105105
defaultBackgroundColor: widget.control
106106
.getColor("bgcolor", context, theme.colorScheme.surface)!,
107-
defaultOverlayColor: theme.colorScheme.primary.withOpacity(0.08),
107+
defaultOverlayColor: theme.colorScheme.primary.withValues(alpha: 0.08),
108108
defaultShadowColor: theme.colorScheme.shadow,
109109
defaultSurfaceTintColor: theme.colorScheme.surfaceTint,
110110
defaultElevation: widget.control.getDouble("elevation", 1)!,

packages/flet/lib/src/controls/cupertino_app_bar.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class CupertinoAppBarControl extends StatelessWidget
9191
final Color backgroundColor = CupertinoDynamicColor.maybeResolve(
9292
control.getColor("bgcolor", context), context) ??
9393
CupertinoTheme.of(context).barBackgroundColor;
94-
return backgroundColor.alpha == 0xFF;
94+
final alpha8 = (backgroundColor.a * 255.0).round().clamp(0, 255);
95+
return alpha8 == 0xFF;
9596
}
9697
}

packages/flet/lib/src/controls/navigation_drawer.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ class _NavigationDrawerControlState extends State<NavigationDrawerControl> {
3636
debugPrint("NavigationDrawerControl build: ${widget.control.id}");
3737

3838
var selectedIndex = widget.control.getInt("selected_index", 0)!;
39-
var endDrawer = widget.control.get("position") == "end";
4039

4140
if (_selectedIndex != selectedIndex) {
4241
_selectedIndex = selectedIndex;

packages/flet/lib/src/controls/progress_bar.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ class ProgressBarControl extends StatelessWidget {
2828
stopIndicatorColor: control.getColor("stop_indicator_color", context),
2929
stopIndicatorRadius: control.getDouble("stop_indicator_radius"),
3030
trackGap: control.getDouble("track_gap"),
31+
// ignore: deprecated_member_use
3132
year2023: control.getBool(
3233
"year_2023"), // todo: deprecated and to be removed in future versions
3334
);

packages/flet/lib/src/controls/progress_ring.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ProgressRingControl extends StatelessWidget {
3131
trackGap: control.getDouble("track_gap"),
3232
constraints: control.getBoxConstraints("size_constraints"),
3333
padding: control.getPadding("padding"),
34+
// ignore: deprecated_member_use
3435
year2023: control.getBool(
3536
"year2023"), // todo: deprecated and to be removed in future versions
3637
);

packages/flet/lib/src/controls/search_bar.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class SearchBarControl extends StatefulWidget {
2626
class _SearchBarControlState extends State<SearchBarControl> {
2727
late final SearchController _controller;
2828

29-
bool _focused = false;
3029
TextCapitalization? _textCapitalization;
3130
late final FocusNode _focusNode;
3231
String? _lastFocusValue;
@@ -43,9 +42,6 @@ class _SearchBarControlState extends State<SearchBarControl> {
4342
}
4443

4544
void _onFocusChange() {
46-
setState(() {
47-
_focused = _focusNode.hasFocus;
48-
});
4945
widget.control.triggerEvent(_focusNode.hasFocus ? "focus" : "blur");
5046
}
5147

packages/flet/lib/src/controls/segmented_button.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class _SegmentedButtonControlState extends State<SegmentedButtonControl>
3737
var style = widget.control.getButtonStyle("style", Theme.of(context),
3838
defaultForegroundColor: theme.colorScheme.primary,
3939
defaultBackgroundColor: theme.colorScheme.surface,
40-
defaultOverlayColor: theme.colorScheme.primary.withOpacity(0.08),
40+
defaultOverlayColor: theme.colorScheme.primary.withValues(alpha: 0.08),
4141
defaultShadowColor: theme.colorScheme.shadow,
4242
defaultSurfaceTintColor: theme.colorScheme.surfaceTint,
4343
defaultElevation: 1,

packages/flet/lib/src/controls/slider.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class _SliderControlState extends State<SliderControl> {
7575
min: min,
7676
max: max,
7777
// todo: remove deprecated property year2023
78+
// ignore: deprecated_member_use
7879
year2023: widget.control.getBool("year_2023"),
7980
divisions: widget.control.getInt("divisions"),
8081
label: label?.replaceAll("{value}", _value.toStringAsFixed(round)),

0 commit comments

Comments
 (0)