有谁知道如何用 gif 而不是旋转器制作刷新指示器?
尝试使用custom_refresh_indicator库来实现
import 'package:custom_refresh_indicator/custom_refresh_indicator.dart';
import 'package:flutter/material.dart';
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Column(
children: [
Container(
color: Colors.blue,
height: 100,
),
Expanded(
child: CustomRefreshIndicator(
onRefresh: () => Future.delayed(
const Duration(seconds: 3),
),
builder: (
context,
child,
controller,
) {
return AnimatedBuilder(
animation: controller,
builder: (BuildContext context, _) {
return Stack(
alignment: …Run Code Online (Sandbox Code Playgroud) Error: The argument type 'Map<String, String>' can't be assigned to the parameter type 'Map<CognitoUserAttributeKey, String>'.
Run Code Online (Sandbox Code Playgroud)
当我查找错误时,没有任何相关信息。
在 AWS 文档中,他们推荐了此代码,这会导致错误:
Map<String, String> userAttributes = {
'email': 'email@domain.com',
'phone_number': '+15559101234',
// additional attributes as needed
};
SignUpResult res = await Amplify.Auth.signUp(
username: 'myusername',
password: 'mysupersecurepassword',
options: CognitoSignUpOptions(
userAttributes: userAttributes
)
);
Run Code Online (Sandbox Code Playgroud)