2 845
- نبدأ ننزل لكم اكواد Dart By Flutter ? .. تفيدكم
Shall we start downloading Dart By Flutter codes for you? .. Will they be useful to you?
11 nov 2024, 20:17
08 abr 2025, ~11:58
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Advanced Button Example',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
appBar: AppBar(
title: Text('Advanced Button Example'),
),
body: Center(
child: AdvancedButton(
text: 'Press Me ',
onPressed: () {
print('Button Pressed !');
},
),
),
),
);
}
}
class AdvancedButton extends StatelessWidget {
final String text;
final VoidCallback onPressed;
const AdvancedButton({Key? key, required this.text, required this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: onPressed,
child: Container(
decoration: BoxDecoration(
gradient: LinearGradient(
colors: [Colors.blue, Colors.green],
begin: Alignment.topLeft,
end: Alignment.bottomRight,
),
boxShadow: [
BoxShadow(
color: Colors.black26,
blurRadius: 10.0,
offset: Offset(0, 4),
),
],
borderRadius: BorderRadius.circular(30.0),
),
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 30.0),
child: Text(
text,
style: TextStyle(
color: Colors.white,
fontSize: 18.0,
fontWeight: FontWeight.bold,
),
),
),
),
);
}
}
- Code Button 🔘 .. Interfaces
Utilizamos cookies para mejorar tu experiencia de navegación.
Al hacer clic en «Aceptar todo», aceptas la política de uso de cookies.