Skip to content

Instantly share code, notes, and snippets.

@dickermoshe
Last active April 19, 2023 04:12
Show Gist options
  • Save dickermoshe/2ac2f423d26bd7a12ecb26445e013323 to your computer and use it in GitHub Desktop.
Save dickermoshe/2ac2f423d26bd7a12ecb26445e013323 to your computer and use it in GitHub Desktop.
import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
double wordSpacingAmount = 20;
String englishText = 'Lorem ipsum dolor sit amet';
String hebrewText = 'טקסט ללא רווח בין מילים';
String arabicText = 'نص مع عدم وجود مسافات بين الكلمات';
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
const Text(
'English',
style: TextStyle(fontSize: 24),
),
Text(
englishText,
style: const TextStyle(),
),
Text(
englishText,
style: TextStyle(wordSpacing: wordSpacingAmount),
),
const SizedBox(height: 20),
const Text(
'Hebrew',
style: TextStyle(fontSize: 24),
),
Text(
hebrewText,
style: const TextStyle(),
),
Text(
hebrewText,
style: TextStyle(wordSpacing: wordSpacingAmount),
),
const SizedBox(height: 20),
const Text(
'Arabic',
style: TextStyle(fontSize: 24),
),
Text(
arabicText,
style: const TextStyle(),
),
Text(
arabicText,
style: TextStyle(wordSpacing: wordSpacingAmount),
),
const SizedBox(height: 20),
const Text(
'With Hebrew Font',
textDirection: TextDirection.rtl,
style: TextStyle(fontSize: 24),
),
Text(
hebrewText,
style: GoogleFonts.openSans(),
),
Text(
hebrewText,
style: GoogleFonts.openSans(wordSpacing: wordSpacingAmount),
),
const SizedBox(height: 20),
const Text(
'Arabic',
textDirection: TextDirection.rtl,
style: TextStyle(fontSize: 24),
),
Text(
arabicText,
style: TextStyle(),
),
Text(
arabicText,
style: TextStyle(wordSpacing: wordSpacingAmount),
),
const SizedBox(height: 20),
const Text(
'With Arabic Font',
textDirection: TextDirection.rtl,
style: TextStyle(fontSize: 24),
),
Text(
arabicText,
style: GoogleFonts.cairo(),
),
Text(
arabicText,
style: GoogleFonts.cairo(wordSpacing: wordSpacingAmount),
),
],
),
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment