~cytrogen/fluent-reader-mobile

b66ca277e98b9b050c44d38dad119e30d1b5aa72 — Bruce Liu 5 years ago 0e14fd5
add text input types
M lib/pages/article_page.dart => lib/pages/article_page.dart +3 -0
@@ 95,6 95,9 @@ class ArticlePageState extends State<ArticlePage> {
      await Future.delayed(Duration(milliseconds: 300));
    }
    setState(() { loaded = true; });
    if (_target == SourceOpenTarget.Local || _target == SourceOpenTarget.FullContent) {
      navigated = true;
    }
  }
  void _onWebpageReady(_) {
    if (loaded) navigated = true;

M lib/pages/settings/services/feedbin_page.dart => lib/pages/settings/services/feedbin_page.dart +2 -1
@@ 32,6 32,7 @@ class _FeedbinPageState extends State<FeedbinPage> {
        S.of(context).endpoint, 
        Utils.testUrl,
        initialValue: _endpoint,
        inputType: TextInputType.url,
      ),
    ));
    if (endpoint == null) return;


@@ 55,7 56,7 @@ class _FeedbinPageState extends State<FeedbinPage> {
      builder: (context) => TextEditorPage(
        S.of(context).password, 
        Utils.notEmpty,
        isPassword: true,
        inputType: TextInputType.visiblePassword,
      ),
    ));
    if (password == null) return;

M lib/pages/settings/services/fever_page.dart => lib/pages/settings/services/fever_page.dart +2 -1
@@ 34,6 34,7 @@ class _FeverPageState extends State<FeverPage> {
        S.of(context).endpoint, 
        Utils.testUrl,
        initialValue: _endpoint,
        inputType: TextInputType.url,
      ),
    ));
    if (endpoint == null) return;


@@ 57,7 58,7 @@ class _FeverPageState extends State<FeverPage> {
      builder: (context) => TextEditorPage(
        S.of(context).password, 
        Utils.notEmpty,
        isPassword: true,
        inputType: TextInputType.visiblePassword,
      ),
    ));
    if (password == null) return;

M lib/pages/settings/services/greader_page.dart => lib/pages/settings/services/greader_page.dart +2 -1
@@ 33,6 33,7 @@ class _GReaderPageState extends State<GReaderPage> {
        S.of(context).endpoint, 
        Utils.testUrl,
        initialValue: _endpoint,
        inputType: TextInputType.url,
      ),
    ));
    if (endpoint == null) return;


@@ 56,7 57,7 @@ class _GReaderPageState extends State<GReaderPage> {
      builder: (context) => TextEditorPage(
        S.of(context).password, 
        Utils.notEmpty,
        isPassword: true,
        inputType: TextInputType.visiblePassword,
      ),
    ));
    if (password == null) return;

M lib/pages/settings/services/inoreader_page.dart => lib/pages/settings/services/inoreader_page.dart +2 -1
@@ 55,7 55,7 @@ class _InoreaderPageState extends State<InoreaderPage> {
      builder: (context) => TextEditorPage(
        S.of(context).password, 
        Utils.notEmpty,
        isPassword: true,
        inputType: TextInputType.visiblePassword,
      ),
    ));
    if (password == null) return;


@@ 68,6 68,7 @@ class _InoreaderPageState extends State<InoreaderPage> {
        "API ID", 
        Utils.notEmpty,
        initialValue: _apiId,
        inputType: TextInputType.number,
      ),
    ));
    if (apiId == null) return;

M lib/pages/settings/text_editor_page.dart => lib/pages/settings/text_editor_page.dart +4 -4
@@ 11,7 11,7 @@ class TextEditorPage extends StatefulWidget {
  final String initialValue;
  final Color navigationBarColor;
  final FutureOr<bool> Function(String) validate;
  final bool isPassword;
  final TextInputType inputType;

  TextEditorPage(
    this.title,


@@ 20,7 20,7 @@ class TextEditorPage extends StatefulWidget {
      this.navigationBarColor,
      this.saveText,
      this.initialValue: "",
      this.isPassword: false,
      this.inputType,
      Key key,
    })
    : super(key: key);


@@ 88,8 88,8 @@ class _TextEditorPage extends State<TextEditorPage> {
            clearButtonMode: OverlayVisibilityMode.editing,
            readOnly: _validating,
            autofocus: true,
            obscureText: widget.isPassword,
            keyboardType: widget.isPassword ? TextInputType.visiblePassword : null,
            obscureText: widget.inputType == TextInputType.visiblePassword,
            keyboardType: widget.inputType,
            onSubmitted: (v) { _onSave(); },
          ),
        ]),