dict_flutter_extension 1.0.1 copy "dict_flutter_extension: ^1.0.1" to clipboard
dict_flutter_extension: ^1.0.1 copied to clipboard

为 Flutter Widget 提供常用扩展方法(点击、内边距、居中、尺寸、可见性等),并封装文件操作、页面导航、Widget 构建等工具类,内部项目通用的 Flutter 语法糖工具库。

example/lib/main.dart

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

/// 演示 dict_flutter_extension 提供的 Widget 扩展与工具类。
void main() => runApp(const MyApp());

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: getMyAppBarNew(context, 'dict_flutter_extension 示例'),
        body: ListView(
          children: [
            // Widget 扩展演示
            const Text('Widget 扩展示例')
                .padding(const EdgeInsets.all(16))
                .center(),

            Text('可点击文本')
                .padding(const EdgeInsets.symmetric(vertical: 8))
                .click(() => debugPrint('InkWell 被点击')),

            Text('GestureDetector 点击')
                .padding(const EdgeInsets.symmetric(vertical: 8))
                .clickGesture(() => debugPrint('GestureDetector 被点击')),

            // 文件工具演示
            ListTile(
              title: const Text('DictFileUtils'),
              subtitle: Text(
                '文件名: ${DictFileUtils.getFileName('/path/to/demo.txt')}\n'
                '后缀: ${DictFileUtils.getFileSuffix('/path/to/demo.txt')}\n'
                '大小: ${DictFileUtils.renderSize(2048)}',
              ),
            ),

            // 间距工具演示
            vb(16),
            const Text('上方间距 16px'),
            vb(16),
            Row(
              children: [
                const Text('左'),
                hb(16),
                const Text('右'),
              ],
            ),
          ],
        ),
      ),
    );
  }
}
1
likes
130
points
36
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

为 Flutter Widget 提供常用扩展方法(点击、内边距、居中、尺寸、可见性等),并封装文件操作、页面导航、Widget 构建等工具类,内部项目通用的 Flutter 语法糖工具库。

Homepage

License

MIT (license)

Dependencies

flutter

More

Packages that depend on dict_flutter_extension