This file contains hidden or 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
// ONE-WAY IMPLEMENTATION | |
Navigator.push(context, SlideLeftRoute(page: Screen2())); | |
// 1. SLIDE TRANSITION | |
class SlideLeftRoute extends PageRouteBuilder { | |
final Widget page; | |
SlideLeftRoute({this.page}) | |
: super( | |
pageBuilder: ( | |
BuildContext context, |
This file contains hidden or 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
flutter channel beta | |
flutter upgrade | |
flutter config --enable-web |
This file contains hidden or 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
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
// SETTING ORIENTATION TO PORTRAIT | |
SystemChrome.setPreferredOrientations([ | |
DeviceOrientation.portraitUp, | |
DeviceOrientation.portraitDown, | |
]); | |
This file contains hidden or 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
// STABLE | |
When we believe we have a particularly good build, we promote it to the stable channel. | |
We intend to do this more or less every quarter, but this may vary. We recommend that you use this channel for all production app releases. | |
We may ship hotfixes to the stable channel for high-priority bugs, although our intent is to do this rarely. | |
// MASTER | |
The current tip-of-tree, absolute latest cutting edge build. | |
The channel master has the most recent build. | |
No tests were run before build so there might be broken functionality when using this channel. |
This file contains hidden or 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
// Youtube player | |
youtube_player_flutter | |
// Web view | |
flutter_inappwebview | |
// Google fonts | |
google_fonts | |
// App Icon |
This file contains hidden or 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
// Create "ScrollController" | |
final ScrollController scrollController = ScrollController(); | |
// Add "scrollController" to "controller" property inside Scroll widget | |
controller: scrollController, | |
// Now implement scrolling function | |
void onTap(){ | |
scrollController.animateTo(0, duration: Duration(seconds: 2), curve: Curves.easeInOut); | |
// 0 is the offset |
This file contains hidden or 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 'dart:js' as js; | |
//OR | |
import 'dart:html' as html; | |
onPressed: () { | |
js.context.callMethod('open', ['https://play.google.com/store']); | |
//OR | |
html.window.open('https://play.google.com/store', 'new tab'); | |
}, |
This file contains hidden or 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
//Initialising as 'loading..' because text widget (where you'll be using these variables) can't be null | |
String firstName = 'loading...' | |
String lastName = 'loading...' | |
String title = 'loading...' | |
class Screen extends StatefulWidget { | |
@override | |
_ScreenState createState() => _ScreenState(); | |
} |
This file contains hidden or 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
final CollectionReference items = FirebaseFirestore.instance.collection('Orders'); | |
final body = StreamBuilder<QuerySnapshot>( | |
stream: items.snapshots(), | |
builder: (BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) { | |
if (snapshot.hasError) { | |
return Container( | |
child: Center( | |
child: Text('SOME ERROR HAS OCCURED'), | |
), |