如何在flutter中使用textspan作为get.dialog的中间文本

问题描述 投票:0回答:1

删除帐户时,我想要一个默认对话框进行确认,并且我使用了 Getx 对话框

但是在这里我想要一些中间文本的样式,比如textspan,该怎么做?

应显示对话框的中间文本

您确定删除David的帐户吗?

void getDeleteConfirmationDialog(){
    Get.defaultDialog(
      contentPadding: EdgeInsets.all(8),
      title: 'Delete User',
//for bellow i want to use text pan and show user's name as bold
      middleText: 'Are Your sure to Delete record of '+users[selectedIndex.value].name+'?',
      confirm: ElevatedButton(onPressed: ()async{
        deleteRecord();
        Navigator.of(Get.overlayContext!).pop();

      }, child: Text('Sure, Delete')),
      cancel: OutlinedButton(onPressed: (){
        Navigator.of(Get.overlayContext!).pop();
      }, child: Text('Cancel')),
    );
flutter
1个回答
0
投票

离开 getx,使用另一个状态管理器,如 Riverpod 或 flutter_bloc、Mobx、provider

© www.soinside.com 2019 - 2024. All rights reserved.