Created
June 22, 2020 16:49
-
-
Save Albert221/604337202f6d5f357ec8eff8d7d5e33c to your computer and use it in GitHub Desktop.
Tutorial on deploying Arbify locally and using it in your Flutter app
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:arbify_hello_world/l10n/l10n.dart'; | |
import 'package:flutter/material.dart'; | |
void main() { | |
runApp( | |
MaterialApp( | |
supportedLocales: S.delegate.supportedLocales, | |
localizationsDelegates: [ | |
S.delegate, | |
], | |
home: MyHomePage(), | |
onGenerateTitle: (context) => S.of(context).app_name, | |
), | |
); | |
} | |
class MyHomePage extends StatefulWidget { | |
@override | |
_MyHomePageState createState() => _MyHomePageState(); | |
} | |
class _MyHomePageState extends State<MyHomePage> { | |
int _counter = 0; | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
appBar: AppBar( | |
title: Text(S.of(context).app_name), | |
), | |
body: Center( | |
child: Text(S.of(context).button_tapped_message(_counter)), | |
), | |
floatingActionButton: FloatingActionButton( | |
onPressed: () => setState(() => _counter++), | |
child: Icon(Icons.add), | |
), | |
); | |
} | |
} |
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
name: arbify_hello_world | |
description: A new Flutter project. | |
publish_to: 'none' | |
version: 1.0.0+1 | |
environment: | |
sdk: ">=2.7.0 <3.0.0" | |
dependencies: | |
flutter: | |
sdk: flutter | |
arbify: ^0.0.6 | |
intl: ^0.16.1 | |
dev_dependencies: | |
flutter_test: | |
sdk: flutter | |
flutter: | |
uses-material-design: true | |
arbify: | |
url: http://localhost:8000 | |
project_id: 1 | |
output_dir: lib/l10n # This is the default value. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment