-1

    import 'package:flutter/material.dart';
    import 'package:todoey/screen/tasks_list.dart';

    class TasksScreen extends StatelessWidget {
      
      Widget buildButtomSheet(BuildContext context) {
        return Container();
      }
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          backgroundColor: Colors.lightBlueAccent,
          floatingActionButton:  FloatingActionButton(
            backgroundColor: Colors.lightBlueAccent,
            child: const Icon(Icons.add),
            onPressed: () {
             showModalBottomSheet = showModalBottomSheet(context: context, builder: buildButtomSheet);
        },
          ),
          body: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            children: <Widget>[
              Container(
                padding: const EdgeInsets.only(
                    top: 60.0, left: 30, right: 30, bottom: 30.0),
                child: Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  children: const <Widget>[
                    CircleAvatar(
                      child: Icon(
                        Icons.list,
                        size: 30,
                        color: Colors.lightBlueAccent,
                      ),
                      backgroundColor: Colors.white,
                      radius: 30,
                    ),
                    SizedBox(height: 10),
                    Text(
                      'Todoey',
                      style: TextStyle(
                        color: Colors.white,
                        fontSize: 50,
                        fontWeight: FontWeight.w700,
                      ),
                    ),
                    Text(
                      '12 task',
                      style: TextStyle(
                        color: Colors.white,
                      ),
                    ),
                  ],
                ),
              ),
              Expanded(
                child: Container(
                  padding: const EdgeInsets.symmetric(horizontal: 20),
                  decoration: const BoxDecoration(
                    borderRadius: BorderRadius.only(
                        topLeft: Radius.circular(30.0),
                        topRight: Radius.circular(30)),
                    color: Colors.white,
                  ),
                  child: const TasksList(),
                ),
              ),
            ],
          ),
        );
      }
    }

   child: const Icon(Icons.add),
            onPressed: () {
             showModalBottomSheet = showModalBottomSheet(context: context, builder: buildButtomSheet); 

I had issues with the code line above, i have tried several changes but it still tells "Invalid function".

Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56
Jamiekazi
  • 1
  • 2
  • 2
    Welcome to SO - Please take the [tour](https://stackoverflow.com/tour) and read [How to Ask](https://stackoverflow.com/help/how-to-ask) to improve, edit and format your questions. Without a [Minimal Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) it is impossible to help you troubleshoot. Any code should be included in the question as code not as an image. – lorem ipsum Sep 17 '22 at 23:31
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 22 '22 at 17:58

1 Answers1

0

Remove const from FloatingActionButton, because onPressed method will be called on run time.

floatingActionButton: FloatingActionButton(
  onPressed: () {},
),

More about const

floatingActionButton: FloatingActionButton(
  backgroundColor: Colors.lightBlueAccent,
  child: const Icon(Icons.add),
  onPressed: () async {
    final result = await showModalBottomSheet(
        context: context, builder: buildButtomSheet);
  },
),
Md. Yeasin Sheikh
  • 54,221
  • 7
  • 29
  • 56