screen_corner_radius 2.0.0 copy "screen_corner_radius: ^2.0.0" to clipboard
screen_corner_radius: ^2.0.0 copied to clipboard

Screen Corner Radius plugin.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:screen_corner_radius/screen_corner_radius.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: SafeArea(
          child: FutureBuilder(
            future: ScreenCornerRadius.get(),
            builder: (context, snapshot) {
              final data = snapshot.data;
              if (data == null) {
                return const Center(child: CircularProgressIndicator());
              }

              return Padding(
                padding: const EdgeInsets.all(16),
                child: DecoratedBox(
                  decoration: BoxDecoration(
                    color: Colors.blue,
                    borderRadius: BorderRadius.only(
                      topLeft: Radius.circular(data.topLeft),
                      topRight: Radius.circular(data.topRight),
                      bottomLeft: Radius.circular(data.bottomLeft),
                      bottomRight: Radius.circular(data.bottomRight),
                    ),
                  ),
                  child: Padding(
                    padding: const EdgeInsets.all(32),
                    child: Stack(
                      children: [
                        Align(
                          alignment: Alignment.topLeft,
                          child: Text(
                            data.topLeft.toStringAsFixed(2).toString(),
                            textAlign: TextAlign.center,
                            style: TextStyle(color: Colors.white, fontSize: 32),
                          ),
                        ),
                        Align(
                          alignment: Alignment.topRight,
                          child: Text(
                            data.topRight.toStringAsFixed(2).toString(),
                            textAlign: TextAlign.center,
                            style: TextStyle(color: Colors.white, fontSize: 32),
                          ),
                        ),
                        Align(
                          alignment: Alignment.bottomLeft,
                          child: Text(
                            data.bottomLeft.toStringAsFixed(2).toString(),
                            textAlign: TextAlign.center,
                            style: TextStyle(color: Colors.white, fontSize: 32),
                          ),
                        ),
                        Align(
                          alignment: Alignment.bottomRight,
                          child: Text(
                            data.bottomRight.toStringAsFixed(2).toString(),
                            textAlign: TextAlign.center,
                            style: TextStyle(color: Colors.white, fontSize: 32),
                          ),
                        ),
                      ],
                    ),
                  ),
                ),
              );
            },
          ),
        ),
      ),
    );
  }
}
2
likes
140
points
263
downloads

Publisher

unverified uploader

Weekly Downloads

Screen Corner Radius plugin.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on screen_corner_radius