Skip to content

Commit

Permalink
Migrate MaterialStateProperty to WidgetStateProperty
Browse files Browse the repository at this point in the history
  • Loading branch information
Piinks committed May 15, 2024
1 parent 87a02e3 commit 8b68daa
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
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

0 comments on commit 8b68daa

Please sign in to comment.