loading_widget 0.0.1 loading_widget: ^0.0.1 copied to clipboard
A new Flutter project.
import 'package:flutter/material.dart';
import 'package:loading_widget_example/widget.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
title: 'Loading Widget Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: HomeScreen(),
);
}
}
class HomeScreen extends StatefulWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: ElevatedButton(onPressed: (){
LoadingDialogWidget.showDialogLoading(context, Colors.blue);
}, child: Text('Press')),
)
);
}
}