import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
String message = 'اضغط على الزر لتغيير النص';
void changeMessage() {
setState(() {
message = 'تم تغيير النص!';
});
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: Text('تطبيق Flutter تفاعلي'),
),
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
message,
style: TextStyle(fontSize: 20),
),
SizedBox(height: 20),
ElevatedButton(
onPressed: changeMessage,
child: Text('اضغط هنا'),
),
],
),
),
),
);
}
}
بعد الانتهاء من التطوير، يمكنك نشر تطبيقك على متجر Google Play أو App Store باستخدام الأدوات التي يوفرها Flutter.