title: Flutter testing results in "The getter 'flavor' was called on null."
body: <p>I am doing Quality Assurance testing for this app and I want to test this individual page.</p>
  <p>However I get the following error:</p>
  <p><strong>NoSuchMethodError: The getter 'flavor' was called on null.
  Receiver: null
  Tried calling: flavor</strong></p>
  <p>The command I'm using is:</p>
  <p><strong>flutter run --flavor dev -t ./lib/pages/welcome_page/welcome_page.dart</strong></p>
  <p>I do not have another flavor I can use.</p>
  <p>Is the flavor information supposed to have been passed on to this welcome_page.dart from the previous page?</p>
  <pre><code>import 'package:flutter/material.dart';
  import 'package:skinopathy_doctor/constants/constants.dart';
  import 'package:skinopathy_doctor/constants/constants_strings.dart';
  import 'package:skinopathy_doctor/pages/register/ohip/ohip_billing_page.dart';
  import 'package:skinopathy_doctor/repositories/auth_repository.dart';
  import 'package:skinopathy_doctor/repositories/doctor_profile_repository.dart';
  import 'package:skinopathy_doctor/repositories/flavor_repostiory.dart';
  import 'package:skinopathy_doctor/widgets/common/page_helper.dart';
  import 'package:flutter_bloc/flutter_bloc.dart';
  
  
  
  void main() {
    runApp(MyApp());
  }
  
  class MyApp extends StatelessWidget {
    @override
    Widget build(BuildContext context) {
      return MaterialApp(
        home: WelcomePage(),
      );
    }
  }
  
  
  class WelcomePage extends StatelessWidget {
    final String title = LocaleString.welcome_page_title;
    final String title_dev = &quot;Welcome to closed Dev For Skinopathy!&quot;;
    final String description = LocaleString.welcome_page_description;
  
    WelcomePage();
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        body: Container(
            width: displayWidth(context),
            height: displayHeight(context),
            alignment: Alignment.center,
            decoration: const BoxDecoration(
              image: DecorationImage(
                  fit: BoxFit.fill,
                  image:
                      AssetImage('assets/images/backgroundImage/background.png')),
            ),
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                _logoImage(context),
                _welcomeInfo(context),
              ],
            )),
      );
    }
  
    /*---------------------------------------------------------------------
      Showing app Name
    *--------------------------------------------------------------------*/
    Widget _welcomeInfo(BuildContext context) {
      return Expanded(
        child: Container(
          margin: EdgeInsets.all(20),
          padding: EdgeInsets.only(left: 20, right: 20, bottom: 10, top: 20),
          width: displayWidth(context),
          decoration: BoxDecoration(
            color: Colors.white,
            borderRadius: new BorderRadius.all(
              Radius.circular(20.0),
            ),
            boxShadow: [
              BoxShadow(
                color: ColorPickers.mainColor.withAlpha(100),
                spreadRadius: 1,
                blurRadius: 3,
                offset: Offset(2, 2),
              ),
            ],
          ),
          child: Column(
            crossAxisAlignment: CrossAxisAlignment.center,
            children: &lt;Widget&gt;[
              Text(FlavorConfig.isProduction() ? title : title_dev,
                  style: TextStyle(
                      color: ColorPickers.darkBlackColor,
                      fontWeight: FontWeight.bold,
                      fontSize: 22,
                      fontFamily: FontFamilyPickers.oswald)),
              SizedBox(
                height: 30,
              ),
              Expanded(
                child: Text(description,
                    style: TextStyle(
                      color: ColorPickers.darkBlackColor,
                      fontSize: 18,
                    )),
              ),
              Container(
                width: displayWidth(context),
                alignment: Alignment.bottomRight,
                child: TextButton(
                  key: Key(&quot;buttonKey&quot;),
                  child: Text(LocaleString.welcome_next_button_text,
                      style: TextStyle(
                          color: ColorPickers.darkBlackColor,
                          fontSize: 20,
                          fontFamily: FontFamilyPickers.oswald)),
                  onPressed: () =&gt; _onConfirmationPressed(context),
                ),
              )
            ],
          ),
        ),
      );
    }
  
    /*---------------------------------------------------------------------
      Image for logo
    *--------------------------------------------------------------------*/
    Widget _logoImage(BuildContext context) {
      return Expanded(
        child: Container(
          margin: const EdgeInsets.all(20),
          child: Center(
            child: Image.asset(ImagePaths.doctor_image),
          ),
        ),
      );
    }
  
    void _onConfirmationPressed(BuildContext context) async {
      // Check if user has previously registered.
      final uid = context.read&lt;AuthRepository&gt;().currentUser.uid;
      final docProfile =
          await context.read&lt;DoctorProfileRepository&gt;().getProfile(uid);
  
      // If doc has not registered
      if (docProfile == null)
        Navigator.pushReplacementNamed(context, '/register_new_doctor');
      // If registered, ensure that user has verified OHIP
      else if (!docProfile.hasVerifiedOHIP)
        Navigator.pushReplacement(
          context,
          MaterialPageRoute(
            builder: (context) =&gt; OHIPBillingPage(doctorProfileInfo: docProfile),
          ),
        );
      // If all good
      else
        Navigator.pushReplacementNamed(context, '/patient_list');
    }
  }
  </code></pre>