Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Demonstrates the textDirection property in both the Row and Column widget.
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
MyApp({Key key}) : super(key: key);
State createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: Text('Sample Code'),
),
body: Center(child: Column /* Row */(
// textDirection: TextDirection.rtl,
// verticalDirection: VerticalDirection.up,
children: <Widget>[
const Text("This is the first line."),
const Text("This is the second line."),
],
)),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment