flutter_master_extensions 0.0.1 copy "flutter_master_extensions: ^0.0.1" to clipboard
flutter_master_extensions: ^0.0.1 copied to clipboard

Set of method-extensions for dart that makes using framework in a much easier and clean way also adds additional functionality.

example/lib/main.dart

import 'package:flutter_master_extensions/flutter_master_extensions.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(
      routes: {"/login": (_) => const LoginScreen()},
      title: 'Flutter Demo',
      theme: ThemeData(primarySwatch: Colors.blue),
      home: Padding(
        padding: 8.0.toPadding,
        child: const HomeScreen(),
      ),
    );
  }
}

class Routes {
  static const login = "/login";
}

class HomeScreen extends StatefulWidget {
  const HomeScreen({super.key});

  @override
  HomeScreenState createState() => HomeScreenState();
}

class HomeScreenState extends State<HomeScreen> {
  @override
  Widget build(BuildContext context) {
    '${[1, 2, 3, 4].mapList((f) => f.toDouble())}'.toLog;
    return Scaffold(
      body: Stack(
        children: <Widget>[
          Container(height: 100, width: 100)
              .withRoundCorners(backgroundColor: Colors.grey)
              .withShadow()
              .onTap(
                () async {
                  final result = await context.pushNamed(Routes.login);
                  '$result'.toLog;
                },
              )
              .withTooltip('just a tooltip')
              .onLongPress(() => 'long press'.toLog)
        ],
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.grey,
      child: Center(
        child: MaterialButton(
          child: const Text('Go Back'),
          onPressed: () => context.pop(),
        ),
      ),
    );
  }
}
4
likes
60
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

Set of method-extensions for dart that makes using framework in a much easier and clean way also adds additional functionality.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSL-1.0 (license)

Dependencies

cached_network_image, flutter, google_fonts, http, intl, quiver, web

More

Packages that depend on flutter_master_extensions