import '/flutterlib/flutter_theme.dart';
import '/flutterlib/flutter_util.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
import 'package:google_fonts/google_fonts.dart';
import 'package:provider/provider.dart';
import 'on_page_load_model.dart';
export 'on_page_load_model.dart';

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

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

class _OnPageLoadWidgetState extends State<OnPageLoadWidget> {
  late OnPageLoadModel _model;

  @override
  void setState(VoidCallback callback) {
    super.setState(callback);
    _model.onUpdate();
  }

  @override
  void initState() {
    super.initState();
    _model = createModel(context, () => OnPageLoadModel());

    // On component load action.
    SchedulerBinding.instance.addPostFrameCallback((_) async {
      setDarkModeSetting(context, ThemeMode.light);
    });
  }

  @override
  void dispose() {
    _model.maybeDispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    context.watch<FFAppState>();

    return ClipRRect(
      borderRadius: BorderRadius.circular(8.0),
      child: Image.asset(
        'assets/images/numstat+black_1.png',
        width: 61.0,
        height: 61.0,
        fit: BoxFit.cover,
      ),
    );
  }
}
