From d810733be4e90c0c751539152801c2071b42ee1d Mon Sep 17 00:00:00 2001 From: Filip Hracek Date: Mon, 22 Apr 2019 10:11:48 -0700 Subject: [PATCH 1/3] Upgrade package:provider to 2.0.0-dev --- lib/main.dart | 10 +++++----- lib/src/game_screen/character_pool_page.dart | 5 +++-- lib/src/game_screen/task_pool_page.dart | 2 +- pubspec.yaml | 7 +------ 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 40adbee..1548da2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,11 +27,11 @@ class _MyAppState extends State { Widget build(BuildContext context) { return MultiProvider( providers: [ - ChangeNotifierProvider(notifier: User()), - ChangeNotifierProvider(notifier: widget.world), - ChangeNotifierProvider(notifier: widget.world.characterPool), - ChangeNotifierProvider(notifier: widget.world.taskPool), - ChangeNotifierProvider(notifier: widget.world.company), + ChangeNotifierProvider(builder: (_) => User()), + ChangeNotifierProvider.value(notifier: widget.world), + ChangeNotifierProvider.value(notifier: widget.world.characterPool), + ChangeNotifierProvider.value(notifier: widget.world.taskPool), + ChangeNotifierProvider.value(notifier: widget.world.company), ], child: MaterialApp( title: 'Flutter Demo', diff --git a/lib/src/game_screen/character_pool_page.dart b/lib/src/game_screen/character_pool_page.dart index 0b43035..037e96f 100644 --- a/lib/src/game_screen/character_pool_page.dart +++ b/lib/src/game_screen/character_pool_page.dart @@ -20,7 +20,8 @@ class CharacterPoolPage extends StatelessWidget { const EdgeInsets.only(left: 15.0, right: 15.0, bottom: 128.0), itemCount: characterPool.children.length, gridDelegate: _gridStructure, - itemBuilder: (context, index) => ChangeNotifierProvider( + itemBuilder: (context, index) => + ChangeNotifierProvider.value( notifier: characterPool.children[index], key: ValueKey(characterPool.children[index]), child: CharacterListItem(), @@ -153,7 +154,7 @@ class CharacterDisplay extends StatelessWidget { showDialog( context: context, builder: (BuildContext context) { - return ChangeNotifierProvider( + return ChangeNotifierProvider.value( notifier: character, child: CharacterModal(), ); diff --git a/lib/src/game_screen/task_pool_page.dart b/lib/src/game_screen/task_pool_page.dart index 7ba5d7f..d07a490 100644 --- a/lib/src/game_screen/task_pool_page.dart +++ b/lib/src/game_screen/task_pool_page.dart @@ -25,7 +25,7 @@ class TaskPoolPage extends StatelessWidget { slivers.add(SliverList( delegate: SliverChildBuilderDelegate((context, index) { WorkItem item = workItems[index]; - return ChangeNotifierProvider( + return ChangeNotifierProvider.value( notifier: item, key: ValueKey(item), child: item is Bug ? BugListItem() : TaskListItem(), diff --git a/pubspec.yaml b/pubspec.yaml index 76ee235..fa5caea 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,12 +16,7 @@ dependencies: flutter: sdk: flutter intl: any - provider: - git: - url: https://github.com/rrousselGit/provider.git - # Pin the package to a specific commit in the v2.0 branch. - # TODO: use pub once 2.0 lands there - ref: ac6813432f1700b24cf7e4e8ff3f173e105c7d66 + provider: ^2.0.0-dev # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. From a3def1e3013fb970b33b25d0c878c1ffec505d62 Mon Sep 17 00:00:00 2001 From: Filip Hracek Date: Mon, 22 Apr 2019 15:34:45 -0700 Subject: [PATCH 2/3] Apply dartfmt --- lib/src/game_screen/project_picker_modal.dart | 3 +-- lib/src/widgets/task_picker/task_picker_task.dart | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/src/game_screen/project_picker_modal.dart b/lib/src/game_screen/project_picker_modal.dart index 76d9f03..cae1a0b 100644 --- a/lib/src/game_screen/project_picker_modal.dart +++ b/lib/src/game_screen/project_picker_modal.dart @@ -119,8 +119,7 @@ class ProjectPickerModal extends StatelessWidget { // Prune, flatten, and build up the linear array task list. var alpha = _buildTaskPickerSlivers(taskPool.alpha.tasks, _tasks, completed); - var beta = - _buildTaskPickerSlivers(taskPool.beta.tasks, _tasks, completed); + var beta = _buildTaskPickerSlivers(taskPool.beta.tasks, _tasks, completed); var v1 = _buildTaskPickerSlivers(taskPool.v1.tasks, _tasks, completed); var slivers = [ diff --git a/lib/src/widgets/task_picker/task_picker_task.dart b/lib/src/widgets/task_picker/task_picker_task.dart index 49ee6da..4a9ec91 100644 --- a/lib/src/widgets/task_picker/task_picker_task.dart +++ b/lib/src/widgets/task_picker/task_picker_task.dart @@ -6,7 +6,7 @@ import 'package:flutter/material.dart'; // The display state for a widget in the task picker tree enum TaskDisplayState { complete, available, locked } -/// Task list item in the task picker. This widget is responsible for also +/// Task list item in the task picker. This widget is responsible for also /// drawing the set of lines in its row to build up a connected tree. class TaskPickerTask extends StatelessWidget { final TaskBlueprint blueprint; From 02d9da0a7aec24b9577d8f4dc43572836daa6ad2 Mon Sep 17 00:00:00 2001 From: Filip Hracek Date: Mon, 22 Apr 2019 15:43:50 -0700 Subject: [PATCH 3/3] Remove unused imports --- lib/src/widgets/work_items/task_list_item.dart | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/src/widgets/work_items/task_list_item.dart b/lib/src/widgets/work_items/task_list_item.dart index e4eef19..02681e9 100644 --- a/lib/src/widgets/work_items/task_list_item.dart +++ b/lib/src/widgets/work_items/task_list_item.dart @@ -1,11 +1,8 @@ -import 'package:dev_rpg/src/shared_state/game/skill.dart'; import 'package:dev_rpg/src/shared_state/game/task.dart'; import 'package:dev_rpg/src/shared_state/game/work_item.dart'; import 'package:dev_rpg/src/style.dart'; -import 'package:dev_rpg/src/widgets/work_items/skill_dot.dart'; import 'package:dev_rpg/src/widgets/work_items/task_header.dart'; import 'package:dev_rpg/src/widgets/work_items/work_list_item.dart'; -import 'package:flare_flutter/flare_actor.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart';