The widget is not appearing up - Flutter

Viewed 61

I'm using AdvancedPageTurn widget from advanced_page_turn package. I wrapped this widget inside the Scaffold body property. The widget is appearing on the simulator perfectly, but when I launch the application on the real device, that particular AdvancedPageTurn widget is not appearing up at all.

What could be the problem?

class Lyrics extends StatefulWidget {

 @override
 _LyricsState createState() => _LyricsState();
}

class _LyricsState extends State<Lyrics> {
 final _controller = GlobalKey<AdvancedPageTurnState>();


 @override
 Widget build(BuildContext context) {
   return Scaffold(
     appBar: AppBar(
       title: Text('App Title', style: TextStyle(color: Colors.white, fontWeight: FontWeight.bold, fontFamily: 'oswald'),),
       centerTitle: true,
       flexibleSpace: Image(
         image: AssetImage('images/bg.jpg'),
         fit: BoxFit.cover,
       ),
     ),
     body: SafeArea(child: AdvancedPageTurn( // The Widget content is not appearing up at all but working fine on emulator 
       key: _controller,
       initialIndex: 0,
       children: [
           Container(
             decoration: BoxDecoration(
               image: DecorationImage(image: AssetImage('images/bg.jpg'), fit: BoxFit.cover),
             ),
             padding: EdgeInsets.all(25.0),
             child: Column(
               mainAxisAlignment: MainAxisAlignment.center,
               children: [
                 Text('Title 1', style: TextStyle(fontSize: 28.0, height: 1.8, fontWeight: FontWeight.bold, color: Colors.white, fontFamily: 'oswald'), textAlign: TextAlign.center,),
               ],
             ),
           ),
           Container(
           decoration: BoxDecoration(
             image: DecorationImage(image: AssetImage('images/bg.jpg'), fit: BoxFit.cover),
           ),
           padding: EdgeInsets.all(25.0),
           child: Column(
             mainAxisAlignment: MainAxisAlignment.center,
             children: [
                 Text('Title 2', style: TextStyle(fontSize: 28.0, height: 1.8, fontWeight: FontWeight.bold, color: Colors.white, fontFamily: 'oswald'), textAlign: TextAlign.center,),  
             ],
           ),
         ),

       ],
     ),
     ),
   );
 }
}
0 Answers
Related