This app shows a colored box that changes size, color, and text when tapped. It uses animation and shadows to look polished and smooth.
import 'package:flutter/material.dart';
void main() => runApp(PolishedApp());
class PolishedApp extends StatefulWidget {
@override
State<PolishedApp> createState() => _PolishedAppState();
}
class _PolishedAppState extends State<PolishedApp> {
bool _toggled = false;
void _toggleBox() {
setState(() {
_toggled = !_toggled;
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(title: Text('Polished UI Example')),
body: Center(
child: GestureDetector(
onTap: _toggleBox,
child: AnimatedContainer(
duration: Duration(seconds: 1),
curve: Curves.easeInOut,
width: _toggled ? 250 : 150,
height: _toggled ? 250 : 150,
decoration: BoxDecoration(
color: _toggled ? Colors.deepPurple : Colors.blueAccent,
borderRadius: BorderRadius.circular(_toggled ? 40 : 20),
boxShadow: [
BoxShadow(
color: Colors.black26,
blurRadius: 15,
offset: Offset(0, 8),
),
],
),
child: Center(
child: Text(
_toggled ? 'Tapped!' : 'Tap Me',
style: TextStyle(color: Colors.white, fontSize: 28),
),
),
),
),
),
),
);
}
}