This Flutter tutorial will teach you how Flutter Activity Navigate one Activity to another Activity step by step.this tutorial will teach the the basic steps.
import 'package:flutter/material.dart'; import 'package:my_course/splash_screen/splash_screen.dart'; void main() { runApp(MyApp()); } class MyApp extends StatelessWidget { // This widget is the root of your application. @override Widget build(BuildContext context) { return MaterialApp( title: 'Flutter Demo', debugShowCheckedModeBanner: false, theme: ThemeData( primarySwatch: Colors.blue, ), home: SplashScreen(), ); } }
class Constants { static const IMAGE_PATH = 'assets/images/'; }
import 'package:flutter/material.dart'; import 'package:my_course/home_screen/home_screen.dart'; import 'package:my_course/utils/constants.dart'; import ''; class SplashScreen extends StatefulWidget { const SplashScreen({ Key key }) : super(key: key); @override State<SplashScreen> createState() => _SplashScreenState(); } class _SplashScreenState extends State<SplashScreen> { @override void initState() { navigateToHome(); super.initState(); } void navigateToHome() { Future.delayed(Duration(seconds: 5), (){ Navigator.push(context, MaterialPageRoute(builder: (context) => HomeScreen())); }); } @override Widget build(BuildContext context) { var size = MediaQuery.of(context).size; return Scaffold( body: Center( child: Column( children: [ Container( child: Image.asset('${Constants.IMAGE_PATH}p2.jpg', width: size.width / 1.8, height: size.height / 7, fit: BoxFit.fill, ), ), Text("Mobile Shop", style: TextStyle( fontSize: 30, fontWeight: FontWeight.bold ), ) ], ), ), ); } }
import 'package:flutter/material.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({ Key key }) : super(key: key); @override State<HomeScreen> createState() => _HomeScreenState(); } class _HomeScreenState extends State<HomeScreen> { @override Widget build(BuildContext context) { return Scaffold( body:SafeArea( child: Center(child: Text("home Screen")), ) ); } }
Have you ever wanted to talk to a friendly, smart robot that helps you with…
DeepSeek AI is becoming a friendly and powerful new tool in the world of artificial…
Do you want to become an expert in Spring Boot CRUD operations? This comprehensive tutorial…
Modern websites must have a navigation bar that is clear and responsive. FlexBox CSS is…
Introduction In this section, we will guide you step by step in the development of an image upload registration system in Java using MySQL and JDBC. In the application, users register…
The Touchable Shop POS (Point of Sale) system is a sophisticated software solution developed using…