relative_border_sized_widget 0.0.4 copy "relative_border_sized_widget: ^0.0.4" to clipboard
relative_border_sized_widget: ^0.0.4 copied to clipboard

A pretty simple widget that adjusts the border according to constraints.

example/lib/main.dart

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

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

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

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

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: RelativeBorderSizedWidget(
        buildBoxDecoration: (constraints) {
          return BoxDecorationDataclass.all(
            radius: const Radius.circular(30),
            borderSide: BorderSide(width: constraints.maxWidth * 0.05),
          );
        },
        child: const Text(
          "Hello, World!",
          style: TextStyle(fontSize: 120),
        ),
      ),
    );
  }
}
0
likes
160
points
17
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A pretty simple widget that adjusts the border according to constraints.

Homepage

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on relative_border_sized_widget