chore: upgrade to riverpod 3.x and freezed 3.x
- Upgrade flutter_riverpod to 3.1.0, riverpod_annotation to 4.0.0 - Upgrade freezed to 3.2.3, freezed_annotation to 3.1.0 - Migrate freezed classes to use sealed keyword (freezed 3.x) - Update provider naming (*NotifierProvider → *Provider) - Add legacy.dart import for StateNotifierProvider compatibility - Fix valueOrNull → value for AsyncValue - Remove unused imports and fields - Add sync from Authentik button to users/groups pages - Suppress invalid_annotation_target warning in analysis_options 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.5
parent
0de79fba26
commit
6989241ae7
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_riverpod/legacy.dart';
|
||||
|
||||
import 'data_grid_config.dart';
|
||||
import 'data_grid_provider.dart';
|
||||
import 'data_grid_source.dart';
|
||||
import 'data_grid_state.dart';
|
||||
import 'widgets/data_grid_bulk_actions.dart';
|
||||
import 'widgets/data_grid_empty_state.dart';
|
||||
|
||||
@@ -75,6 +75,9 @@
|
||||
/// ```
|
||||
library;
|
||||
|
||||
export 'package:flutter_riverpod/legacy.dart'
|
||||
show StateNotifierProvider, StateNotifier;
|
||||
|
||||
export 'data_grid.dart';
|
||||
export 'data_grid_action.dart';
|
||||
export 'data_grid_column.dart';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:flutter_riverpod/legacy.dart';
|
||||
|
||||
import 'data_grid_config.dart';
|
||||
import 'data_grid_source.dart';
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'data_grid_state.freezed.dart';
|
||||
|
||||
/// State for a DataGrid instance.
|
||||
@freezed
|
||||
class DataGridState<T> with _$DataGridState<T> {
|
||||
sealed class DataGridState<T> with _$DataGridState<T> {
|
||||
const factory DataGridState({
|
||||
/// Current items being displayed.
|
||||
@Default([]) List<T> items,
|
||||
|
||||
@@ -12,7 +12,7 @@ class ProfileDropdown extends ConsumerWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final authState = ref.watch(authNotifierProvider);
|
||||
final authState = ref.watch(authProvider);
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
|
||||
return authState.when(
|
||||
@@ -94,7 +94,7 @@ class ProfileDropdown extends ConsumerWidget {
|
||||
case 'settings':
|
||||
context.go(AppRoutes.settings);
|
||||
case 'logout':
|
||||
ref.read(authNotifierProvider.notifier).signOut();
|
||||
ref.read(authProvider.notifier).signOut();
|
||||
}
|
||||
},
|
||||
),
|
||||
@@ -106,7 +106,7 @@ class ProfileDropdown extends ConsumerWidget {
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
),
|
||||
error: (_, __) => CircleAvatar(
|
||||
error: (err, stack) => CircleAvatar(
|
||||
radius: 18,
|
||||
backgroundColor: colorScheme.errorContainer,
|
||||
child: Icon(
|
||||
|
||||
@@ -81,7 +81,7 @@ class TopHeaderBar extends StatelessWidget {
|
||||
'assets/icons/logo.png',
|
||||
height: _logoSize,
|
||||
width: _logoSize,
|
||||
errorBuilder: (_, __, ___) => Icon(
|
||||
errorBuilder: (context, error, stack) => Icon(
|
||||
Icons.layers,
|
||||
size: 32,
|
||||
color: colorScheme.primary,
|
||||
|
||||
Reference in New Issue
Block a user