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 - Horizontal AND Vertical SYNCED scroll demo | |
// drag with mouse to scroll the 1200x1200 container inside the 300x300 container | |
// headers will scroll in sync | |
// drag the headers and the body will also scroll in sync | |
// Live demo: https://dartpad.dev/?id=2ec2d85015944c32e051d651e8d8e8b1 | |
import 'package:flutter/material.dart'; | |
import 'dart:ui'; | |
import 'package:flutter/rendering.dart'; |
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
// DartPad live demo at https://dartpad.dev/?id=1497bd3ba6ef7e9c25f7434cefd488ae | |
import 'package:flutter/material.dart'; | |
import 'dart:ui'; | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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 'package:flutter/material.dart'; | |
import 'package:linked_scroll_controller/linked_scroll_controller.dart'; | |
class ScrollDemo extends StatefulWidget { | |
@override | |
_ScrollDemoState createState() => _ScrollDemoState(); | |
} | |
class _ScrollDemoState extends State<ScrollDemo> { | |
final List<String> colEntries = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".split(''); |
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
// listening to updates in TabBar when using DefaultTabController. | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp(TabControllerDemo()); | |
} | |
class TabControllerDemo extends StatelessWidget { | |
@override | |
Widget build(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
// Dart & Flutter - Sort an Object List | |
class Product { | |
String name; | |
String category; | |
double price; | |
Product(this.name, this.category, this.price); | |
String asString() { | |
return "$name, $category, $price"; |
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
// DefaultTabController Demo using initialIndex | |
import 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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
{ | |
"top250movies": [ | |
{ | |
"id": 111161, | |
"rank": 1, | |
"title": "The Shawshank Redemption", | |
"fullTitle": "The Shawshank Redemption (1994)", | |
"year": 1994, | |
"image": "https://m.media-amazon.com/images/M/MV5BMDFkYTc0MGEtZmNhMC00ZDIzLWFmNTEtODM1ZmRlYWMwMWFmXkEyXkFqcGdeQXVyMTMxODk2OTU@._V1_UX128_CR0,3,128,176_AL_.jpg", | |
"crew": "Frank Darabont (dir.), Tim Robbins, Morgan Freeman", |
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
// ToDo App Flutter Demo | |
import 'package:flutter/material.dart'; | |
void main() => runApp(const TodoApp()); | |
class TodoApp extends StatelessWidget { | |
const TodoApp({super.key}); | |
@override |
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 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |
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 'package:flutter/material.dart'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
const MyApp({super.key}); |