Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@jediyeti
jediyeti / inherited_widget_example.dart
Created February 4, 2020 10:37
Inherited Widget Example
import 'package:flutter/material.dart';
void main() {
runApp(
InitialCounterValueProvider(
value: 5,
child: MaterialApp(
title: 'Flutter Tutorial',
home: TutorialHome(),
),
@jediyeti
jediyeti / inherited.dart
Created February 4, 2020 10:12
Inherited Widget Ticking Example
import 'package:flutter/material.dart';
void main() {
runApp(RebuidingWidget());
}
class RebuidingWidget extends StatefulWidget {
@override
_RebuildingWidgetState createState() => _RebuildingWidgetState();
}
@jediyeti
jediyeti / grid_view_example.dart
Created February 3, 2020 09:47
Grid View Example
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
final List<Widget> widgetsList = [
Container(
padding: const EdgeInsets.all(8),
@jediyeti
jediyeti / list_view_example.dart
Created February 1, 2020 17:52
ListView Example
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugPaintSizeEnabled = false;
runApp(MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
final List<Widget> widgetsList = [
@jediyeti
jediyeti / container.dart
Created January 31, 2020 15:50
Container Example
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugPaintSizeEnabled = false;
runApp(MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
@override
@jediyeti
jediyeti / rows_and_columns.dart
Created January 31, 2020 15:03
Rows And Columns Example
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
void main() {
debugPaintSizeEnabled = false;
runApp(MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
@override
@jediyeti
jediyeti / stack_example.dart
Last active January 31, 2020 16:02
Stack Example
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(home: MyApp()));
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
@jediyeti
jediyeti / complex_layout.dart
Created January 30, 2020 16:02
Complex Layout
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
Color color = Theme.of(context).primaryColor;
@jediyeti
jediyeti / local_keys.dart
Last active January 30, 2020 14:01
Local keys
import 'package:flutter/material.dart';
import 'dart:math';
// stateless elements scheme
// https://hsto.org/webt/ha/dh/vy/hadhvybi_mhjvuwdiiucmmx2w6i.gif
// stateful elements before tile swap
// https://hsto.org/webt/dh/ay/sh/dhayshomjpkfv7b45fxmx1ecduw.gif