feat: migrate to flutter 3.22

This commit is contained in:
Freek van de Ven 2024-06-17 16:31:25 +02:00
parent 9d476129fd
commit 567765f856
9 changed files with 15 additions and 12 deletions

View file

@ -1,3 +1,6 @@
## 4.1.0
- Migrate to flutter 3.22 which deprecates the background and onBackground properties in the ThemeData and also removes MaterialStatePropertyAll
## 4.0.0
- Add a serviceBuilder to the userstory configuration

View file

@ -32,7 +32,7 @@ class GoRouterApp extends StatelessWidget {
seedColor: const Color(0xFFB8E2E8),
primary: const Color(0xffb71c6d),
).copyWith(
background: const Color(0XFFFAF9F6),
surface: const Color(0XFFFAF9F6),
),
useMaterial3: true,
),

View file

@ -12,7 +12,7 @@ class NavigatorApp extends StatelessWidget {
theme: ThemeData(
colorScheme:
ColorScheme.fromSeed(seedColor: Colors.deepPurple).copyWith(
background: const Color(0xFFB8E2E8),
surface: const Color(0xFFB8E2E8),
),
useMaterial3: true,
),

View file

@ -13,7 +13,7 @@ class WidgetApp extends StatelessWidget {
theme: ThemeData(
colorScheme:
ColorScheme.fromSeed(seedColor: Colors.deepPurple).copyWith(
background: const Color(0xFFB8E2E8),
surface: const Color(0xFFB8E2E8),
),
useMaterial3: true,
),

View file

@ -201,7 +201,7 @@ class _TimelinePostCreationScreenState
context: context,
builder: (context) => Container(
padding: const EdgeInsets.all(8.0),
color: theme.colorScheme.background,
color: theme.colorScheme.surface,
child: ImagePicker(
imagePickerConfig: widget.options.imagePickerConfig,
imagePickerTheme: widget.options.imagePickerTheme,
@ -320,7 +320,7 @@ class _TimelinePostCreationScreenState
)
: ElevatedButton(
style: ButtonStyle(
backgroundColor: MaterialStatePropertyAll(
backgroundColor: WidgetStatePropertyAll(
theme.colorScheme.primary,
),
),

View file

@ -58,7 +58,7 @@ class TimelinePostOverviewScreen extends StatelessWidget {
ElevatedButton(
style: ButtonStyle(
backgroundColor:
MaterialStatePropertyAll(Theme.of(context).primaryColor),
WidgetStatePropertyAll(Theme.of(context).primaryColor),
),
onPressed: () {
onPostSubmit(timelinePost);

View file

@ -563,7 +563,7 @@ class _TimelinePostScreenState extends State<TimelinePostScreen> {
context: context,
builder: (context) => Container(
padding: const EdgeInsets.all(8.0),
color: theme.colorScheme.background,
color: theme.colorScheme.surface,
child: ImagePicker(
imagePickerConfig: widget.options.imagePickerConfig,
imagePickerTheme: widget.options.imagePickerTheme,

View file

@ -28,20 +28,20 @@ class CategorySelectorButton extends StatelessWidget {
onPressed: onTap,
style: ButtonStyle(
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
padding: const MaterialStatePropertyAll(
padding: const WidgetStatePropertyAll(
EdgeInsets.symmetric(
vertical: 5,
horizontal: 12,
),
),
fixedSize: MaterialStatePropertyAll(Size(140, isOnTop ? 140 : 20)),
backgroundColor: MaterialStatePropertyAll(
fixedSize: WidgetStatePropertyAll(Size(140, isOnTop ? 140 : 20)),
backgroundColor: WidgetStatePropertyAll(
selected
? theme.colorScheme.primary
: options.theme.categorySelectionButtonBackgroundColor ??
Colors.transparent,
),
shape: MaterialStatePropertyAll(
shape: WidgetStatePropertyAll(
RoundedRectangleBorder(
borderRadius: const BorderRadius.all(
Radius.circular(8),

View file

@ -33,7 +33,7 @@ class _ReactionBottomState extends State<ReactionBottom> {
Widget build(BuildContext context) => SafeArea(
bottom: true,
child: Container(
color: Theme.of(context).colorScheme.background,
color: Theme.of(context).colorScheme.surface,
child: Container(
margin: const EdgeInsets.symmetric(
horizontal: 12,