I am trying to show a screen in flutter which should appear only for 10 seconds and then should disapper going back to previous screen. How this should be done in the correct manner in flutter. Is it possible to use timer.periodic in Flutter?
How to show a new screen for 10 seconds only: Flutter
418 Views Asked by ayush At
2
There are 2 best solutions below
0
Md. Yeasin Sheikh
On
You can create new screen with Future.delayed inside initState
class NewPage extends StatefulWidget {
NewPage({Key? key}) : super(key: key);
@override
State<NewPage> createState() => _NewPageState();
}
class _NewPageState extends State<NewPage> {
@override
void initState() {
super.initState();
Future.delayed(Duration(seconds: 10)).then((value) {
Navigator.of(context).pop();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
);
}
}
Related Questions in FLUTTER
- Flutter + Dart: Editing name of a tab shows up a black screen
- The Binary Version Of its metadata is 1.8.0, expected Version is 1.6.0 build error
- Way to get CustomPainter to track face in Camera Flutter MLKit
- flutter Null check error: did not show file and line number
- Creating multiple instances of a class with different initializing values in Flutter
- I want to paste stickers into to my TextField and to show the stickers beside the emojis
- Flutter plugin development android src not opening after opening example
- Module not found when building flutter app for IOS
- How to make barrier area interactive in flutter modal bottom sheet
- Can an RPC result be included in a Supabase select function in Flutter for Data Modeling?
- Why do I need to wait to reaccess to Firestore database even though it has already done before?
- Flutter web app on Windows -how to support mouse drag for horizontal and vertical scrolling as well as using mouse wheel
- I wrote this time displaying FLUTTER app, How can I improve it?
- Appwrite and / or Spring Boot Backend
- Flutter two_dimensional_scrollables Web app Chrome - cannot get horizontal scroll to work?
Related Questions in ASYNCHRONOUS
- Callback and Microtask Queue of Java Script
- Occasional crash at NSURLSessionDataTask dataTaskWithRequest:completionHandler:
- Musical chairs: How can an asynchronous task cancel a synchronous one in c#?
- Asynchronously add to queue, synchronously process it
- Sending asynchronous requests without a pre-defined task list
- Value of a variable remains unaltered when assigned during a loop
- How to efficiently test some HTTP proxies for accessing a specific domain?
- How do you update Celery Task State/Status to see it in Flower?
- Why use tasks and async await in C# inline?
- NEXTJS14 DRIZZLE : Async issue when trying to post data from component into DB
- Blocking wait on future OUTSIDE of async functions
- save to csv simultaneously opcua datachange notification
- How can I load data from secrets-manager synchronously in TypeScript
- How to avoid timeout of API before ending?
- Conditional Synchronous Import in JavaScript, to export a simple object and not promise, possible?
Related Questions in TIMER
- DateTimePicker not working, textField not updating with selected hours and minutes
- Timer stops the program before it is over
- I cannot get this to redirect. The timer works but it doesn't go anywhere. I need this to redirect to another webpage
- Enabling one timer using another
- iOS Swift Timer sometimes fires much later than expected
- Canceling stop the animation made with requestAnimationFrame()
- How to dynamically change fields in blocs flutter
- How to show countdown for all angular pages without resetting
- Problems with function called by System.Threading.Timer
- Angular 17 does not update view using setInterval with NG0500 error in console
- How to time how long a bash alias took to execute (solved... maybe?)
- I'm using JSF and after a timer expires, I want to display a warning
- Under the swiftUI framework, the timer cannot continue to count in the background
- requestAnimationFrame not working when callback not utilised directly
- Crash on Timer Callback in Swift: closure #1 in ViewController.updateTimer() Causes App to Crash
Related Questions in NAVIGATION
- Why might react-router navigate(-1) go back two routes/pages?
- In @react-navigation's Tab.Navigator, I aim to lock the final screen while allowing the rest to scroll
- (ros melodic) Lidar odometry is not working well
- How to jump to a div using keyboard shortcuts?
- Flutter: How to use a BottomSheet in a BottomNavigationBar?
- Force security constraint managed 403 error when hitting restricted page with h:commandLink
- In Entity Framework Core, how to populate self-referencing navigation collection without additional Include (using only entities already tracked)?
- Blogger next previous navigations missing
- Cannot achieve live navigation using js,openstreetmap and leaflet
- Im using mapbox sdk navigation v2 and have a problem with the cycling view
- Assigning sensor information to image coordinates
- Blazor InteractiveServer navigate to external link whilst JWT added to the request headers?
- Navigate to a different page from the side bar drawer without using the bottom navigation bar using persistent flutter package
- WPF C# - Textblock inputs not saving on Navigation to new page?
- React Chrome vs Firefox Navigation is not defined
Related Questions in PERIODIC-TASK
- Celery doesn't detect and register tasks in django python
- Django Celery Results Table Missing periodictaskname and taskname Fields
- in Android, Periodic work only runs one time and stops after quitting the app
- Why is aiomqtt.error.MqttError: Operation timed out raised?
- In my .net C# Windows service app I want to execute a function periodicaly. I am not sure how to wait/sleep the program in a precious way?
- I have a C# function that I have to execute every 50ms. But execution of the function sometimes takes>50ms. How can I manage this problem?
- How to use a gRPC client in a Celery task
- How to store response of an api in cache and call api after every 12 hours?
- update value certain time later using django appscheduler
- is there any way or package which can run background tasks every minute periodically in flutter
- I want to implement WorkManager for Periodic work every one minute but WorkManager not work properly so how to implement?
- How can I execute a code in C# (Windows Service) periodically in the most precise way?
- Is there a better way to run a python script periodically besides scheduler?
- WorkManager(CoroutineWorker) - running a task periodically every 12 hours doesn't work
- How to show a new screen for 10 seconds only: Flutter
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
In the initstate of the screen that you wish to close add