cached_build_runner 0.0.6 copy "cached_build_runner: ^0.0.6" to clipboard
cached_build_runner: ^0.0.6 copied to clipboard

Optimizes the build_runner by caching generated codes for non changed .dart files

example/lib/main.dart

import 'package:example/models/counter_model.dart';
import 'package:flutter/material.dart';

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

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

  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter 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> {
  final _counterModel = CounterModel(
    description: 'Model which can keep a count.',
  );

  void _incrementCounter() {
    setState(() {
      _counterModel.count++;
    });
  }

  @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:',
            ),
            Text(
              '${_counterModel.count}',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
            Text(
              '${_counterModel.toJson()}',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: const Icon(Icons.add),
      ),
    );
  }
}
16
likes
150
points
3.44k
downloads

Publisher

verified publishernetglade.cz

Weekly Downloads

Optimizes the build_runner by caching generated codes for non changed .dart files

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

args, crypto, hive, logger, path, redis, synchronized

More

Packages that depend on cached_build_runner