Search code examples
flutterparse-platformvoidback4app

This Expression keep on Void (back4app, parse, flutter)


Now I'm getting annoyed not managing to create this function/class to signUp on back4app backend, I'm using parseObject.set (since this the first time), I know the register bit hefty but my boss want full information at beginning that is why I cannot use normal register.

pop out this error error: This expression has a type of 'void' so its value can't be used. (use_of_void_result at [mall_daur] lib\screens\register.dart:355) the line is show for parseObject. any ideas?

Future<void> Signup(BuildContext context) async {
    final username = _nama;
    final password = _password;
    final email = _email;
    final NoKTP = _noktp;
    final TglLahir = _tgllahir;
    final TempatLahir = _tempatlahir;
    final Seller = _seller;
    final FotoKtp = _imagektp;
    final FotoRekening = _imagerek;
    final NamaBank = _namabank;
    final RekeningBank = _norek;

    final todo = ParseObject('User').set('username', username).set('password', password).set('email',email).set('NoKTP', NoKTP).set('TglLahir', TglLahir).set('TempatLahir',TempatLahir).set('Seller', Seller).set('FotoKtp',FotoKtp).set('FotoRekening',FotoRekening).set('NamaBank',NamaBank).set('RekeningBank',RekeningBank);
    await todo.save();
  }

Solution

  • sory just a simple question with simple answer. got to answer this

    final todo = ParseObject('User')..set('username', username).. //etc
    await todo.save()
    

    use DOUBLEDOT to set things ..