content: import 'package:flutter/material.dart';
  
  import './product_edit.dart';
  import './product_list.dart';
  import '../widgets/ui_elements/logout_list_tile.dart';
  import '../scoped-models/main.dart';
  
  class ProductsAdminPage extends StatelessWidget {
    final MainModel model;
  
    ProductsAdminPage(this.model);
  
    Widget _buildSideDrawer(BuildContext context) {
      return Drawer(
        child: Column(
          children: <Widget>[
            AppBar(
              automaticallyImplyLeading: false,
              title: Text('Choose'),
              elevation:
                Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0,
            ),
            ListTile(
              leading: Icon(Icons.shop),
              title: Text('All Products'),
              onTap: () {
                Navigator.pushReplacementNamed(context, '/');
              },
            ),
            Divider(),
            LogoutListTile()
          ],
        ),
      );
    }
  
    @override
    Widget build(BuildContext context) {
      return DefaultTabController(
        length: 2,
        child: Scaffold(
          drawer: _buildSideDrawer(context),
          appBar: AppBar(
            title: Text('Manage Products'),
            elevation:
                Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 4.0,
            bottom: TabBar(
              tabs: <Widget>[
                Tab(
                  icon: Icon(Icons.create),
                  text: 'Create Product',
                ),
                Tab(
                  icon: Icon(Icons.list),
                  text: 'My Products',
                ),
              ],
            ),
          ),
          body: TabBarView(
            children: <Widget>[ProductEditPage(), ProductListPage(model)],
          ),
        ),
      );
    }
  }
  