boxw 0.0.46 boxw: ^0.0.46 copied to clipboard
A collection of widget of me
import 'package:boxw/boxw.dart';
import 'package:flutter/material.dart';
void main(List<String> args) {
runApp(MaterialApp(
home: const Home(),
theme: ThemeData(useMaterial3: false),
));
}
class Home extends StatefulWidget {
const Home({super.key});
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: const Text('BoxE'),
),
body: SingleChildScrollView(
child: Column(
children: [
BoxWButton(
child: const Text('Show Dialog (horizontal buttons)'),
onPressed: () {
boxWDialog(
context: context,
title: 'Hello',
content:
'This is a boxw dialog with a long long text\n\nand have multiple lines\nAccept???',
buttons: (context) {
return [
Buttons(
axis: Axis.horizontal,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWOutlinedButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
BoxWTextButton(
child: const Text('Show Dialog (vertical buttons)'),
onPressed: () {
boxWDialog(
context: context,
title: 'Hello',
content: 'This is a boxw dialog',
buttons: (context) {
return [
Buttons(
axis: Axis.vertical,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
BoxWOutlinedButton(
child: const Text('Show Dialog (vertical -> horizontal buttons)'),
onPressed: () {
boxWDialog(
context: context,
title: 'Hello',
content: 'This is a boxw dialog',
buttons: (context) {
return [
Buttons(
axis: Axis.vertical,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
Buttons(
axis: Axis.horizontal,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
BoxWNeumorphismButton(
child: const BoxWNeumorphism(
child: Text('Show Dialog (vertical -> horizontal buttons)'),
),
onPressed: () {
boxWDialog(
context: context,
title: 'Hello',
content: 'This is a boxw dialog',
buttons: (context) {
return [
Buttons(
axis: Axis.horizontal,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
Buttons(
axis: Axis.vertical,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
BoxWOutlinedButton(
child: const Text('Show Dialog (no title)'),
onPressed: () {
boxWDialog(
context: context,
content: 'This is a boxw dialog',
buttons: (context) {
return [
Buttons(
axis: Axis.vertical,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
Buttons(
axis: Axis.horizontal,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
BoxWOutlinedButton(
child: const Text('Show Dialog (no content)'),
onPressed: () {
boxWDialog(
context: context,
title: 'This is a boxw dialog',
buttons: (context) {
return [
Buttons(
axis: Axis.vertical,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
Buttons(
axis: Axis.horizontal,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
BoxWOutlinedButton(
child: const Text('Show Dialog (no title and content)'),
onPressed: () {
boxWDialog(
context: context,
buttonsPadding: EdgeInsets.zero,
buttons: (context) {
return [
Buttons(
axis: Axis.vertical,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
Buttons(
axis: Axis.horizontal,
buttons: [
BoxWButton(
child: const Text('Button 1'),
onPressed: () {},
),
BoxWButton(
child: const Text('Button 2'),
onPressed: () {},
),
],
),
];
},
);
},
),
],
),
),
);
}
}