import 'package:flutter/material.dart'; import 'package:local_spend/common/platform/platform_scaffold.dart'; import 'package:local_spend/common/widgets/basic_drawer.dart'; import 'package:shared_preferences/shared_preferences.dart'; class HomePage extends StatefulWidget { @override _HomePageState createState() => _HomePageState(); } class _HomePageState extends State { @override void initState() { super.initState(); _saveCurrentRoute("/HomePage"); } _saveCurrentRoute(String lastRoute) async { SharedPreferences preferences = await SharedPreferences.getInstance(); await preferences.setString('LastScreenRoute', lastRoute); } @override Widget build(BuildContext context) { return PlatformScaffold( appBar: AppBar( title: Text( "Home Page", style: TextStyle(color: Colors.black), ), iconTheme: IconThemeData(color: Colors.black), elevation: Theme.of(context).platform == TargetPlatform.iOS ? 0.0 : 6.0, ), drawer: BasicDrawer(), body: Container( padding: EdgeInsets.all(32.0), child: Center( child: Column( children: [ Text('This is the Home page'), ], ), ), ), ); } }