azbox 1.0.8 copy "azbox: ^1.0.8" to clipboard
azbox: ^1.0.8 copied to clipboard

Easy and fast internationalization for your Flutter Apps. Translate your apps using AZBox.

example/lib/main.dart

import 'constants.dart';
import 'package:flutter/material.dart';
import 'package:azbox/azbox.dart';

void main() {

  Azbox.ensureInitialized(
    apiKey: Constants.kAzboxApiKey,
    projectId: Constants.kAzboxProject);

  runApp(
    const Azbox(
      child: MyApp()));
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Azbox Demo'.translate(),
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Azbox 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> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            const Text(
              'You have pushed the button this many times:',
            ).translate(),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment'.translate(),
        child: const Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}
4
likes
50
points
49
downloads

Publisher

unverified uploader

Weekly Downloads

Easy and fast internationalization for your Flutter Apps. Translate your apps using AZBox.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

async, flutter, flutter_localizations, hive_flutter, http, intl, path_provider

More

Packages that depend on azbox