Question: I have to design a database where I have to store `Test Name` for each `Filename` and Each `Test Name` can run on several `Builds` and can either `Pass` or `Fail`.
There is 1-1 relationship between `Filename` & `Test Name`, which means there is one 1 file for 1 test. But each test can run on many builds and can have different outputs.

My approach is:
Table 1: **FileAndTestMap**

```
+----------+----------+
| Testname | Filename |
+----------+----------+
| 1        | A.txt    |
+----------+----------+
| 2        | Er.txt   |
+----------+----------+

```

Table 2: **Build**

```
+------+--------------+
| S No | Build Number |
+------+--------------+
| 1    | Build_123    |
+------+--------------+
| 2    | Build_234    |
+------+--------------+

```

Table 3: **Build\_XXX** *(For each build)*

```
+----------+----------+--------+
| TestName | Executed | Passed |
+----------+----------+--------+
| 1        | Y        | Y      |
+----------+----------+--------+
| 2        | N        | N      |
+----------+----------+--------+

```

I do not like this design and need a better approach to this. Any help is appreciated.

Answer: 
UPDATE: The second solution is better than this solution.

You should put the floatingActionButton widget in a Builder Widget. 
The following code should work:

```
@override
  Widget build(BuildContext context) {
    return new Scaffold(
      floatingActionButton: new Builder(builder: (BuildContext context) {
        return new FloatingActionButton(onPressed: () {
          Scaffold
              .of(context)
              .showSnackBar(new SnackBar(content: new Text('Hello!')));
        });
      }),
      body: new Container(
        padding: new EdgeInsets.all(32.0),
        child: new Column(
          children: <Widget>[
            new MySwitch(
              value: _switchValue,
              onChanged: (bool value) {
                if (value != _switchValue) {
                  setState(() {
                    _switchValue = value;
                  });
                }
              },
            )
          ],
        ),
      ),
    );

```
This is even simpler. **Tried it.** Create the FloatingActionButton as a **separate Stateless Widget.** **Call this Stateless Widget from the Scaffold.**

```
class Abc extends StatelessWidget
{
   Widget build(BuildContext context)
   {
      return Scaffold(
         appBar:AppBar(title:Text("Long List View")),
         body:SomeOtherWidget(),
         floatingActionButton:MyFAB()  
      );
   }
}

class MyFAB extends StatelessWidget
{
    Widget build(BuildContext context)
    {
       return FloatingActionButton(
            onPressed:(){
                showSnackBarHandler(context);
            },
            child:Icon(Icons.add),
            tooltip:"Press to Add More"
       );
    }
}

void showSnackBarHandler(BuildContext context){

var snackBar = SnackBar(
    content:Text("Hello")
);

Scaffold.of(context).showSnackBar(snackBar);

}

```