Created
June 4, 2020 12:38
-
-
Save GursheeshSingh/bbf6e1c198dd1c212ca93dc84df6ca79 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:social_media_widgets/instagram_story_swipe.dart'; | |
import 'screen.dart'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Flutter Demo', | |
theme: ThemeData( | |
primarySwatch: Colors.blue, | |
visualDensity: VisualDensity.adaptivePlatformDensity, | |
), | |
home: MyHomePage(title: 'Flutter example'), | |
); | |
} | |
} | |
class MyHomePage extends StatefulWidget { | |
MyHomePage({Key key, this.title}) : super(key: key); | |
final String title; | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(widget.title), | |
), | |
body: Container( | |
margin: EdgeInsets.symmetric(horizontal: 30), | |
child: Center( | |
child: Column( | |
mainAxisAlignment: MainAxisAlignment.center, | |
children: <Widget>[ | |
SizedBox(height: 16), | |
RaisedButton( | |
onPressed: _onInstagramStorySwipeClicked, | |
child: Text( | |
'Instagram story swipe', | |
textAlign: TextAlign.center, | |
), | |
), | |
SizedBox(height: 16), | |
], | |
), | |
), | |
), | |
); | |
} | |
_onInstagramStorySwipeClicked() { | |
Navigator.push( | |
context, | |
MaterialPageRoute( | |
builder: (context) => InstagramStorySwipe( | |
children: <Widget>[ | |
Screen('Screen 1', Colors.lightBlueAccent), | |
Screen('Screen 2', Colors.redAccent), | |
Screen('Screen 3', Colors.greenAccent), | |
], | |
), | |
), | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment