sz_core 2.0.7 copy "sz_core: ^2.0.7" to clipboard
sz_core: ^2.0.7 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: 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.green,borderRadius: 25,borderWidth: 0.1,),
          ],
        ),
      ),
    );
  }
}
2
likes
0
points
572
downloads

Publisher

verified publishersoftozin.com

Weekly Downloads

SZ Core is a lightweight Flutter utility package that simplifies application development in one package.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter, http, intl, plugin_platform_interface, url_launcher

More

Packages that depend on sz_core

Packages that implement sz_core