<commit_before>import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:flutter_card_swipper/flutter_card_swiper.dart';

import '../../../../core/helpers/color_palette_helper.dart';
import '../../../../injection_container.dart' as di;
import '../../../onesignal/presentation/bloc/onesignal_privacy_bloc.dart';
import '../../../onesignal/presentation/bloc/onesignal_subscription_bloc.dart';
import '../../../settings/presentation/bloc/settings_bloc.dart';
import '../bloc/wizard_bloc.dart';
import '../widgets/closing.dart';
import '../widgets/onesignal.dart';
import '../widgets/servers.dart';

enum FabState {
  enabled,
  disabled,
  skip,
  finish,
}

SwiperController _swiperController = SwiperController();

class WizardPage extends StatelessWidget {
  const WizardPage({Key key}) : super(key: key);

  static const routeName = '/wizard';

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => di.sl<WizardBloc>(),
      child: const WizardPageContent(),
    );
  }
}

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

  @override
  _WizardPageContentState createState() => _WizardPageContentState();
}

class _WizardPageContentState extends State<WizardPageContent> {
  @override
  void initState() {
    super.initState();
    context.read<SettingsBloc>().add(
          SettingsUpdateWizardCompleteStatus(false),
        );
  }

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        return _showQuitDialog(context);
      },
      child: Scaffold(
        backgroundColor: Theme.of(context).backgroundColor,
        // Without the appbar the SystemUiOverlayStyle is not setting the
        // notification bar icons to white
        appBar: PreferredSize(
          preferredSize: const Size.fromHeight(0),
          child: AppBar(),
        ),<commit_msg>Attempt to load activity when quitting wizard.<commit_after>import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:flutter_card_swipper/flutter_card_swiper.dart';

import '../../../../core/helpers/color_palette_helper.dart';
import '../../../../injection_container.dart' as di;
import '../../../onesignal/presentation/bloc/onesignal_privacy_bloc.dart';
import '../../../onesignal/presentation/bloc/onesignal_subscription_bloc.dart';
import '../../../settings/presentation/bloc/settings_bloc.dart';
import '../bloc/wizard_bloc.dart';
import '../widgets/closing.dart';
import '../widgets/onesignal.dart';
import '../widgets/servers.dart';

enum FabState {
  enabled,
  disabled,
  skip,
  finish,
}

SwiperController _swiperController = SwiperController();

class WizardPage extends StatelessWidget {
  const WizardPage({Key key}) : super(key: key);

  static const routeName = '/wizard';

  @override
  Widget build(BuildContext context) {
    return BlocProvider(
      create: (context) => di.sl<WizardBloc>(),
      child: const WizardPageContent(),
    );
  }
}

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

  @override
  _WizardPageContentState createState() => _WizardPageContentState();
}

class _WizardPageContentState extends State<WizardPageContent> {
  @override
  void initState() {
    super.initState();
    context.read<SettingsBloc>().add(
          SettingsUpdateWizardCompleteStatus(false),
        );
  }

  @override
  Widget build(BuildContext context) {
    return WillPopScope(
      onWillPop: () async {
        final result = await _showQuitDialog(context);
        if (result) {
          await Navigator.of(context).pushNamedAndRemoveUntil(
            '/activity',
            (Route<dynamic> route) => false,
          );
        }

        return false;
      },
      child: Scaffold(
        backgroundColor: Theme.of(context).backgroundColor,
        // Without the appbar the SystemUiOverlayStyle is not setting the
        // notification bar icons to white
        appBar: PreferredSize(
          preferredSize: const Size.fromHeight(0),
          child: AppBar(),
        ),
{'fraction_non_alphanumeric': 0.13174603174603175, 'fraction_numerical': 0.00045351473922902497, 'mean_word_length': 3.5521155830753353, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 15, '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': '6342056', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1332, 'n_words': 262}