anchor.diff:  import 'dart:math' as math;
   import 'dart:sky' as sky;
   
  -import '../animation/animated_value.dart';
  +import '../animation/animation_performance.dart';
   import '../painting/box_painter.dart';
   import '../theme/colors.dart';
   import '../theme/shadows.dart';
  
positive.code:       backgroundColor: Grey[50],
        borderRadius: 2.0,
        boxShadow: shadows[level]));
      watch(controller.position);
    }
  
    PopupMenuController controller;
  
negative.code: const double _kMenuHorizontalPadding = 16.0;
  const double _kMenuVerticalPadding = 8.0;
  
  enum MenuState { closed, opening, open, closing }
  
  class PopupMenuController {
  
    PopupMenuController() {
      position = new AnimatedType<double>(0.0, end: 1.0);
      performance = new AnimationPerformance()
        ..variable = position
        ..addListener(_updateState);
    }
  
    AnimatedType<double> position;
    AnimationPerformance performance;
  
    MenuState _state = MenuState.closed;
    MenuState get state => _state;
  
    bool get canReact => (_state == MenuState.opening) || (_state == MenuState.open);
  
    void _updateState() {
      if (position.value == 0.0) {
        _state = MenuState.closed;
        if (_closeCompleter != null)
          _closeCompleter.complete();
        return;
      }
  
      if (position.value == 1.0)
        _state = MenuState.open;
    }
  
    Completer _closeCompleter;
    Timer _closeTimer;
  
    void open() {
      if (_state != MenuState.closed)
        return;
      if (_closeTimer != null) {
        _closeTimer.cancel();
        _closeTimer = null;
      }
      _closeCompleter = null;
      _state = MenuState.opening;
      performance..duration = _kMenuOpenDuration
                 ..play();
    }
  
    Future close() {
      if (_state == MenuState.closing || _state == MenuState.closed)
        return _closeCompleter.future;
  
      _state = MenuState.closing;
      assert(_closeCompleter == null);
      _closeCompleter = new Completer();
      performance.duration = _kMenuCloseDuration;
  
      assert(_closeTimer == null);
      _closeTimer = new Timer(_kMenuCloseDelay, performance.reverse);
  
      return _closeCompleter.future;
    }
  }
  
  