alnah005 / Konkan

Flutter game that is popular in my home country (Yemen)
1 stars 0 forks source link

When drawing deck reaches the end, an unexpected error occurs #39

Closed alnah005 closed 4 years ago

alnah005 commented 4 years ago

image

after clicking the deck again

image

Then the cards are not distributed correctly

alnah005 commented 4 years ago

image

FaisalAlwazir commented 4 years ago

Here's the console log for reference.

════════ Exception caught by gesture library ═══════════════════════════════════════════════════════ The following RangeError was thrown while routing a pointer event: RangeError (index): Invalid value: Valid value range is empty: -1

When the exception was thrown, this was the stack:

0 List.[] (dart:core-patch/growable_array.dart:146:60)

1 List.removeLast (dart:core-patch/growable_array.dart:212:20)

2 _GameScreenState._buildFinalDecks. (package:solitaire/pages/game_screen.dart:476:38)

3 _EmptyCardDeckState.build. (package:solitaire/widgets/empty_card.dart:81:27)

4 _DragTargetState.didDrop (package:flutter/src/widgets/drag_target.dart:555:22)

... Event: PointerUpEvent#b20a7(position: Offset(213.7, 262.8)) position: Offset(213.7, 262.8) ════════════════════════════════════════════════════════════════════════════════════════════════════

bug3

FaisalAlwazir commented 4 years ago

Fixed after https://github.com/alnah005/Konkan/commit/369d041b64f7d0ae935ec28432bdcdaf4aedb424