我有以下问题,在我看来我有一个Listview.在这个列表视图中,我想有两个按钮.一个用于编辑项目,一个用于删除它.
这是我在XAML中的列表视图
<ListView Grid.Row="1" x:Name="ArbeitsEinträgeList" ItemsSource="{Binding EintragList}" SelectedItem="{Binding SelectedItem}">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<ViewCell.View>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<Label Text="{Binding Titel}" TextColor="{Binding Fehlerhaft, Converter={StaticResource EintragartConverter}}"></Label>
<Label Grid.Column="1" Text="{Binding Beginn}" TextColor="{Binding BeginnManuell, Converter={StaticResource EintragartConverter}}"></Label>
<Label Grid.Column="2" Text="{Binding Ende}" TextColor="{Binding EndeManuell, Converter={StaticResource EintragartConverter}}"></Label>
<Button Grid.Column="3" Command="{Binding EditEintragCommand}" Text="" FontFamily="../Ressources/fontawesome.ttf#FontAwesome"></Button>
<Button Grid.Column="4" Command="{Binding DeleteEintragCommand}" Text="" FontFamily="../Ressources/fontawesome.ttf#FontAwesome"></Button>
</Grid>
</ViewCell.View>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Run Code Online (Sandbox Code Playgroud)
在我的ViewModel中是我需要的一切,我已经使用不在listview中的按钮测试了命令,它完美无缺.
如果我将鼠标悬停在绑定上,则会显示消息"无法解析符号'...'"
这是我的 pubspec.yaml。我正在使用颤振:
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
shared_preferences: ^0.4.2
json_serializable: ^1.2.1
camera: ^0.2.3
path_provider: ^0.4.1
simple_permissions: ^0.1.6
share: ^0.5.3
#Google Sign_In
firebase_auth: ^0.5.20
google_sign_in: ^3.0.5
Run Code Online (Sandbox Code Playgroud)
我无法使用 Google 登录方法进行身份验证。窗口正常显示,在我的应用程序抛出错误后:
PlatformException(sign_in_failed, Status{statusCode=CANCELED, resolution=null}, null)
Run Code Online (Sandbox Code Playgroud)
网上没找到解决办法,有大佬帮帮我吗?
以下是我的_signIn()方法
Future<FirebaseUser> _signIn() async {
GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn();
GoogleSignInAuthentication gSA = await googleSignInAccount.authentication;
FirebaseUser user = await auth.signInWithGoogle(
idToken: gSA.idToken, accessToken: gSA.accessToken);
print("User Name : ${user.displayName}");
return user;
}
Run Code Online (Sandbox Code Playgroud)
调用后我的代码崩溃了,GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn();所以我猜是我的设置错误。
这就是我所说的 _signIn()
MaterialButton(
child: Text("Google Sign-In"), …Run Code Online (Sandbox Code Playgroud)