Skip to content

Instantly share code, notes, and snippets.

View littleironical's full-sized avatar
👻
keep your fingers sharp

Hardik Kumar littleironical

👻
keep your fingers sharp
View GitHub Profile
// Youtube player
youtube_player_flutter
// Web view
flutter_inappwebview
// Google fonts
google_fonts
// App Icon
// 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.
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
// SETTING ORIENTATION TO PORTRAIT
SystemChrome.setPreferredOrientations([
DeviceOrientation.portraitUp,
DeviceOrientation.portraitDown,
]);
// SAVING DATA
saveString(key, value) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setString(key, value);
}
saveDouble(key, value) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
prefs.setDouble(key, value);
}
flutter channel beta
flutter upgrade
flutter config --enable-web
// 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,
DIRECTORY
cd </file/path/code> -> change directory to a project
INITIALIZING
1. git init -> initialize an empty git repository
STATUS CHECK
2. git status -> list of files changed & those which needs to be staged or commit
STAGING & UNSTAGING
//Have to define the _controller inside initState() to make it work properly.
//Inside StateFulClass:
YoutubePlayerController _controller;
@override
void initState() {
_controller = YoutubePlayerController(
initialVideoId:
YoutubePlayer.convertUrlToId(widget.videoLink),
//In AndoidManifest.xml file inside android/app/src/main, add this line below package name
<uses-permission android:name="android.permission.INTERNET"/>
// TYPE1: This will show a provided color when pinned
flexibleSpace: FlexibleSpaceBar(
background: Image.network("https://wallpaperseven.com/wallpapers/Grey-Abstract-4k-Wallpaper-scaled.jpg", fit: BoxFit.cover,),
)
//TYPE2: This will show background image when pinned
flexibleSpace: Stack(
children: <Widget>[
Positioned.fill(
child: Image.network(