content: import 'package:book_flutter_7_sync/bloc/counter_bloc.dart';
  import 'package:flutter/material.dart';
  import 'package:flutter/widgets.dart';
  import 'package:provider/provider.dart';
  
  class TopPage3 extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(
          title: const Text('BLoC Demo'),
        ),
        body: Provider<CounterBloc>(
          create: (_) => CounterBloc(),
          dispose: (_, bloc) => bloc.dispose(),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.spaceEvenly,
            children: <Widget>[
              _WidgetA(),
              _WidgetB(),
              _WidgetC(),
            ],
          ),
        ),
      );
    }
  }
  
  class _WidgetA extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      print("called _WidgetA#build()");
      var bloc = Provider.of<CounterBloc>(context, listen: false);
      return Center(
        child: StreamBuilder<int>(
          stream: bloc.value,
          builder: (context, snapshot) {
            return Text(
              '${snapshot.data}',
              style: Theme.of(context).textTheme.display1,
            );
          },
        ),
      );
    }
  }
  
  class _WidgetB extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      print("called _WidgetB#build()");
      return const Text('I am a widget that will not be rebuilt.');
    }
  }
  
  class _WidgetC extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      print("called _WidgetC#build()");
      return RaisedButton(
        onPressed: () {
          Provider.of<CounterBloc>(context, listen: false).incrementCounter();
        },
        child: Icon(Icons.add),
      );
    }
  }
  