Skip to content

Instantly share code, notes, and snippets.

View justtwago's full-sized avatar
📱

Artyom Vlasov justtwago

📱
  • Calgary, Alberta, Canada
  • 18:31 (UTC -07:00)
  • LinkedIn in/justtwago
View GitHub Profile
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:example/app/application.dart';
void main() {
runApp(EasyLocalization(
child: Application(),
useOnlyLangCode: true,
supportedLocales: [
Locale.fromSubtags(languageCode: 'en'),
{
"someText": "Some Text"
}
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:example/pages/home/home_page.dart';
class Application extends StatelessWidget {
@override
Widget build(BuildContext context) {
final easyLocalization = EasyLocalization.of(context);
return MaterialApp(
home: HomePage(),
assets:
- assets/localization/en-US.json
- assets/localization/ru-RU.json
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:example/app/application.dart';
void main() {
runApp(EasyLocalization(
child: Application(),
supportedLocales: [
Locale('en', 'US'),
Locale('ru', 'RU'),
dependencies:
easy_localization: <last_version>
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import android.widget.TextView
import androidx.annotation.DrawableRes
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="90dp"
android:padding="8dp">
<ImageView
android:id="@+id/cover"
dependencies {
implementation "androidx.recyclerview:recyclerview:1.1.0"
}