import 'package:charset_converter/charset_converter.dart';
onChanged: (String value) async {
final int _StringCount = 0;
await Future.forEach(value.runes, (int rune) async {
List<int> bytes = await CharsetConverter.encode('cp932', String.fromCharCode(rune));
_StringCount += bytes.length;/// 2 = 全角, 1 = 半角
});
setState(() {
_fullCount = _StringCount / 2;///全角文字数
});
},
More than 1 year has passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme