<commit_before>part of dart_flex;

class ScrollBinder {
  
  void bind(ListBase scrollViewA, ListBase scrollViewB, String scrollPolicy) {
    Future.wait([_getScrollTarget(scrollViewA), _getScrollTarget(scrollViewB)]).then(
      (List<ListRenderer> scrollTargets) {
        final ListRenderer scrollTargetA = scrollTargets.first;
        final ListRenderer scrollTargetB = scrollTargets.last;
        
        scrollTargetA.onListScrollPositionChanged.listen(
          (_) => scrollTargetB.scrollPosition = scrollTargetA.scrollPosition
        );
        
        scrollTargetA.onHeaderScrollPositionChanged.listen(
          (_) => scrollTargetB.headerScrollPosition = scrollTargetA.headerScrollPosition
        );
        
        scrollTargetB.onListScrollPositionChanged.listen(
          (_) => scrollTargetA.scrollPosition = scrollTargetB.scrollPosition
        );
        
        scrollTargetB.onHeaderScrollPositionChanged.listen(
          (_) => scrollTargetA.headerScrollPosition = scrollTargetB.headerScrollPosition
        );
      }
    );
  }
  
  Future<ListRenderer> _getScrollTarget(ListBase view) {
    if (view is DataGrid) {
      if (view.list == null) {<commit_msg>added H or V bind switch<commit_after>part of dart_flex;

class ScrollBinder {
  
  void bind(ListBase scrollViewA, ListBase scrollViewB, {bool bindHorizontally: false, bool bindVertically: false}) {
    Future.wait([_getScrollTarget(scrollViewA), _getScrollTarget(scrollViewB)]).then(
      (List<ListRenderer> scrollTargets) {
        final ListRenderer scrollTargetA = scrollTargets.first;
        final ListRenderer scrollTargetB = scrollTargets.last;
        
        if (bindVertically) {
          scrollTargetA.onListScrollPositionChanged.listen(
            (_) => scrollTargetB.scrollPosition = scrollTargetA.scrollPosition
          );
          
          scrollTargetB.onListScrollPositionChanged.listen(
            (_) => scrollTargetA.scrollPosition = scrollTargetB.scrollPosition
          );
        }
        
        if (bindHorizontally) {
          scrollTargetA.onHeaderScrollPositionChanged.listen(
            (_) => scrollTargetB.headerScrollPosition = scrollTargetA.headerScrollPosition
          );
          
          scrollTargetB.onHeaderScrollPositionChanged.listen(
            (_) => scrollTargetA.headerScrollPosition = scrollTargetB.headerScrollPosition
          );
        }
      }
    );
  }
  
  Future<ListRenderer> _getScrollTarget(ListBase view) {
    if (view is DataGrid) {
      if (view.list == null) {
{'fraction_non_alphanumeric': 0.08300550747442959, 'fraction_numerical': 0.0, 'mean_word_length': 2.8298192771084336, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3608180', 'n_tokens_mistral': 679, 'n_tokens_neox': 674, 'n_words': 105}