dev_prokit 0.0.1
dev_prokit: ^0.0.1 copied to clipboard
dev_prokit is a package that provides flutter developers with common and convenient functions in project development. The package offers comprehensive functionality, ease of use, safety and reliability.
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)
......
""";
return Scaffold(
appBar: AppBar(
title: const Text('颜色转换'),
),
body: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Column(
children: [
const Text('HEX: #FF3B30'),
Container(
color: '#FF3B30'.color,
height: 60,
width: 60,
)
],
),
Column(
children: [
const Text('HEXA: #ff3b30FF'),
Container(
color: '#ff3b30FF'.color,
height: 60,
width: 60,
)
],
),
Column(
children: [
const Text('AHEX: #FFFF3B30'),
Container(
color: '#FFFF3B30'.ahexColor,
height: 60,
width: 60,
)
],
)
],
),
);
}
}
class PageBoxAdapter extends SliverToBoxAdapter {
const PageBoxAdapter({super.key});
}