Chris Bracken 796b559455 Extract a TextRange class for selection (flutter/engine#21722)
Extracts a TextRange class with a base and extent, and start(), end(),
collapsed(), and length() getters.

The possibility of reversed base and extent in selections and composing
ranges makes reasoning about them complex and increases the chances of
errors in the code. This change migrates most uses of base and extent in
the text model to start()/end() or position(). The position() method is
intended purely as an aid to readability to indicate that a collapsed
selection is expected at the call site; it also enforces a debug-time
assertion that this is the case.
2020-10-12 17:50:11 -07:00
..