Flutter功能未明确定义插件ease的潜在使用
Flutter功能未明确定义插件Ease的潜在使用
本README描述了该插件的功能。如果您将此插件发布到pub.dev,则此README的内容将在您的插件页面上显示。
关于如何编写好的插件README,可以参考Dart指南。
对于开发插件的一般信息,可以参考Dart指南和Flutter指南。
Ease
这个包包含了在Flutter中可重用的任何东西,如自定义小部件、动画等。
特性
- 1- 自定义
text
小部件,简化其使用。 - 2- 自定义
text field
小部件,带简单的验证。 - 3- 超酷的动画
splash screen
。 - 4- 简单易用的
geolocator
和connectivity
服务。 - 5- 非常有用的
extensions
。 - 6- 动态主题,支持持久化,可在1分钟内实现(即将推出)。
- 7- 最简单的本地化实现(即将推出)。
- 8- 信用卡小部件。
- 9- 动画
ProductCard
小部件。 - 10- 两个非常棒的动画
NavBars
小部件,易于使用。 - 许多验证器可供使用。
开始使用
在您的Android/app/build.gradle
文件中,将compileSdkVersion
编辑为31:
android {
compileSdkVersion 31
}
使用
小部件及其使用方法
TextFormField 带简单的验证指示
EaseTxtForm(
controller: myEditingController,
)
文本简化使用
EaseTxt("Hello World", color: Colors.blue)
玻璃容器
EaseGlassContainer(
child: Txt("Hello World", color: Colors.blue)
)
动画ProductCard
EaseProductCard(
image: NetworkImage(
"https://cdn-icons.flaticon.com/png/512/2930/premium/2930679.png?token=exp=1638474347~hmac=f895ca5646f06b4e9703ebd80aa8fa9a"),
title: "GOOD PACKAGE",
primarytActionLabel: "PRIMARY ACTION",
price: "300 EGP",
rate: 3,
)
优秀的TabBar,易于使用
EaseTabBar(
iconButtons: [],
child: Column()
)
带动画的SplashScreen
EaseSplashScreen(
homePage: HomeScreen(),
logo: Image.asset("assets/logo"),
slogan: "PR are welcome"
)
服务及其使用方法
在每个服务中,您会找到需要导入的内容以及如何使用。
例如: 位置服务会告诉您使用Getx和geolocator包。
使用方式如下:
Position location = await EaseLocatorService.determinePosition();
是不是很简单?
其他信息
如果您有任何想法,认为这将是一个很好的补充,请贡献或添加一个issue到GitHub仓库。如果在某个地方卡住了?请加入我们的Telegram群组。
我会尽快添加它,希望您能支持并关注这个仓库。
示例应用
以下是一个使用Ease的示例应用。
import 'package:ease/flutter_shortcut/flutter_shortcut.dart';
import 'package:flutter/material.dart';
var themes = Themes(lightTheme: ThemeData.light(), darkTheme: ThemeData.dark());
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
[@override](/user/override)
Widget build(BuildContext context) {
return MaterialApp(
title: 'Material App',
home: const SplashScreen(),
theme: themes.lightTheme,
darkTheme: themes.darkTheme,
themeMode: ThemeService().theme,
);
}
}
class SplashScreen extends StatelessWidget {
const SplashScreen({Key? key}) : super(key: key);
[@override](/user/override)
Widget build(BuildContext context) {
return Scaffold(
body: SplashScreenWidget(
homePage: const HomePage(),
logo: SizedBox(
child: Image.asset('assets/images/logo.png'),
height: MediaQuery.of(context).size.height * 0.3,
width: MediaQuery.of(context).size.width * 0.3,
),
slogan: "slogan",
duration: const Duration(seconds: 2),
backgroundColor: Colors.indigo.shade100,
),
);
}
}
class HomePage extends StatefulWidget {
const HomePage({Key? key}) : super(key: key);
[@override](/user/override)
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
TextEditingController textField = TextEditingController();
[@override](/user/override)
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Txt(
"Ease",
color: Colors.indigo,
size: 30,
textAlign: TextAlign.center,
weight: FontWeight.bold,
),
const SizedBox(height: 12.0),
TxtForm(
textfieldName: "Text form Widget",
editingController: textField,
autofillHints: const [AutofillHints.name],
textfieldHint: " super easeful",
),
TextButton(
onPressed: () {
ThemeService().switchTheme();
setState(() {});
},
child: const Txt("change theme")
)
],
),
),
);
}
}
更多关于Flutter功能未明确定义插件ease的潜在使用的实战教程也可以访问 https://www.itying.com/category-92-b0.html
1 回复