sz_core 2.0.8
sz_core: ^2.0.8 copied to clipboard
SZ Core is a lightweight Flutter utility package that simplifies application development in one package.
example/lib/main.dart
import 'package:flutter/material.dart';
import 'package:sz_core/sz_core.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
SZCore.init();
SZApiSetting.init(
"",
keyStatus: "status", //default status
keyMessage: "message", //default message
keyData: "data", //default data
keyInternet: "internet", //default internet
);
SZCore.printLog(SZCore.formattedTime(DateTime.timestamp(), server: false));
SZCore.printLog(SZCore.formattedTime(DateTime.timestamp()));
SZCore.printLog((await SZCore.getDeviceInfo()).toString());
SZCore.printLog((await SZCore.getDefaultHeader()).toString());
runApp(const MyApp());
}
class MyApp extends StatefulWidget {
const MyApp({super.key});
@override
State<MyApp> createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
int count = 0;
String text = "";
@override
void initState() {
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: const Text('Plugin example app')),
body: Padding(
padding: EdgeInsets.all(10),
child: Column(
children: [
InkWell(
onTap: () async {
var a = await SZCore.getScreenSize();
text = "${a.height}X${a.width}";
setState(() {
count++;
});
SZShow.toast("Test $count");
},
child: Text('COUNT : $count\n\n$text'),
),
SZTextField(
hint: "Test",
bgColor: Colors.white,
borderWidth: 0.1,
suffixIcon: Icons.lock,
height: 38.h,
),
],
),
),
),
);
}
}