Skip to content

Commit 1bbdf4d

Browse files
committed
Refactor ElevatedButton to Button and update references
Replaces the ElevatedButton control with Button throughout the codebase, consolidating button logic into a single Button class. ElevatedButton is now a deprecated alias for Button. Updates all usages, tests, and control registration to use Button, simplifying the API and improving maintainability.
1 parent 0b3d789 commit 1bbdf4d

42 files changed

Lines changed: 267 additions & 379 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/flet/lib/src/flet_core_extension.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ class FletCoreExtension extends FletExtension {
244244
return ExpansionPanelListControl(key: key, control: control);
245245
case "ExpansionTile":
246246
return ExpansionTileControl(key: key, control: control);
247-
case "ElevatedButton":
247+
case "Button":
248248
case "FilledButton":
249249
case "FilledTonalButton":
250250
case "TextButton":

packages/flet/lib/src/utils/theme.dart

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ ThemeData parseTheme(
184184
navigationBarTheme:
185185
parseNavigationBarTheme(value?["navigation_bar_theme"], theme),
186186
dataTableTheme: parseDataTableTheme(value?["data_table_theme"], context),
187-
elevatedButtonTheme:
188-
parseElevatedButtonTheme(value?["elevated_button_theme"], theme),
187+
elevatedButtonTheme: parseButtonTheme(value?["button_theme"], theme),
189188
outlinedButtonTheme:
190189
parseOutlinedButtonTheme(value?["outlined_button_theme"], theme),
191190
textButtonTheme: parseTextButtonTheme(value?["text_button_theme"], theme),
@@ -284,7 +283,7 @@ TextTheme? parseTextTheme(
284283
);
285284
}
286285

287-
ElevatedButtonThemeData? parseElevatedButtonTheme(
286+
ElevatedButtonThemeData? parseButtonTheme(
288287
Map<dynamic, dynamic>? value, ThemeData theme,
289288
[ElevatedButtonThemeData? defaultValue]) {
290289
if (value == null) return defaultValue;
@@ -1185,10 +1184,9 @@ extension ThemeParsers on Control {
11851184
);
11861185
}
11871186

1188-
ElevatedButtonThemeData? getElevatedButtonTheme(
1189-
String propertyName, ThemeData theme,
1187+
ElevatedButtonThemeData? getButtonTheme(String propertyName, ThemeData theme,
11901188
[ElevatedButtonThemeData? defaultValue]) {
1191-
return parseElevatedButtonTheme(get(propertyName), theme, defaultValue);
1189+
return parseButtonTheme(get(propertyName), theme, defaultValue);
11921190
}
11931191

11941192
OutlinedButtonThemeData? getOutlinedButtonTheme(

sdk/python/examples/controls/elevated_button/animate_on_hover.py renamed to sdk/python/examples/controls/button/animate_on_hover.py

File renamed without changes.
File renamed without changes.

sdk/python/examples/controls/elevated_button/button_shapes.py renamed to sdk/python/examples/controls/button/button_shapes.py

File renamed without changes.

sdk/python/examples/controls/elevated_button/custom_content.py renamed to sdk/python/examples/controls/button/custom_content.py

File renamed without changes.

sdk/python/examples/controls/elevated_button/handling_clicks.py renamed to sdk/python/examples/controls/button/handling_clicks.py

File renamed without changes.
File renamed without changes.

sdk/python/examples/controls/elevated_button/media/adaptive.png renamed to sdk/python/examples/controls/button/media/adaptive.png

File renamed without changes.

sdk/python/examples/controls/elevated_button/media/basic.png renamed to sdk/python/examples/controls/button/media/basic.png

File renamed without changes.

0 commit comments

Comments
 (0)