<commit_before>// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/widgets.dart';

class LifecycleWatcher extends StatefulWidget {
  const LifecycleWatcher({ Key key }) : super(key: key);

  @override
  _LifecycleWatcherState createState() => new _LifecycleWatcherState();
}

class _LifecycleWatcherState extends State<LifecycleWatcher>
                             with WidgetsBindingObserver {
  AppLifecycleState _lastLifecyleState;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
  }

  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    setState(() {
      _lastLifecyleState = state;
    });
  }

  @override
  Widget build(BuildContext context) {
    if (_lastLifecyleState == null)
      return const Text('This widget has not observed any lifecycle changes.');
    return new Text('The most recent lifecycle state this widget observed was: $_lastLifecyleState.');
  }
}


void main() {
  runApp(
    const Directionality(
      textDirection: TextDirection.ltr,
      child: const Center(
        child: const LifecycleWatcher(),
      ),
    ),
  );
}<commit_msg>fix typo in member name (#12161)<commit_after>// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:flutter/widgets.dart';

class LifecycleWatcher extends StatefulWidget {
  const LifecycleWatcher({ Key key }) : super(key: key);

  @override
  _LifecycleWatcherState createState() => new _LifecycleWatcherState();
}

class _LifecycleWatcherState extends State<LifecycleWatcher>
                             with WidgetsBindingObserver {
  AppLifecycleState _lastLifecycleState;

  @override
  void initState() {
    super.initState();
    WidgetsBinding.instance.addObserver(this);
  }

  @override
  void dispose() {
    WidgetsBinding.instance.removeObserver(this);
    super.dispose();
  }

  @override
  void didChangeAppLifecycleState(AppLifecycleState state) {
    setState(() {
      _lastLifecycleState = state;
    });
  }

  @override
  Widget build(BuildContext context) {
    if (_lastLifecycleState == null)
      return const Text('This widget has not observed any lifecycle changes.');
    return new Text('The most recent lifecycle state this widget observed was: $_lastLifecycleState.');
  }
}


void main() {
  runApp(
    const Directionality(
      textDirection: TextDirection.ltr,
      child: const Center(
        child: const LifecycleWatcher(),
      ),
    ),
  );
}
{'fraction_non_alphanumeric': 0.09258602341255764, 'fraction_numerical': 0.0046115643845335225, 'mean_word_length': 3.4904458598726116, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1068761', 'n_tokens_mistral': 830, 'n_tokens_neox': 797, 'n_words': 229}