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'; | |
| class SafeAreaExample extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| home: Scaffold( | |
| body: SafeArea( | |
| child: Column( | |
| mainAxisAlignment: MainAxisAlignment.spaceBetween, |
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/widgets.dart'; | |
| import 'dart:math'; | |
| main() => runApp(Directionality( | |
| textDirection: TextDirection.ltr, | |
| child: ListExample(), | |
| )); | |
| class ListExample extends StatelessWidget { | |
| final double cellSize = 50; |
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
| ListView( | |
| children: [ | |
| Item(), | |
| Item(), | |
| ], | |
| ) |
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
| Container( | |
| child: SingleChildScrollView( | |
| child: Text('long lorem text'), // any other widget can be here | |
| ), | |
| ) |
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 WrapExample extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Wrap( | |
| direction: Axis.vertical, | |
| children: [ | |
| Item(), | |
| Item(), | |
| Item(), | |
| ], |
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 SliderExample extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Container( | |
| child: Column( | |
| mainAxisSize: MainAxisSize.max, | |
| children: [ | |
| Expanded( | |
| child: Container( | |
| child: Center( |
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 SliderExample extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Container( | |
| width: 300, | |
| child: Column( | |
| mainAxisSize: MainAxisSize.min, | |
| children: [ | |
| Image.network('http://lorempixel.com/300/200/city/'), | |
| SliderButtons(), |
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 StackExample extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Center( | |
| child: Container( | |
| child: Stack( | |
| textDirection: TextDirection.ltr, | |
| children: [ | |
| Circle(size: 120, color: Color(0xFFF44336)), | |
| Positioned( |
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
| Widget build(BuildContext context) { | |
| TextDirection dir = Directionality.of(context); | |
| return Text(dir == TextDirection.ltr ? 'left to right' : 'right to left'); | |
| } |