r_flutter 0.3.1 copy "r_flutter: ^0.3.1" to clipboard
r_flutter: ^0.3.1 copied to clipboard

outdated

Generate constants for resources which require using them as a String like fonts and assets.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:runtime_arb/runtime_arb.dart';
import 'assets.dart';

final i18n = StringsBinding();

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'r_flutter',
      localizationsDelegates: [
        RuntimeArbDelegate({'en'})
      ],
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(),
      body: Padding(
        padding: const EdgeInsets.all(8.0),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            Image(image: Images.extension),
            Assets.svg,
            Text(Assets.testAsset2),
            Text(i18n.hello_there),
            Text(i18n.stringWithPlaceholder('hello')),
          ],
        ),
      ),
    );
  }
}

// this is only needed to run r_flutter tests
// do not add this in your own app
// ignore_for_file: undefined_identifier, undefined_function, uri_does_not_exist
20
likes
0
pub points
64%
popularity

Publisher

unverified uploader

Generate constants for resources which require using them as a String like fonts and assets.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

args, build, build_config, dart_style, path, recase, yaml

More

Packages that depend on r_flutter