Skip to content

Commit 6f5d92d

Browse files
Remove the input type and action from TextInputModel. (flutter#18919)
These aren't used by the model so are better managed outside of it.
1 parent e646c2b commit 6f5d92d

File tree

8 files changed

+87
-94
lines changed

8 files changed

+87
-94
lines changed

shell/platform/common/cpp/text_input_model.cc

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,8 @@ bool IsTrailingSurrogate(char32_t code_point) {
2929

3030
} // namespace
3131

32-
TextInputModel::TextInputModel(const std::string& input_type,
33-
const std::string& input_action)
34-
: input_type_(input_type),
35-
input_action_(input_action),
36-
selection_base_(text_.begin()),
37-
selection_extent_(text_.begin()) {}
32+
TextInputModel::TextInputModel()
33+
: selection_base_(text_.begin()), selection_extent_(text_.begin()) {}
3834

3935
TextInputModel::~TextInputModel() = default;
4036

shell/platform/common/cpp/text_input_model.h

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ namespace flutter {
1414
// Ignores special states like "insert mode" for now.
1515
class TextInputModel {
1616
public:
17-
TextInputModel(const std::string& input_type,
18-
const std::string& input_action);
17+
TextInputModel();
1918
virtual ~TextInputModel();
2019

2120
// Attempts to set the text state.
@@ -111,20 +110,10 @@ class TextInputModel {
111110
return static_cast<int>(selection_extent_ - text_.begin());
112111
}
113112

114-
// Keyboard type of the client. See available options:
115-
// https://docs.flutter.io/flutter/services/TextInputType-class.html
116-
std::string input_type() const { return input_type_; }
117-
118-
// An action requested by the user on the input client. See available options:
119-
// https://docs.flutter.io/flutter/services/TextInputAction-class.html
120-
std::string input_action() const { return input_action_; }
121-
122113
private:
123114
void DeleteSelected();
124115

125116
std::u16string text_;
126-
std::string input_type_;
127-
std::string input_action_;
128117
std::u16string::iterator selection_base_;
129118
std::u16string::iterator selection_extent_;
130119
};

0 commit comments

Comments
 (0)