Search
 
SCRIPT & CODE EXAMPLE
 

DART

onboarding screen flutter

int initScreen;

Future<void> main() async {
  WidgetsFlutterBinding.ensureInitialized();
  SharedPreferences prefs = await SharedPreferences.getInstance();
  initScreen = await prefs.getInt("initScreen");
  await prefs.setInt("initScreen", 1);
  print('initScreen ${initScreen}');
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      initialRoute: initScreen == 0 || initScreen == null ? "first" : "/",
      routes: {
        '/': (context) => MyHomePage(
              title: "demo",
            ),
        "first": (context) => OnboardingScreen(),
      },
    );
  }
}
Comment

PREVIOUS NEXT
Code Example
Dart :: what does translate do in transform widget fluter 
Dart :: concat array dart 
Dart :: camera focus permission in android 
Dart :: convert datetime to TZDateTimeflutter 
Dart :: function in dart 
Dart :: DateFormat local fr flutter 
Dart :: how to show ad every second flutter 
Dart :: change color of container on tap flutter 
Dart :: dart fold 
Dart :: dart fixed length list 
Dart :: dart string equals 
Dart :: speedometer in flutter 
Dart :: android studio not detecting new package in flutter 
Dart :: is init state executed when returning with navigator flutter 
Dart :: link failed but did not provide an info log flutter 
Dart :: Flutter Text new fline 
Dart :: flutter sidebox 
Dart :: rectangualr fab in flutter 
Dart :: showing ads every x seconds flutter 
Dart :: limited box flutter 
Dart :: dart remove the last letter in a string 
Swift :: conert data to string swift 
Swift :: update cell value swift 
Swift :: how to swift pie chart quartzcore framework 
Swift :: swift corner radious of view controller 
Swift :: how to get the last element of an array in swift 
Swift :: how to make box shadow swift 
Swift :: post API Call in swift 
Swift :: fade anumation swift 
Swift :: We use the for loop to iterate over the elements of a dictionary. 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =