-1

I would like to put a button at the bottom right inside a column contained in a singlechildscrollview, what can I do? This is my code:

  Widget build(BuildContext context) {
    double altezza = MediaQuery.of(context).size.height;
    return SingleChildScrollView(
      child: Column(
        mainAxisSize: MainAxisSize.min,
        children: <Widget>[
          Column(
            mainAxisSize: MainAxisSize.min,
            children: <Widget>[
              altezza > 750 && valoreCheckAbbuonoOre == false
                  ? SizedBox(height: altezza / 9)
                  : altezza > 750 && valoreCheckAbbuonoOre == true
                      ? SizedBox(height: altezza / 11)
                      : SizedBox(height: altezza / 15),
              Text("Rapporto di $meseAttuale $annoAttuale",
                  style: TextStyle(fontWeight: FontWeight.bold, fontSize: 21)),
              SizedBox(height: 20),
              GestureDetector(
                onTap: () {
                  click(1);
                },
                child: Text("Visualizza rapporto precedente",
                    style: TextStyle(
                        fontWeight: FontWeight.bold,
                        fontSize: 16,
                        color: Colors.blue[900])),
              ),
              SizedBox(height: 20),
              TabellaStatica(visualizzaRapporto, "attuale"),
              SizedBox(height: 20),
          Row(
            mainAxisSize: MainAxisSize.max,
            mainAxisAlignment: MainAxisAlignment.end,
            children: <Widget>[
              MaterialButton(
                onPressed: () {
                  Navigator.push(
                    context,
                    MaterialPageRoute(
                        builder: (context) =>
                            AggiungiServizio(visualizzaRapporto)),
                  );
                },
                shape: CircleBorder(),
                color: Colors.blue[900],
                padding: EdgeInsets.all(10),
                child: const Icon(
                  Icons.add,
                  size: 30,
                  color: Colors.white,
   

Previously I used Spacer (which cannot be used in singlechildscrollview) and the row property "MainAxisAlignment.end".How do I do now? (I removed some of the code (curly brackets, etc) to allow stack overflow to publish the question)

Jonathan
  • 106
  • 1
  • 8

1 Answers1

0

You can try to use bottom navigation bar:

  Widget build(BuildContext context) {
    return Scaffold(
      body: SingleChildScrollView(
        child: Column(),
      ),
      bottomNavigationBar: MaterialButton(...),
    );
  }
HKN
  • 264
  • 1
  • 8