Created
July 16, 2025 22:10
-
-
Save iBelow/29756c04eb399a94ff356ddec064fbbf to your computer and use it in GitHub Desktop.
flutter loader bro...
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'dart:async'; | |
| import 'package:flutter/cupertino.dart'; | |
| import 'package:flutter/material.dart'; | |
| void main() => runApp(const MyApp()); | |
| class MyApp extends StatelessWidget { | |
| const MyApp({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| title: 'Flutter Demo', | |
| debugShowCheckedModeBanner: false, | |
| theme: ThemeData(colorSchemeSeed: Colors.blue), | |
| home: const TerminalLoadingScreenDartPad(), | |
| ); | |
| } | |
| } | |
| class TerminalLoadingScreenDartPad extends StatefulWidget { | |
| const TerminalLoadingScreenDartPad({super.key}); | |
| @override | |
| State<TerminalLoadingScreenDartPad> createState() => | |
| _TerminalLoadingScreenDartPadState(); | |
| } | |
| class _TerminalLoadingScreenDartPadState | |
| extends State<TerminalLoadingScreenDartPad> | |
| with TickerProviderStateMixin { | |
| late final AnimationController _dotsController; | |
| late final AnimationController _cursorController; | |
| int _currentStep = 0; | |
| String _currentText = ''; | |
| final List<String> _loadingSteps = [ | |
| 'Hookin’ up plugins… fingers crossed no conflicts, bro', | |
| 'Building that widget tree… nice n’ clean, no crashes', | |
| 'Droppin’ some extra padding… you know the drill', | |
| 'Hot reloadin’, but hey… it ain’t magic yet', | |
| 'Caching all the assets so it runs smooth, mi pana', | |
| 'Wrapping bugs in try-catch… jk (or maybe not)', | |
| 'Boom! Firing up that sexy UI, casi listo!', | |
| ]; | |
| @override | |
| void initState() { | |
| super.initState(); | |
| _dotsController = AnimationController( | |
| duration: const Duration(milliseconds: 1500), | |
| vsync: this, | |
| ); | |
| _cursorController = AnimationController( | |
| duration: const Duration(milliseconds: 600), | |
| vsync: this, | |
| ); | |
| _startLoadingAnimation(); | |
| } | |
| @override | |
| void dispose() { | |
| _dotsController.dispose(); | |
| _cursorController.dispose(); | |
| super.dispose(); | |
| } | |
| Future<void> _startLoadingAnimation() async { | |
| unawaited(_cursorController.repeat(reverse: true)); | |
| for (var i = 0; i < _loadingSteps.length; i++) { | |
| if (!mounted) return; | |
| setState(() { | |
| _currentStep = i; | |
| }); | |
| await _animateText(_loadingSteps[i]); | |
| await _animateDots(); | |
| await Future<void>.delayed(const Duration(milliseconds: 500)); | |
| } | |
| } | |
| Future<void> _animateText(String text) async { | |
| for (var i = 0; i <= text.length; i++) { | |
| if (!mounted) return; | |
| await Future<void>.delayed(const Duration(milliseconds: 50)); | |
| if (mounted) { | |
| setState(() { | |
| _currentText = text.substring(0, i); | |
| }); | |
| } | |
| } | |
| } | |
| Future<void> _animateDots() async { | |
| if (!mounted) return; | |
| _dotsController.reset(); | |
| unawaited(_dotsController.forward()); | |
| await Future<void>.delayed(const Duration(milliseconds: 1500)); | |
| } | |
| @override | |
| Widget build(BuildContext context) { | |
| final theme = Theme.of(context); | |
| final isDark = theme.brightness == Brightness.dark; | |
| return Scaffold( | |
| body: DecoratedBox( | |
| decoration: BoxDecoration( | |
| gradient: LinearGradient( | |
| begin: Alignment.topLeft, | |
| end: Alignment.bottomRight, | |
| colors: isDark | |
| ? [const Color(0xFF1a1a1a), const Color(0xFF0d1117)] | |
| : [const Color(0xFF0d1117), const Color(0xFF1a1a1a)], | |
| ), | |
| ), | |
| child: SafeArea( | |
| child: Padding( | |
| padding: const EdgeInsets.all(24), | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| Row( | |
| children: [ | |
| GestureDetector( | |
| onTap: () => Navigator.of(context).pop(), | |
| child: Container( | |
| width: 12, | |
| height: 12, | |
| decoration: const BoxDecoration( | |
| color: Colors.red, | |
| shape: BoxShape.circle, | |
| ), | |
| ), | |
| ), | |
| const SizedBox(width: 8), | |
| Container( | |
| width: 12, | |
| height: 12, | |
| decoration: const BoxDecoration( | |
| color: Colors.orange, | |
| shape: BoxShape.circle, | |
| ), | |
| ), | |
| const SizedBox(width: 8), | |
| Container( | |
| width: 12, | |
| height: 12, | |
| decoration: const BoxDecoration( | |
| color: Colors.green, | |
| shape: BoxShape.circle, | |
| ), | |
| ), | |
| const SizedBox(width: 16), | |
| Text( | |
| 'Apollo Terminal v2.1.0', | |
| style: TextStyle( | |
| color: Colors.grey.shade400, | |
| fontSize: 14, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| ], | |
| ), | |
| const SizedBox(height: 32), | |
| Text( | |
| 'apollo@flutterpc:~\$ flutter create awesome_app', | |
| style: TextStyle( | |
| color: Colors.grey.shade500, | |
| fontSize: 14, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| const SizedBox(height: 16), | |
| Expanded( | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| ...List.generate(_currentStep, (index) { | |
| return Padding( | |
| padding: const EdgeInsets.only(bottom: 8), | |
| child: Row( | |
| children: [ | |
| const Text( | |
| '> ', | |
| style: TextStyle( | |
| color: CupertinoColors.activeOrange, | |
| fontSize: 16, | |
| fontFamily: 'monospace', | |
| fontWeight: FontWeight.bold, | |
| ), | |
| ), | |
| Text( | |
| _loadingSteps[index], | |
| style: const TextStyle( | |
| color: Colors.green, | |
| fontSize: 16, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| const SizedBox(width: 8), | |
| const Text( | |
| '✓', | |
| style: TextStyle( | |
| color: Colors.green, | |
| fontSize: 16, | |
| ), | |
| ), | |
| ], | |
| ), | |
| ); | |
| }), | |
| if (_currentStep < _loadingSteps.length) | |
| Row( | |
| children: [ | |
| const Text( | |
| '> ', | |
| style: TextStyle( | |
| color: CupertinoColors.activeOrange, | |
| fontSize: 16, | |
| fontFamily: 'monospace', | |
| fontWeight: FontWeight.bold, | |
| ), | |
| ), | |
| Text( | |
| _currentText, | |
| style: const TextStyle( | |
| color: Colors.white, | |
| fontSize: 16, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| AnimatedBuilder( | |
| animation: _dotsController, | |
| builder: (context, child) { | |
| final progress = _dotsController.value; | |
| final dotCount = (progress * 5).floor(); | |
| return Text( | |
| '.' * dotCount, | |
| style: const TextStyle( | |
| color: CupertinoColors.activeOrange, | |
| fontSize: 16, | |
| fontFamily: 'monospace', | |
| ), | |
| ); | |
| }, | |
| ), | |
| const SizedBox(width: 4), | |
| AnimatedBuilder( | |
| animation: _cursorController, | |
| builder: (context, child) { | |
| return Container( | |
| width: 2, | |
| height: 20, | |
| color: _cursorController.value > 0.5 | |
| ? Colors.white | |
| : Colors.transparent, | |
| ); | |
| }, | |
| ), | |
| ], | |
| ), | |
| const Spacer(), | |
| Container( | |
| padding: const EdgeInsets.all(16), | |
| decoration: BoxDecoration( | |
| color: Colors.black.withValues(alpha: 0.3), | |
| borderRadius: BorderRadius.circular(8), | |
| border: Border.all( | |
| color: CupertinoColors.activeOrange.withValues( | |
| alpha: 0.3, | |
| ), | |
| ), | |
| ), | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, | |
| children: [ | |
| Row( | |
| children: [ | |
| Text( | |
| '└── ', | |
| style: TextStyle( | |
| color: Colors.grey.shade400, | |
| fontSize: 12, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| Text( | |
| 'Initializing flutter project...', | |
| style: TextStyle( | |
| color: Colors.grey.shade300, | |
| fontSize: 12, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| ], | |
| ), | |
| const SizedBox(height: 12), | |
| Row( | |
| children: [ | |
| Text( | |
| '[', | |
| style: TextStyle( | |
| color: Colors.grey.shade400, | |
| fontSize: 12, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| Expanded( | |
| child: LayoutBuilder( | |
| builder: (context, constraints) { | |
| final progress = | |
| (_currentStep + 1) / | |
| _loadingSteps.length; | |
| final width = constraints.maxWidth; | |
| final filledWidth = (width * progress) | |
| .round(); | |
| final emptyWidth = | |
| width.round() - filledWidth; | |
| return Row( | |
| children: [ | |
| if (filledWidth > 0) | |
| Container( | |
| width: filledWidth.toDouble(), | |
| height: 4, | |
| decoration: BoxDecoration( | |
| color: CupertinoColors | |
| .activeOrange, | |
| borderRadius: | |
| BorderRadius.circular(2), | |
| ), | |
| ), | |
| if (emptyWidth > 0) | |
| Container( | |
| width: emptyWidth.toDouble(), | |
| height: 4, | |
| decoration: BoxDecoration( | |
| color: Colors.grey.shade800, | |
| borderRadius: | |
| BorderRadius.circular(2), | |
| ), | |
| ), | |
| ], | |
| ); | |
| }, | |
| ), | |
| ), | |
| Text( | |
| ']${((_currentStep + 1) / _loadingSteps.length * 100).toInt()}%', | |
| style: TextStyle( | |
| color: Colors.grey.shade400, | |
| fontSize: 12, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| ], | |
| ), | |
| const SizedBox(height: 8), | |
| Text( | |
| 'Step ${_currentStep + 1}/${_loadingSteps.length} • ${_loadingSteps.length - _currentStep - 1} remaining', | |
| style: TextStyle( | |
| color: Colors.grey.shade500, | |
| fontSize: 10, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| const SizedBox(height: 16), | |
| Text( | |
| 'Powered by Flutter Delivery Engine', | |
| style: TextStyle( | |
| color: Colors.grey.shade600, | |
| fontSize: 10, | |
| fontFamily: 'monospace', | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ], | |
| ), | |
| ), | |
| ), | |
| ), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment