dev_prokit 0.0.3 copy "dev_prokit: ^0.0.3" to clipboard
dev_prokit: ^0.0.3 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 '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)
    ......
    """;

    /// 5. Log
    """
    Dio dio = new Dio(baseOptions);
    dio.interceptors
      ..add(const LogDiyInterceptor(type: LogType.rich));
    """;

    const TextStyle tStyle = TextStyle(fontFamily: 'Rc', height: 1);
    return Scaffold(
      appBar: AppBar(
        title: Text(
          '文本样式',
          style: tStyle.bold,
        ),
      ),
      body: Column(
        children: [
          Text(
            '设置字重',
            textDirection: TextDirection.rtl,
            style: tStyle.medium,
          ).insetsOnly(right: 200),
          Text(
            '设置大小',
            style: tStyle.fSize(20),
          ).insets(const EdgeInsetsDirectional.all(30)),
          Text(
            '设置文本颜色',
            style: tStyle.fColor(Colors.red),
          ),
          SizedBox(
            width: 60,
            child: Text(
              '设置溢出格式',
              textDirection: TextDirection.rtl,
              style: tStyle.oFlow(TextOverflow.ellipsis),
            ),
          ),
          Text(
            '设置文字字母间距',
            style: tStyle.lSpacing(5),
          ),
          Text(
            '设置文字字体间距ab like',
            style: tStyle.wSpacing(50),
          )
        ],
      ).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