r_flutter 0.4.0 copy "r_flutter: ^0.4.0" to clipboard
r_flutter: ^0.4.0 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: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
0
pub points
73%
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