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

dev_prokit is a package that provides developers with common functions in project development. It is comprehensive, easy to use, safe and reliable.

example/lib/main.dart

import 'dart:developer';

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'DevProkit Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const GapWidget(),
    );
  }
}

/// Quickly fill the space between widgets with a specified size.
class GapWidget extends StatelessWidget {
  const GapWidget({super.key});

  @override
  Widget build(BuildContext context) {
    /// 1. Gap Example
    """
    10.vGap  (int)
    5.2.vGap (double)
    """;

    /// 2. HEX、HEXA 、AHEX To Color
    """
    '#3bc'.color       (HEX)
    '#33bbcc'.color    (HEX)
    '#33bbccff'.color  (HEXA)
    '#ff33bbcc'.color  (AHEX)
    """;

    /// 3. Widget Edgeinset
    """
    // Widget
    Text('Hello Word').insets(EdgeInsets.zero)
    Text('Hello Word').insetsAll(10)
    Text('Hello Word').insetsOnly(left: 10)
    Text('Hello Word').insetsSymmetric(horizontal: 10, vertical: 20)
    
    // Sliver Widget
    SliverToBoxAdapter(child: Text('Hello Word')).insets(EdgeInsets.zero)
    SliverToBoxAdapter(child: Text('Hello Word')).insetsAll(10)
    SliverToBoxAdapter(child: Text('Hello Word')).insetsOnly(left: 10)
    SliverToBoxAdapter(child: Text('Hello Word')).insetsSymmetric(horizontal: 10, vertical: 20)
    
    // Sliver Subclass
    class PageBoxAdapter extends SliverToBoxAdapter {
      const PageBoxAdapter({super.key});
    }
    PageBoxAdapter().sliverInsets(EdgeInsets.zero)

    // More Methods
    insetsFromViewPadding
    insetsLTRB
    insetsLerp
    """;

    /// 4. TextStyle
    """
    TextStyle().fSize(18)
    TextStyle().fColor(Colors.red)
    TextStyle().bold
    TextStyle().fHeight(1.2)
    ......
    """;

    log('我是模式测试日志输入');

    return Scaffold(
      appBar: AppBar(
        title: const Text('边缘插入'),
      ),
      body: ColoredBox(
        color: Colors.red,
        child: Column(
          children: [
            Container(
              color: Colors.white,
              child: const Text('进行组件边缘插入')
                  .insetsSymmetric(horizontal: 50, vertical: 10),
            ),
            ColoredBox(
              color: Colors.black,
              child: SizedBox(
                height: 60,
                child: Container(
                  color: Colors.green,
                ).insetsOnly(top: 30, right: 100),
              ),
            )
          ],
        ).insetsAll(20),
      ),
    );
  }
}

class PageBoxAdapter extends SliverToBoxAdapter {
  const PageBoxAdapter({super.key});
}
9
likes
0
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

dev_prokit is a package that provides developers with common functions in project development. It is comprehensive, easy to use, safe and reliable.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

dio, flutter

More

Packages that depend on dev_prokit