Skip to content

Instantly share code, notes, and snippets.

View k4zek4ge's full-sized avatar

k4zek4ge k4zek4ge

View GitHub Profile
@k4zek4ge
k4zek4ge / main.sh
Last active October 21, 2023 18:15
[flutter basic commands] #flutter enable web build create channel
# edit $HOME/.bash_profile or $HOME/.bashrc.
# macOS Catalina uses the Z shell by default, so edit $HOME/.zshrc
# source $HOME/.<rc file> to refresh the current window
# Verify that the flutter/bin directory is now in your PATH by running: echo $PATH
# Verify that the flutter command is available by running: which flutter
# iOS setup
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
open -a Simulator
return: padding: const EdgeInsets.all(8.0),
child: Table(
columnWidths: {0: IntrinsicColumnWidth()},
defaultVerticalAlignment: TableCellVerticalAlignment.middle,
children: [
TableRow(
children: [
Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(
void main() {
ui.platformViewRegistry.registerViewFactory(
'hello-world-html',
(int viewId) => IFrameElement()
..width = '640'
..height = '360'
..src = 'https://www.youtube.com/embed/IyFZznAk69U'
..style.border = 'none');
runApp(Directionality(
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp])
.then((_) {
runApp(new MyApp());
});
import 'dart:convert';
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: MyApp(),
));
}
# to view current channel
flutter channel
# Now with Flutter 1.9
flutter channel master
flutter upgrade
flutter config --enable-web
cd <into project directory>
import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
//play loop infinite
Image.network('https://example.com/animated-image.gif')
//
import 'package:flutter/material.dart';
void main() {
runApp(new MyApp());
}
//=========================
//Use toSet and then toList
var ids = [1, 4, 4, 4, 5, 6, 6];
var distinctIds = ids.toSet().toList(); //[1, 4, 5, 6]
//=========================
isEven(x) => x % 2 == 0;
main() {
import 'package:flutter/material.dart';
void main() => runApp(new MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: App(),