“Routen in Flattern” Code-Antworten

Material App -Routen

///////////////////////////////////////
// Setting up routes on material app //
///////////////////////////////////////

MaterialApp(
  // Start the app with the "/" named route. In this case, the app starts
  // on the FirstScreen widget.
  initialRoute: '/',
  routes: {
    // When navigating to the "/" route, build the FirstScreen widget.
    '/': (context) => FirstScreen(),
    // When navigating to the "/second" route, build the SecondScreen widget.
    '/second': (context) => SecondScreen(),
  },
);
ByZef

Routen in Flattern

// add 
// static String routeName = '/splash';

//main.dart
routes:routes

import 'package:flutter/material.dart';
//import required file

final Map<String, WidgetBuilder> routes = {
  SplashScreen.routeName:(context) => SplashScreen(),
  OnBoard.routeName:(context) => OnBoard(),
  HomeScreen.routeName:(context)=> HomeScreen(),
};
Bijay Poudel

Ähnliche Antworten wie “Routen in Flattern”

Fragen ähnlich wie “Routen in Flattern”

Weitere verwandte Antworten zu “Routen in Flattern” auf Dart

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen