パッケージ、リポジトリ、アプリカテゴリを検索

GitHub リポジトリpeiffer-innovations/form_floating_action_button

form_floating_action_button

peiffer-innovations/form_floating_action_button open-source repository details.

form_floating_action_button のプロジェクト画像
スター
3
フォーク
0
最終プッシュ(UTC)
2026/02/16
プロジェクト状態
アーカイブ済み

元の README

以下は英語原文のスナップショットです。最新版は GitHub をご覧ください。

I'm done

Table of Contents

form_floating_action_button

Flutter Publisher

A plugin to add some basic form functionality to the Floating Action Button.

Demo

Live Web Example

Example

Installation

Add to pubspec.yaml

dependencies:
  ...
  form_floating_action_button: any

Usage Example

Import form_floating_action_button.dart

import 'package:form_floating_action_button/form_floating_action_button.dart';
Usage within a Form
Widget build(BuildContext context) {
  return Form(
    child: Scaffold(
      appBar: AppBar(
        title: Text('Form Validate'),
      ),
      body: Material(
        child: ListView(
          children: <Widget>[
            Padding(
              padding: EdgeInsets.symmetric(horizontal: 16.0),
              child: TextFormField(
                decoration: InputDecoration(
                  labelText: 'Email',
                ),
                onFieldSubmitted: (_) {
                  _controller.firePressed();
                },
                validator: (value) {
                  String error;
                  if (value?.isNotEmpty != true) {
                    error = 'Email is required';
                  } else if (value.contains('@') != true ||
                      value.contains('.') != true) {
                    error = 'Email is not valid';
                  }

                  return error;
                },
              ),
            ),
          ],
        ),
      ),
      floatingActionButton: FormFloatingActionButton(
        controller: _controller,
        loading: _loading,
        onSubmit: () {
          setState(() => _loading = true);
          Future.delayed(Duration(seconds: 5)).then((_) {
            if (mounted) {
              setState(() {
                _loading = false;
              });
            }
          });
        },
      ),
    ),
  );
}
Custom On Validate
@override
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(
      title: Text('On Validate'),
    ),
    body: Material(
      child: ListView(
        children: <Widget>[
          ListTile(
            onTap: () {
              setState(() => _validateSuccess = !_validateSuccess);
            },
            title: Text('Validation Successful'),
            trailing: IgnorePointer(
              child: Switch(
                value: _validateSuccess,
                onChanged: (_) {},
              ),
            ),
          )
        ],
      ),
    ),
    floatingActionButton: FormFloatingActionButton(
      loading: _loading,
      onSubmit: () {
        setState(() => _loading = true);
        Future.delayed(Duration(seconds: 5)).then((_) {
          if (mounted) {
            setState(() {
              _loading = false;
            });
          }
        });
      },
      onValidate: () {
        return Future.value(_validateSuccess);
      },
    ),
  );
}
peiffer-innovations GitHub avatar
GitHub 作者

peiffer-innovations ↗

言語DartHTMLSwiftObjective-CKotlin

使用している依存関係

依存関係一覧 4 件

プロジェクトに合うリポジトリを選ぶには?

用途で絞り込み、開発状況を比較し、採用前に元のリポジトリで要件を確認しましょう。

  1. 名前・作者・説明で検索し、技術トピックで絞り込みます。
  2. スター、フォーク、最近のプッシュを比較します。スターは関心の目安であり、品質の保証ではありません。
  3. 利用前に GitHub で README、ライセンス、Issues を確認します。

情報源と管理

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗