Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated to provider 3.1.0 #145

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
14 changes: 7 additions & 7 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ class _MyAppState extends State<MyApp> {
return MultiProvider(
providers: [
ChangeNotifierProvider(builder: (_) => User()),
ChangeNotifierProvider.value(notifier: world),
ChangeNotifierProvider.value(notifier: world.characterPool),
ChangeNotifierProvider.value(notifier: world.taskPool),
ChangeNotifierProvider.value(notifier: world.company),
ChangeNotifierProvider.value(notifier: world.company.users),
ChangeNotifierProvider.value(notifier: world.company.joy),
ChangeNotifierProvider.value(notifier: world.company.coin),
ChangeNotifierProvider.value(value: world),
ChangeNotifierProvider.value(value: world.characterPool),
ChangeNotifierProvider.value(value: world.taskPool),
ChangeNotifierProvider.value(value: world.company),
ChangeNotifierProvider.value(value: world.company.users),
ChangeNotifierProvider.value(value: world.company.joy),
ChangeNotifierProvider.value(value: world.company.coin),
],
child: MaterialApp(
title: 'Flutter Demo',
Expand Down
4 changes: 2 additions & 2 deletions lib/src/game_screen/character_pool_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CharacterPoolPage extends StatelessWidget {
gridDelegate: _gridStructure,
itemBuilder: (context, index) =>
ChangeNotifierProvider<Character>.value(
notifier: characterPool.children[index],
value: characterPool.children[index],
key: ValueKey(characterPool.children[index]),
child: CharacterListItem(),
),
Expand Down Expand Up @@ -132,7 +132,7 @@ class CharacterDisplay extends StatelessWidget {
context: context,
builder: (BuildContext context) {
return ChangeNotifierProvider<Character>.value(
notifier: character,
value: character,
child: CharacterModal(),
);
});
Expand Down
2 changes: 1 addition & 1 deletion lib/src/game_screen/task_pool_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TaskPoolPage extends StatelessWidget {
delegate: SliverChildBuilderDelegate((context, index) {
WorkItem item = workItems[index];
return ChangeNotifierProvider<WorkItem>.value(
notifier: item,
value: item,
key: ValueKey(item),
child: item is Bug ? BugListItem() : TaskListItem(),
);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
flutter:
sdk: flutter
intl: any
provider: ^2.0.0
provider: ^3.1.0

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down