error我在使用时得到这个AppBar:
滚动条的 ScrollController 没有附加 ScrollPosition。
这是我的CustomScrollBar:
class CustomScrollBar extends StatelessWidget {
final Widget child;
final ScrollController scrollController;
const CustomScrollBar({
required this.scrollController,
required this.child,
});
@override
Widget build(BuildContext context) {
return RawScrollbar(
thumbColor: AppColors.gray,
radius: Radius.circular(8),
thickness: 4,
isAlwaysShown: true,
controller: scrollController,
child: child,
);
}
}
Run Code Online (Sandbox Code Playgroud)
我应该永远可见。这就是我使用它的方式:
child: CustomScrollBar(
scrollController: _scrollControllerForScrollBar,
child: SingleChildScrollView(
controller: _scrollControllerForScrollBar,
child: Padding(
padding: EdgeInsets.all(7.0.scaled),
child: Container(
width: double.infinity,
child: Text(
'any text bla bla bla \n\n\n this is a lot …Run Code Online (Sandbox Code Playgroud) 这是完整的error-message:
无法显示应用程序 bundleID 的自动强密码:com.ckbusiness.Wishlists 由于错误:无法识别调用应用程序的进程。检查应用程序标识符权利中的 teamID 和 bundleID
我在这里错过了什么?
required我有一个函数,在最好的情况下应该有三个参数named。最后一个(“ finished”)应该是optional。我尝试过这样的:
static void showOverlay(BuildContext context, String text, bool successfull,
[VoidCallback? finished]) {}
Run Code Online (Sandbox Code Playgroud)
但 Flutter 抱怨:
避免位置布尔参数
奇怪的是,它只是抱怨bool successfull. 我在这里做错了什么以及如何解决这个问题?
我正在尝试按照本教程创建一个DropDown. 但我无法复制他的代码,因为Flutter 2.0由于这些行而禁止它:
void findDropdownData() {
RenderBox renderBox = actionKey.currentContext!.findRenderObject()!;
height = renderBox.size.height;
width = renderBox.size.width;
Offset? offset = renderBox.localToGlobal(Offset.zero);
xPosition = offset!.dx;
yPosition = offset.dy;
}
Run Code Online (Sandbox Code Playgroud)
正如你所看到的,我尝试添加一些!,?但它仍然不起作用。主要问题是findRenderObject返回RenderObject,但我需要它是RenderBox......知道这里出了什么问题吗?想不通..
我已经实施了Sign-In-With-Applewith Firebase. 我还有删除用户的功能。这就是我所做的:
static Future<bool> deleteUser(BuildContext context) async {
try {
await BackendService().deleteUser(
context,
);
await currentUser!.delete(); // <-- this actually deleting the user from Auth
Provider.of<DataProvider>(context, listen: false).reset();
return true;
} on FirebaseException catch (error) {
print(error.message);
AlertService.showSnackBar(
title: 'Fehler',
description: error.message ?? 'Unbekannter Fehler',
isSuccess: false,
);
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,我删除了所有用户数据,最后删除了用户本人auth。
但苹果仍然认为我正在使用该应用程序。我可以在我的设置中看到它:
此外,当尝试再次使用苹果登录时,它就像我已经有一个帐户一样。但我刚刚删除了它,Firebase 中没有任何内容表明我仍然拥有该帐户?如何从 Firebase 中彻底删除 Apple 用户?我在这里缺少什么?
我想在按下按钮时更改图像名称。
到目前为止,这是我的结构:
struct ContentView: View {
@State var matrix = [Int] var
body: some View {
VStack {
Text("Test")
HStack(alignment: .center, spacing: 8) {
Button(action: {
**
// call a func that will do some check and
// change the image from Blue.png to Red.png
**
}) {
Image("Blue")
.renderingMode(.original)
.resizable()
.aspectRatio(contentMode: .fill)
.clipShape(Circle())
}
}
}
}
}
Run Code Online (Sandbox Code Playgroud) 我在项目中使用Hive - Package 在本地存储一些数据。到目前为止,一切都很好,但现在我面临一个问题:
我有一个Custom-Class其中也有一个字段与另一个Custom-Class:
part 'hive_vitals_interface.g.dart';
@HiveType(typeId: 1)
class HiveVitals extends HiveObject {
@HiveField(0)
String? id;
@HiveField(1)
DateTime? date;
@HiveField(2)
List<HiveDiscomfort> otherDiscomfort;
@HiveField(3)
List<HiveDiscomfort> mentalDiscomfort;
HiveVitals({
this.id,
this.date,
this.otherDiscomfort = const [],
this.mentalDiscomfort = const [],
});
}
Run Code Online (Sandbox Code Playgroud)
和我的HiveDiscomforts-Class:
part 'hive_discomfort_interface.g.dart';
@HiveType(typeId: 2)
class HiveDiscomfort extends HiveObject {
@HiveField(0)
String? title;
@HiveField(1)
int? intensity;
HiveDiscomfort({
this.title,
this.intensity,
});
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试这样保存: HiveVitals
static Future<void> addVitals(HiveVitals hiveVitals) async {
final vitalsBox = getVitalsBox(); …Run Code Online (Sandbox Code Playgroud) 我有一个Flutter Web应用程序,用户通过Firebase登录。问题是每次刷新页面时,用户都会注销。
iOS 类似:用户在刷新后保持登录状态,但在完全关闭应用程序时被注销。
我知道这个问题表明应该用最新版本来修复它,但我已经使用了所谓的修复版本:
firebase_core:^1.20.0
firebase_auth:^3.6.0
云火存储:^3.4.1
我正在使用go_router和redirect用户(如果他未登录):
final GoRouter router = GoRouter(
key: Get.key,
urlPathStrategy: UrlPathStrategy.path,
redirect: (state) {
final String destination = state.location;
final bool isOnStartView = destination == '/start';
final bool isOnEmailFlow = state.subloc.contains('/email');
if (!isOnStartView && !isOnEmailFlow && !AuthService.isLoggedIn()) {
return '/start';
}
return null;
},
...
Run Code Online (Sandbox Code Playgroud)
这是我的AuthService.isLoggedIn():
static final FirebaseAuth _firebaseAuth = FirebaseAuth.instance;
static User? get currentUser => FirebaseAuth.instance.currentUser;
static bool isLoggedIn() { …Run Code Online (Sandbox Code Playgroud) 从今天起,我无法再运行我的 Flutter Web 项目,因为它失败了:
:错误:位置参数太多:允许 1 个,但找到 2 个。firebase_auth_web.dart:94 尝试删除额外的位置参数。FirebaseCoreWeb.registerService('auth', (firebaseApp) async { ^ : 上下文: 找到此候选者,但参数不匹配。 firebase_core_web.dart:43 static void registerService( ^^^^^^^^^^^^ ^^^
我已经将Core和更新Auth到最新版本:
firebase_core:^2.14.0
firebase_auth:^4.2.10
而我正在跑步Flutter 3.10.0。
还有其他人遇到这个问题吗?我没有改变任何东西,至少不是故意的。
我正在尝试在我的应用程序中实现 Lottie AnimationView,但在调整视图大小时遇到问题。
我就是这样setup/constrain的AnimationView:
@objc func showAnimationTapped(){
let logoAnimation = AnimationView(name: "StrokeAnimation")
logoAnimation.contentMode = .scaleAspectFit
self.view.addSubview(logoAnimation)
logoAnimation.centerXAnchor.constraint(equalTo: view.centerXAnchor).isActive = true
logoAnimation.centerYAnchor.constraint(equalTo: view.centerYAnchor).isActive = true
logoAnimation.heightAnchor.constraint(equalToConstant: 200).isActive = true
logoAnimation.widthAnchor.constraint(equalToConstant: 200).isActive = true
logoAnimation.play()
}
Run Code Online (Sandbox Code Playgroud)
问题是 XCode 打破了所有约束并且AnimationView错误地放置/缩放。我还检查了View Hirarchy,AnimationView实际上覆盖了整个屏幕...也尝试过,CGRect但这并没有改变任何东西。
如何在 Swift 5 中调整动画大小/约束动画?
我找不到关于这个主题的任何内容..我感谢每一个帮助!
也许我的 AE 文件有问题,因为当我在Lottiefiles.com上预览它时,“描边”与我的 AE 文件中的动画不同。
不过我也用直接来自 Lottie 的文件进行了测试,这导致了同样的问题......
所以也许有 Swift/Lottie/AfterEffects 专家可以在这里帮助我:)
flutter ×7
dart ×6
ios ×3
swift ×3
firebase ×2
autolayout ×1
button ×1
casting ×1
entitlements ×1
flutter-hive ×1
flutter-web ×1
function ×1
image ×1
json ×1
lottie ×1
parameters ×1
passwords ×1
render ×1
scrollbar ×1
scrollview ×1