Skip to content

Instantly share code, notes, and snippets.

@CarloTerracciano
Created September 2, 2024 09:20
Show Gist options
  • Save CarloTerracciano/c8f2655bc7e764d548397afc29a0f01c to your computer and use it in GitHub Desktop.
Save CarloTerracciano/c8f2655bc7e764d548397afc29a0f01c to your computer and use it in GitHub Desktop.
Generated code from pixels2flutter.dev
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
backgroundColor: Colors.black.withOpacity(0.5),
body: Center(
child: ParentalControlDialog(),
),
),
);
}
}
class ParentalControlDialog extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
width: 300,
padding: EdgeInsets.all(20),
decoration: BoxDecoration(
color: Color(0xFF4A4A8A),
borderRadius: BorderRadius.circular(20),
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
decoration: BoxDecoration(
color: Color(0xFFFFD700),
shape: BoxShape.circle,
),
child: IconButton(
icon: Icon(Icons.close),
color: Colors.white,
onPressed: () {},
),
),
],
),
SizedBox(height: 10),
Text(
'Para mamá y papá',
style: TextStyle(
color: Colors.white,
fontSize: 20,
fontFamily: 'Arial',
),
),
SizedBox(height: 10),
Text(
'Escribe los números:\nseis, uno, ocho',
textAlign: TextAlign.center,
style: TextStyle(
color: Colors.white,
fontSize: 16,
fontFamily: 'Arial',
),
),
SizedBox(height: 20),
Container(
padding: EdgeInsets.symmetric(horizontal: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10),
),
child: Row(
children: [
Expanded(
child: TextField(
decoration: InputDecoration(
border: InputBorder.none,
),
),
),
IconButton(
icon: Icon(Icons.close),
color: Color(0xFFFFD700),
onPressed: () {},
),
],
),
),
SizedBox(height: 20),
GridView.count(
crossAxisCount: 3,
shrinkWrap: true,
mainAxisSpacing: 10,
crossAxisSpacing: 10,
children: List.generate(10, (index) {
return ElevatedButton(
style: ElevatedButton.styleFrom(
primary: Colors.white,
shape: CircleBorder(),
padding: EdgeInsets.all(20),
),
onPressed: () {},
child: Text(
'${index == 9 ? 0 : index + 1}',
style: TextStyle(
color: Color(0xFFFFD700),
fontSize: 24,
fontFamily: 'Arial',
),
),
);
}),
),
],
),
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment