build_context 0.0.2 copy "build_context: ^0.0.2" to clipboard
build_context: ^0.0.2 copied to clipboard

outdated

Access most used properties in your `BuildContext` instance. This package rely on Dart's extension to provide a easy access for the most used properties and functions that depends on the `BuildContext [...]

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:build_context/build_context.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        scaffoldBackgroundColor: Colors.white24,
        primaryTextTheme: TextTheme(
          title: TextStyle(color: Colors.blue)
        )
      ),
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: context.scaffoldBackgroundColor,
      appBar: AppBar(),
      body: Center(
        child: GestureDetector(
          onTap: () => context.pushNamed('/detailsPage'),
          child: Text(
            'Press Me',
            style: context.primaryTextTheme.title,
          ),
        ),
      ),
    );
  }
}
148
likes
0
pub points
72%
popularity

Publisher

verified publisherpedromassango.dev

Access most used properties in your `BuildContext` instance. This package rely on Dart's extension to provide a easy access for the most used properties and functions that depends on the `BuildContext` instance.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on build_context