Segment is an SDK-like app designed to showcase the power and functionality of the proxy_core plugin. Its primary purpose is to serve as a reference implementation and demonstration of how to integrate and utilize the proxy_core plugin for advanced proxy and connection management features in Flutter applications.
An app for freedom of internet
First run the following command to generate the necessary files:
- Run
./pre_run_clean.sh - Run
flutter pub run build_runner build - Run
flutter gen-l10n
Run the following commands to run the app:
# Development
$ flutter run main.dartThis project relies on flutter_localizations and follows the official internationalization guide for Flutter.
- To add a new localizable string, open the
app_en.arbfile atlib/l10n/arb/app_en.arb.
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
}
}
- Then add a new key/value and description and run
flutter gen-l10n
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"helloWorld": "Hello World",
"@helloWorld": {
"description": "Hello World Text"
}
}
- Use the new string
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Text(l10n.helloWorld);
}Update the CFBundleLocalizations array in the Info.plist
at ios/Runner/Info.plist to include the new locale.
<!--...-->
<array>
<key>CFBundleLocalizations</key>
<string>en</string>
<string>es</string>
</array><!--...-->- For each supported locale, add a new ARB file in
lib/l10n/arb.
├── l10n
│ ├── arb
│ │ ├── app_en.arb
│ │ └── app_es.arb
- Add the translated strings to each
.arbfile:
app_en.arb
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
}
}
app_es.arb
{
"@@locale": "es",
"counterAppBarTitle": "Contador",
"@counterAppBarTitle": {
"description": "Texto mostrado en la AppBar de la página del contador"
}
}