flutter no tabcontroller for tabbar code example

Example: No TabController for TabBar.

As The Error is Stating you need - TabController Edit Your Code as Below.

@override
  Widget build(BuildContext context) {
    // TODO: implement build
    return DefaultTabController(  // Added
      length: 4,  // Added
      initialIndex: 0, //Added
      child: Scaffold(
          appBar: AppBar(
            title: new Text("Tab App."),
          ),
          drawer: sideDrawer(context),  // Passed BuildContext in function.
          bottomNavigationBar: bottomTabBar()),
    );
  }

Widget sideDrawer(BuildContext context){ ......