From c78b873f7d426c75c33b33576cf04acefb68484b Mon Sep 17 00:00:00 2001 From: Kevin Moore Date: Fri, 14 Jun 2019 11:33:32 -0700 Subject: [PATCH] Revert "web: slide_puzzle - update to latest provider port" Seeing an issue with generics and dart2js (or DDC) This reverts commit 7a4226334442e21e0c970d3b94ec2663dd2347a2. --- .../lib/src/puzzle_home_state.dart | 156 +++++++++--------- .../lib/src/value_tab_controller.dart | 2 +- web/slide_puzzle/pubspec.lock | 4 +- 3 files changed, 84 insertions(+), 78 deletions(-) diff --git a/web/slide_puzzle/lib/src/puzzle_home_state.dart b/web/slide_puzzle/lib/src/puzzle_home_state.dart index 3d3e24017..c44f5e660 100644 --- a/web/slide_puzzle/lib/src/puzzle_home_state.dart +++ b/web/slide_puzzle/lib/src/puzzle_home_state.dart @@ -90,7 +90,7 @@ class PuzzleHomeState extends State providers: [ Provider.value(value: this), ListenableProvider.value( - value: _autoPlayListenable, + listenable: _autoPlayListenable, ) ], child: Material( @@ -201,85 +201,91 @@ Widget _doBuildCore(bool small) => ValueTabController( values: themes, child: Consumer( builder: (_, theme, __) => AnimatedContainer( - duration: puzzleAnimationDuration, - color: theme.puzzleThemeBackground, - child: Center( - child: theme.styledWrapper( - small, - SizedBox( - width: 580, - child: Consumer( - builder: (context, appState, _) => Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - decoration: const BoxDecoration( - border: Border( - bottom: BorderSide( - color: Colors.black26, - width: 1, - ), - ), - ), - margin: const EdgeInsets.symmetric(horizontal: 20), - child: TabBar( - controller: ValueTabController.of(context), - labelPadding: const EdgeInsets.fromLTRB(0, 20, 0, 12), - labelColor: theme.puzzleAccentColor, - indicatorColor: theme.puzzleAccentColor, - indicatorWeight: 1.5, - unselectedLabelColor: Colors.black.withOpacity(0.6), - tabs: themes - .map((st) => Text( - st.name.toUpperCase(), - style: const TextStyle( - letterSpacing: 0.5, + duration: puzzleAnimationDuration, + color: theme.puzzleThemeBackground, + child: Center( + child: theme.styledWrapper( + small, + SizedBox( + width: 580, + child: Consumer( + builder: (context, appState, _) => Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + Container( + decoration: const BoxDecoration( + border: Border( + bottom: BorderSide( + color: Colors.black26, + width: 1, ), - )) - .toList(), - ), - ), - Flexible( - child: Container( - padding: const EdgeInsets.all(10), - child: Flow( - delegate: PuzzleFlowDelegate( - small ? const Size(90, 90) : const Size(140, 140), - appState.puzzle, - appState.animationNotifier, - ), - children: List.generate( - appState.puzzle.length, - (i) => theme.tileButtonCore( - i, appState.puzzle, small), - ), - ), - ), - ), - Container( - decoration: const BoxDecoration( - border: Border( - top: BorderSide(color: Colors.black26, width: 1), + ), + ), + margin: + const EdgeInsets.symmetric(horizontal: 20), + child: TabBar( + controller: ValueTabController.of(context), + labelPadding: + const EdgeInsets.fromLTRB(0, 20, 0, 12), + labelColor: theme.puzzleAccentColor, + indicatorColor: theme.puzzleAccentColor, + indicatorWeight: 1.5, + unselectedLabelColor: + Colors.black.withOpacity(0.6), + tabs: themes + .map((st) => Text( + st.name.toUpperCase(), + style: const TextStyle( + letterSpacing: 0.5, + ), + )) + .toList(), + ), + ), + Flexible( + child: Container( + padding: const EdgeInsets.all(10), + child: Flow( + delegate: PuzzleFlowDelegate( + small + ? const Size(90, 90) + : const Size(140, 140), + appState.puzzle, + appState.animationNotifier, + ), + children: List.generate( + appState.puzzle.length, + (i) => theme.tileButtonCore( + i, appState.puzzle, small), + ), + ), + ), + ), + Container( + decoration: const BoxDecoration( + border: Border( + top: BorderSide( + color: Colors.black26, width: 1), + ), + ), + padding: const EdgeInsets.only( + left: 10, + bottom: 6, + top: 2, + right: 10, + ), + child: Consumer( + builder: (_, controls, __) => Row( + children: theme.bottomControls(controls)), + ), + ) + ], ), - ), - padding: const EdgeInsets.only( - left: 10, - bottom: 6, - top: 2, - right: 10, - ), - child: Consumer( - builder: (_, controls, __) => - Row(children: theme.bottomControls(controls)), - ), - ) - ], + ), ), ), ), ), - ), - ), ), ); diff --git a/web/slide_puzzle/lib/src/value_tab_controller.dart b/web/slide_puzzle/lib/src/value_tab_controller.dart index c0bc2eb6f..095c29ca6 100644 --- a/web/slide_puzzle/lib/src/value_tab_controller.dart +++ b/web/slide_puzzle/lib/src/value_tab_controller.dart @@ -68,7 +68,7 @@ class _ValueTabControllerState extends State> controller: _controller, enabled: TickerMode.of(context), child: ValueListenableProvider.value( - value: _notifier, + valueListenable: _notifier, child: widget.child, ), ); diff --git a/web/slide_puzzle/pubspec.lock b/web/slide_puzzle/pubspec.lock index 96d0d1314..afad062a7 100644 --- a/web/slide_puzzle/pubspec.lock +++ b/web/slide_puzzle/pubspec.lock @@ -339,10 +339,10 @@ packages: description: path: "." ref: flutter_web - resolved-ref: e41db8e7d554360a6d8314c23b4fb4d5d5d9aac4 + resolved-ref: "5cf4521d4d635d7d7ca8ddbd6e28048a7f319ee0" url: "https://github.com/kevmoo/provider" source: git - version: "3.0.0+1" + version: "2.1.0" pub_semver: dependency: transitive description: