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

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:flutter_localizations/flutter_localizations.dart';
import 'assets.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'r_flutter',
      supportedLocales: I18n.supportedLocales,
      localizationsDelegates: [
        I18n.delegate,
        GlobalMaterialLocalizations.delegate,
        GlobalWidgetsLocalizations.delegate,
      ],
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: Text(I18n.of(context).appName)),
      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.of(context).hello_there),
            Text(I18n.of(context).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
120
pub points
65%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

args, build, build_config, collection, glob, path, recase, yaml

More

Packages that depend on r_flutter