Skip to main content

responsive_config 0.1.9 copy "responsive_config: ^0.1.9" to clipboard
responsive_config: ^0.1.9 copied to clipboard

Code generation package, that allows generating responsive classes and responsive variables with annotations.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:example/app_config.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Responsive config',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(
          AppConfig.of(context).title,
        ),
      ),
      body: Container(
        color: Colors.blueAccent,
        margin: EdgeInsets.all(
          AppConfig.of(context).margin,
        ),
        child: Center(
          child: Text(
            AppConfig.of(context).description,
            style: Theme.of(context)
                .textTheme
                .headline4
                ?.copyWith(color: Colors.white),
          ),
        ),
      ),
    );
  }
}
3
likes
140
points
18
downloads

Documentation

API reference

Publisher

verified publishereterkit.com

Weekly Downloads

Code generation package, that allows generating responsive classes and responsive variables with annotations.

License

BSD-3-Clause (license)

Dependencies

analyzer, build, flutter, responsive_annotation, source_gen

More

Packages that depend on responsive_config