itplugin 0.0.6 itplugin: ^0.0.6 copied to clipboard
Plugin desenvolvido e utilizado pela ItHappen.
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:itplugin/controls/it_button.dart';
import 'package:itplugin/controls/it_dialogs.dart';
import 'package:itplugin/itplugin.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
MyApp({Key key}) : super(key: key)
{
ItPlugin.loadingDialog = [
CircularProgressIndicator(strokeWidth: 5 ,),
Padding(
padding: const EdgeInsets.all(20.0),
child: Text("Carregando", style: TextStyle(fontSize: 30, color: Colors.white),),
)
];
}
@override
Widget build(BuildContext context) {
return MaterialApp(
title: "Teste",
home: HomePage(),
);
}
}
class HomePage extends StatefulWidget {
HomePage({Key key}) : super(key: key);
@override
_HomePageState createState() => _HomePageState();
}
class _HomePageState extends State<HomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Container(
child: Center(
child: Container(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
child: ItButton(
"Show Dialog",
onClick: () {
ItDialogs.showLoading(context);
Future.delayed(const Duration(seconds: 3), () {
ItDialogs.hideLoading(context);
});
},
),
),
ItButton(
"Show Alert Dialog",
onClick: () {
ItDialogs.showAlertDialog(context, prefs: ItAlertDialogPrefs("dsa", "asd"));
},
),
],
),
),
),
));
}
}