标签: hook-widgets

如何将 HookWidget 与 useTextEditingController 结合使用

我是颤振开发的新手,并试图了解 Riverpod。

我目前设法使以下登录表单与 StatefulWidget 一起使用。基本上,如果两个字段都不为空,则该按钮将被启用,反之亦然。

在此输入图像描述

这是它的当前代码。

import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'Login Demo',
      // theme: ThemeData(
      //   primarySwatch: Colors.blue,
      // ),
      home: Scaffold(
        body: Center(
          child: SizedBox(
            width: 400,
            child: MyLoginPage2(),
          ),
        ),
      ),
    );
  }
}

class MyLoginPage extends StatefulWidget {
  const MyLoginPage({Key? key}) : super(key: key); …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-web riverpod hook-widgets

9
推荐指数
1
解决办法
8573
查看次数

标签 统计

flutter ×1

flutter-web ×1

hook-widgets ×1

riverpod ×1