title: How to properly share an object between different app pages in Flutter
body: <p>I am new to Flutter. I have implemented an arbitrary class which has some states and need to be shared between different pages in Flutter. What I am currently doing is I defined a <code>sqflite</code> database helper and each page loads that object form database and before going to other pages, it saves it again to the database and navigates to other page. However, it adds many complexities and bugs. </p>
  
  <p>Another possible solution could be add it to <code>myApp()</code> class which is called in <code>main()</code> function. However, since other pages do not inherit <code>myApp()</code>, they have no access to <code>global_object</code>. </p>
  
  <pre class="lang-dart prettyprint-override"><code>class MyApp extends StatelessWidget{
  
  // I need gloabl_object accessible in different pages
  //--------------------------------------------------- 
  MyObject global_object; 
  //---------------------------------------------------
  
    @override
    Widget build(BuildContext context){
      return MaterialApp(
        title: 'App title',
        debugShowCheckedModeBanner: false,
        theme: new ThemeData(
          // App theme
        ),
        //home: Homepage(),
        routes: { // Defining routs
          // DIFFERENT PAGES THAT NEEDS TO HAVE ACCESS TO global_object
        },
      );
  }
  </code></pre>