Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Migrate MaterialStateProperty to WidgetStateProperty
  • Loading branch information
Piinks committed May 29, 2024
commit 1534a1bbd57a4d7ed445863a2b44f4d5da700ea1
12 changes: 6 additions & 6 deletions packages/flutter_adaptive_scaffold/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -863,14 +863,14 @@ class _EmailTile extends StatelessWidget {
child: OutlinedButton(
onPressed: () {},
style: ButtonStyle(
shape: MaterialStateProperty.all(
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0)),
),
backgroundColor: MaterialStateProperty.all<Color>(
backgroundColor: WidgetStateProperty.all<Color>(
const Color.fromARGB(255, 245, 241, 248),
),
side: MaterialStateProperty.all(
side: WidgetStateProperty.all(
const BorderSide(
width: 0.0, color: Colors.transparent),
),
Expand All @@ -885,14 +885,14 @@ class _EmailTile extends StatelessWidget {
child: OutlinedButton(
onPressed: () {},
style: ButtonStyle(
shape: MaterialStateProperty.all(
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(30.0)),
),
backgroundColor: MaterialStateProperty.all<Color>(
backgroundColor: WidgetStateProperty.all<Color>(
const Color.fromARGB(255, 245, 241, 248),
),
side: MaterialStateProperty.all(
side: WidgetStateProperty.all(
const BorderSide(
width: 0.0, color: Colors.transparent),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,8 @@ class AdaptiveScaffold extends StatefulWidget {
NavigationBarTheme.of(context);
return NavigationBarTheme(
data: currentNavBarTheme.copyWith(
iconTheme: MaterialStateProperty.resolveWith(
(Set<MaterialState> states) {
iconTheme: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
return currentNavBarTheme.iconTheme
?.resolve(states)
?.copyWith(size: iconSize) ??
Expand Down
4 changes: 2 additions & 2 deletions packages/rfw/lib/src/flutter/material_widgets.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ import 'runtime.dart';
/// * Theming in general is not currently supported.
///
/// * Properties whose values are [Animation]s or based on
/// [MaterialStateProperty] are not supported.
/// [WidgetStateProperty] are not supported.
///
/// * Features related to focus or configuring mouse support are not
/// implemented.
Expand All @@ -94,7 +94,7 @@ import 'runtime.dart';
///
/// In general, the trend will all of these unsupported features is that this
/// library doesn't support features that can't be trivially expressed using the
/// JSON-like structures of RFW. For example, [MaterialStateProperty] is
/// JSON-like structures of RFW. For example, [WidgetStateProperty] is
/// designed to be used with code to select the values, which doesn't work well
/// in the RFW structure.
LocalWidgetLibrary createMaterialWidgets() => LocalWidgetLibrary(_materialWidgetsDefinitions);
Expand Down