Created
September 21, 2022 23:28
-
-
Save VB10/578d1ba0ce2ee29c917068e96f669c3d to your computer and use it in GitHub Desktop.
Duration Values
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 'package:flutter/material.dart'; | |
| enum Durations { | |
| low(Duration(milliseconds: 500)), | |
| normal(Duration(seconds: 1)), | |
| high(Duration(seconds: 3)); | |
| final Duration value; | |
| const Durations(this.value); | |
| } | |
| class HomeTest extends StatelessWidget { | |
| const HomeTest({super.key}); | |
| @override | |
| Widget build(BuildContext context) { | |
| return FutureBuilder( | |
| future: Future.delayed(Durations.normal.value), | |
| builder: (BuildContext context, AsyncSnapshot snapshot) => const SizedBox(), | |
| ); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment