arabic_roman_conv 0.1.0-dev.2 arabic_roman_conv: ^0.1.0-dev.2 copied to clipboard
a flexible, easy-to-use Flutter package that provides tools for the conversion of Arabic names and phrases to their Romanized (English) counterparts.
import 'package:flutter/material.dart';
import 'package:arabic_roman_conv/arabic_roman_conv.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Arabic Roman Conv Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
useMaterial3: true,
),
home: const MyHomePage(title: 'Arbic Roman Conv Demo'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
String _text = '';
final ArabicRomanConv romanizationService = ArabicRomanConv();
void _updateText(String text) {
setState(() {
_text = romanizationService.toRoman(text);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Padding(
padding: const EdgeInsets.all(12.0),
child: TextField(
onChanged: _updateText,
decoration: const InputDecoration(
border: OutlineInputBorder(),
labelText: 'Enter Arabic text',
),
),
),
Text(
_text,
style: Theme.of(context).textTheme.titleMedium,
),
],
),
),
);
}
}