flutter_bootsrap 0.0.1 flutter_bootsrap: ^0.0.1 copied to clipboard
Let's see if the package works
import 'package:flutter/material.dart';
import 'package:flutter_bootsrap/flutter_bootsrap.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Flutter_Bootsrap Package'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Center(
child: Text(
'to show custom alert box please click floating action button.'),
),
floatingActionButton: FloatingActionButton(
onPressed: () async {
await FlutterBootsrap.showCustomAlertBox(
context: context,
willDisplayWidget: Container(
child: Text('My custom alert box, used from example!!'),
));
},
tooltip: 'Show Custom Alert Box',
child: Icon(Icons.message),
),
);
}
}