Widget build()

in repo_dashboard/lib/repository.dart [114:175]


  Widget build(BuildContext context) {
    TextStyle currentHeadline = Theme.of(context).textTheme.headline5;
    TextStyle headline = currentHeadline.copyWith(fontWeight: FontWeight.bold);
    return Scaffold(
      appBar: AppBar(
        actions: <Widget>[
          IconButton(
            icon: (tab.isPaused ? const Icon(Icons.play_arrow) : const Icon(Icons.pause)),
            tooltip: (tab.isPaused ? 'Switch tabs' : 'Stop switching tabs'),
            onPressed: () {
              setState(() {
                bool isPaused = !tab.isPaused;
                if (isPaused) {
                  tab.pause(_tabController.index);
                } else {
                  tab.play();
                }
              });
            },
          ),
          IconButton(
            icon: const Icon(Icons.settings),
            tooltip: 'Settings',
            onPressed: () {
              Navigator.of(context).pushNamed('/settings');
            },
          ),
        ],
        leading: IconButton(icon: const Icon(Icons.arrow_back, color: Colors.white), onPressed: () => launch('/')),
        bottom: TabBar(
            controller: _tabController,
            labelStyle: Theme.of(context).textTheme.bodyText1.apply(fontSizeFactor: 1.6),
            indicatorWeight: 4.0,
            tabs: <Tab>[for (_RepositoryTabMapper tabMapper in _dashboardTabs) tabMapper.tab]),
      ),
      body: Theme(
        data: ThemeData(
            textTheme: Theme.of(context).textTheme.copyWith(
                  bodyText2: currentHeadline,
                  subtitle1: headline.copyWith(fontWeight: FontWeight.normal),
                  headline5: headline,
                ),
            dividerColor: Theme.of(context).colorScheme.secondary,
            iconTheme: IconTheme.of(context).copyWith(size: 30.0)),
        child: ListTileTheme(
          contentPadding: const EdgeInsets.only(bottom: 46.0),
          child: Padding(
            padding: const EdgeInsets.symmetric(vertical: 40.0, horizontal: 50.0),

            // The RepositoryDetails widgets are dependent on data fetched from the flutter/flutter FlutterRepositoryStatus repository.
            // Rebuild all widgets when that model changes.
            child: ModelBinding<FlutterRepositoryStatus>(
              initialModel: FlutterRepositoryStatus(),
              child: TabBarView(
                  controller: _tabController,
                  children: <Widget>[for (_RepositoryTabMapper tabMapper in _dashboardTabs) tabMapper.tabContents]),
            ),
          ),
        ),
      ),
    );
  }