import 'dart:async'; // Created by Bomsamdi on 2022 // Copyright © 2022 Bomsamdi. All rights reserved. import 'package:flutter/widgets.dart'; mixin AfterLayoutMixin on State { @override void initState() { super.initState(); WidgetsBinding.instance.endOfFrame.then( (_) { if (mounted) afterFirstLayout(context); }, ); } FutureOr afterFirstLayout(BuildContext context); }