style: ElevatedButton.styleFrom( primary: Colors.blue, //button's fill color onPrimary: Colors.red, //specify the color of the button's text and icons as well as the overlay colors used to indicate the hover, focus, and pressed states onSurface: Colors.orange, //specify the button's disabled text, icon, and fill color shadowColor: Colors.black, //specify the button's elevation color elevation: 4.0, //buttons Material shadow textStyle: TextStyle(fontFamily: 'roboto'), //specify the button's text TextStyle padding: const EdgeInsets.only(top: 4.0, bottom: 4.0, right: 8.0, left: 8.0), //specify the button's Padding minimumSize: Size(20, 40), //specify the button's first: width and second: height side: BorderSide(color: Colors.yellow, width: 2.0, style: BorderStyle.solid), //set border for the button shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(35.0)), // set the buttons shape. Make its birders rounded etc enabledMouseCursor: MouseCursor.defer, //used to construct ButtonStyle.mouseCursor disabledMouseCursor: MouseCursor.uncontrolled, //used to construct ButtonStyle.mouseCursor visualDensity: VisualDensity(horizontal: 0.0, vertical: 0.0), //set the button's visual density tapTargetSize: MaterialTapTargetSize.padded, // set the MaterialTapTarget size. can set to: values, padded and shrinkWrap properties animationDuration: Duration(milliseconds: 100), //the buttons animations duration enableFeedback: true, //to set the feedback to true or false alignment: Alignment.bottomCenter, //set the button's child Alignment ), onPressed: () => {} , //set both onPressed and onLongPressed to null to see the disabled properties onLongPress: () => {}, //set both onPressed and onLongPressed to null to see the disabled properties child: Text('ElevatedButton')
لمن لم يشتغل له الكود الحل : من موقع مطوري Flutter The FlatButton, RaisedButton and OutlineButton widgets have been replaced by TextButton, ElevatedButton, and OutlinedButton respectively.
عندي يطلع التنبيه على أن
Raisedbutton
قد صار قديما يستعمل بدله
ElevatedButton
style: ElevatedButton.styleFrom(
primary: Colors.blue, //button's fill color
onPrimary: Colors.red, //specify the color of the button's text and icons as well as the overlay colors used to indicate the hover, focus, and pressed states
onSurface: Colors.orange, //specify the button's disabled text, icon, and fill color
shadowColor: Colors.black, //specify the button's elevation color
elevation: 4.0, //buttons Material shadow
textStyle: TextStyle(fontFamily: 'roboto'), //specify the button's text TextStyle
padding: const EdgeInsets.only(top: 4.0, bottom: 4.0, right: 8.0, left: 8.0), //specify the button's Padding
minimumSize: Size(20, 40), //specify the button's first: width and second: height
side: BorderSide(color: Colors.yellow, width: 2.0, style: BorderStyle.solid), //set border for the button
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(35.0)), // set the buttons shape. Make its birders rounded etc
enabledMouseCursor: MouseCursor.defer, //used to construct ButtonStyle.mouseCursor
disabledMouseCursor: MouseCursor.uncontrolled, //used to construct ButtonStyle.mouseCursor
visualDensity: VisualDensity(horizontal: 0.0, vertical: 0.0), //set the button's visual density
tapTargetSize: MaterialTapTargetSize.padded, // set the MaterialTapTarget size. can set to: values, padded and shrinkWrap properties
animationDuration: Duration(milliseconds: 100), //the buttons animations duration
enableFeedback: true, //to set the feedback to true or false
alignment: Alignment.bottomCenter, //set the button's child Alignment
),
onPressed: () => {} , //set both onPressed and onLongPressed to null to see the disabled properties
onLongPress: () => {}, //set both onPressed and onLongPressed to null to see the disabled properties
child: Text('ElevatedButton')
good man Wael abo hamza
شكرا جزيلا لكم، أستاذنا الفاضل.
لمن لم يشتغل له الكود الحل :
من موقع مطوري Flutter
The FlatButton, RaisedButton and OutlineButton widgets have been replaced by TextButton, ElevatedButton, and OutlinedButton respectively.
الله يجزيك الخير على التعليق
risedbutton changed by ElevatedButton
❤❤❤ ربنا يديك العافية
بارك الله فيك و جزاك الله خيرا ونفع بعلمك ❤❤❤❤
سلام الله عليك يابشمهندس والله استفدت منك كثير والى الامام ربي يوفقك ومدك بالعلم المديد اخوك ابن اليمن
RaisedButton is deprecated, use instead ElevatedButton:
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.red, foregroundColor: Colors.white),
body: Center(
child: ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.amber,
textStyle: TextStyle(color: Colors.white),
padding: EdgeInsets.all(20),
elevation: 20,
),
onPressed: () {
},
child: const Text("creat account"),
)));
style: ElevatedButton.styleFrom(
)
يعطيك الف عافية على شرحك الوافي لكن عندي سؤال ما هي مواصفات اللابتوب الذي تستعمله ؟
جزاك الله اخي الكريم
onlongpress مش شغال خالص
وغيرت الraisedbutton
بالmaterialbutton
نفس الكلام
ومسحت كل الpropirtes
وباردو
Center(
child: MaterialButton(
child: GestureDetector(
onLongPress: () {
print('onLongPress');
},
),
elevation: 40,
padding: EdgeInsets.symmetric(horizontal: 50, vertical: 20),
textColor: Colors.white,
color: Colors.green,
// text:Text('ok') ,
onPressed: () {
print('ok ahmed');
},
// child: Text('ok'),
))));
}
}
هو كده مش قابل الchild بتاعة الtext
شكرا الك استاذ وائل انهيت هاي السلسلة وفهمتها الله يجزيك الخير يارب
راح اترك نفس التعليق بس اغير فيه شوي عشان اليوتيوب ما يمنعني من التعليق
ليه padding مش راضي يعمل معايا مع الاستبدال
@@WaelabohamzaFlutter شكرا