Moving BTC from taprootwallet with tweak == true to taprootwallet with tweak == false and vice versa is goin wrong using bitcoin_base repository
I made a test to illustrate the bug (?). I couldn't find a location to report it elsewhere so am doing it here: 


      /*
        Scenario: derive two taproot addresses from the same private and public key:
        one with tweak == false, the other with tweak == true.
        Then transfer some BTC to tweaked address from a faucet and 
        after that run this code: it should transfer btc to the untweaked taproot address.
        And indeed it does. When this is done (you may have to wait a while before the transaction 
        has been confirmed, else you get a different error message), run this code again. 
        BTC should be transferred from the untweaked 
        taproot address to the tweaked taproot address. but the code produces an error:
        sendrawtransaction RPC error -26: {"code":-26,"message":"mandatory-script-verify-flag-failed (Invalid Schnorr signature)"}.
        Don't understand why, but I'm relatively new to this, so my suppositions may be flawed
      */

    test(
        "moving BTC from one taproot address with tweak to another without tweak and vice versa",
        () async {
      //
      Future moveSome(
          dynamic provider,
          List<ElectrumUtxo> utxoFromServer,
          ECPrivate privKey,
          P2trAddress taprootAddressFrom,
          P2trAddress taprootAddressTo) async {
        ///
        const BitcoinNetwork testnet = BitcoinNetwork.testnet;

        int whichUnspent = utxoFromServer.length - 1;

        List<UtxoWithAddress> utxos = [
          UtxoWithAddress(
              utxo: BitcoinUtxo(
                txHash: utxoFromServer[whichUnspent].txId,
                value: utxoFromServer[whichUnspent].value,
                vout: utxoFromServer[whichUnspent].vout,
                scriptType: taprootAddressFrom.type,
              ),
              ownerDetails: UtxoAddressDetails(
                  publicKey: privKey.getPublic().toHex(),
                  address: taprootAddressFrom)),
        ];

        BigInt fee = BigInt.from(120);
        BigInt value = utxoFromServer[whichUnspent].value - fee;
        BigInt total = utxoFromServer[whichUnspent].value;

        expect(value + fee, total);

        final builder = BitcoinTransactionBuilder(

            /// outputs
            outputs: [BitcoinOutput(address: taprootAddressTo, value: value)],
            fee: fee,
            network: testnet,
            enableRBF: true,
            utxos: utxos);

        final BtcTransaction tr =
            builder.buildTransaction((trDigest, utxo, publicKey, sighash) {
          /// For each input in the transaction, locate the corresponding private key
          /// and sign the transaction digest to construct the unlocking script.
          if (publicKey == privKey.getPublic().toHex() && utxo.utxo.isP2tr()) {
            return privKey.signTapRoot(trDigest, sighash: sighash);
          }
          print("SOMETHING WRONG");
          throw UnimplementedError();
        });

        final raw = tr.serialize();

        print(raw);

        await provider
            .request(ElectrumBroadCastTransaction(transactionRaw: raw));
      }

      try {
        const BitcoinNetwork testnet = BitcoinNetwork.testnet;

        final service =
            await ElectrumSSLService.connect("testnet.aranguren.org:51002");

        final provider = ElectrumApiProvider(service);

        final seed = Bip39SeedGenerator(Mnemonic.fromString(
                "magic oyster device damp alpha hollow use trash arctic innocent turkey bacon clarify salute duck cereal route fame end copy stairs panda vendor glance"))
            //"differ success juice endorse dune ancient fantasy true year load wise rebuild pet hamster meadow gossip place angry stumble shop concert attack betray used"))
            .generate();

        final bip32 = Bip32Slip10Secp256k1.fromSeed(seed);

        final derivationForTaproot = bip32.derivePath("m/86'/0'/0'/0/1");
        final privateForTaproot =
            ECPrivate.fromBytes(derivationForTaproot.privateKey.raw);
        final publicForTaproot = privateForTaproot.getPublic();

        final tweakedTaproot = publicForTaproot.toTaprootAddress(tweak: true);
        // ignore: avoid_print
        print("tweak : true -> ${tweakedTaproot.toAddress(testnet)}");
        final untweakedTaproot =
            publicForTaproot.toTaprootAddress(tweak: false);
        print("tweak : false -> ${untweakedTaproot.toAddress(testnet)}");

        List<ElectrumUtxo> tweakedUtxos =
            await provider.request(ElectrumScriptHashListUnspent(
          scriptHash: tweakedTaproot.pubKeyHash(),
          includeTokens: false,
        ));

        List<ElectrumUtxo> untweakedUtxos =
            await provider.request(ElectrumScriptHashListUnspent(
          scriptHash: untweakedTaproot.pubKeyHash(),
          includeTokens: false,
        ));

        expect(tweakedUtxos.isNotEmpty || untweakedUtxos.isNotEmpty, true);

        if (tweakedUtxos.isNotEmpty) {
          //  move some to untweaked
          print("moving some from tweaked to untweaked");
          await moveSome(provider, tweakedUtxos, privateForTaproot,
              tweakedTaproot, untweakedTaproot);
        } else if (untweakedUtxos.isNotEmpty) {
          //  move some to tweaked
          print("moving some from untweaked to tweeaked");
          await moveSome(provider, untweakedUtxos, privateForTaproot,
              untweakedTaproot, tweakedTaproot);
        }

        print("NO PROBLEM");
      } catch (e) {
        print(e.toString());
      }
    }, skip: false);
