اتبع الصفحة https://codelabs.developers.google.com/codelabs/flutter/index.html#5
الكود الخاص بي هو:
""
القطعة _setupBody () {
إرجاع عمود جديد (
الأطفال:
موسع جديد (
الطفل: جديد ListView.builder (
itemBuilder: (_nothing، int index) => _messageList [index]،
عكس: صحيح ،
itemCount: _messageList.length ،
) ،
) ،
مقسم جديد (الارتفاع: 1.0) ،
حاوية جديدة (
الحشو: const EdgeInsets.symmetric (أفقي: 5.0) ،
// الديكور: New BoxDecoration (اللون: Theme.of (السياق) .cardColor ،) ،
طفل: صف جديد (
الأطفال:
جديد مرن (
تابع: حقل نص جديد (
maxLines: 1 ،
تحكم: _myController ،
تم الإرسال: _handleSubmitt ،
decoration: new InputDecoration.collapsed (hintText: "input here") ،
) ،
) ،
IconTheme الجديدة (
البيانات: IconThemeData الجديدة (اللون: Theme.of (السياق). accentColor) ،
child: New IconButton (رمز: أيقونة جديدة (Icons.send) ، onPressed: () => _handleSubmitt (_myController.text)))
] ،
))
] ،
) ؛
}
then it shown like this:
![screenflow](https://user-images.githubusercontent.com/3993323/31986228-425b9d68-b92d-11e7-8176-de3deab993c2.gif)
after add the decoration (uncomment the line 14)
![screenflow2](https://user-images.githubusercontent.com/3993323/31986425-0dcfe8b4-b92e-11e7-90ae-52664835cd4b.gif)
as you see, the boxdecoration hide the ripple.
from the code , i think , the boxdexcoration should be rendered first.
How to change the code makes the ripple at front of the boxdexcoration?
## Flutter Doctor
[✓] Flutter (في نظام التشغيل Mac OS X 10.12.4 16E195 ، الإعدادات المحلية zh-Hans-CN ، قناة ألفا)
• رفرفة عند / Users / cjz / ALL_IN_THIS / flutter
• مراجعة الإطار e8aa40eddd (منذ 7 أيام) ، 2017-10-17 15:42:40 -0700
• مراجعة المحرك 7c4142808c
• أدوات Dart الإصدار 1.25.0-dev.11.0
[✓] Android toolchain - تطوير لأجهزة Android (Android SDK 26.0.2)
• Android SDK على / Users / cjz / ALL_IN_THIS / Android / sdk
• منصة android-26 ، أدوات بناء 26.0.2
• ANDROID_HOME = / المستخدمون / cjz / ALL_IN_THIS / Android / sdk
• برنامج Java ثنائي على: / Applications / Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• إصدار جافا OpenJDK Runtime Environment (النسخة 1.8.0_152-release-915-b08)
[✓] سلسلة أدوات iOS - تطوير لأجهزة iOS (Xcode 8.3.2)
• Xcode في /Applications/Xcode.app/Contents/Developer
• Xcode 8.3.2 ، نسخة البناء 8E2002
• نشر iOS 1.9.2
• CocoaPods الإصدار 1.3.1
[✓] Android Studio (الإصدار 3.0)
• Android Studio في / Applications / Android Studio.app/Contents
• إصدار جافا OpenJDK Runtime Environment (النسخة 1.8.0_152-release-915-b08)
[✓] الأجهزة المتصلة
• Android SDK مصمم لـ x86 • emulator-5554 • android-x86 • Android 5.1.1 (API 22) (محاكي)
• iPhone SE • 795AA980-157D-455C-AC52-385CBDDC3BDE • ios • iOS 10.3 (جهاز محاكاة)
""
مرحبًا cjztool ، يمكنك لفها في فئة Material
بدلاً من استخدام فئة Container
إذا كنت تريد تلوينها فقط.
أنا مبتدئ ، شكرا جزيلا لك! عمل جيد! تضمين التغريدة
Widget _setupBody() {
return new Column(
children: <Widget>[
new Expanded(
child: new ListView.builder(
itemBuilder: (_nothing, int index) => _messageList[index],
reverse: true,
itemCount: _messageList.length,
),
),
new Divider(height: 1.0),
new Material(
color: Theme.of(context).cardColor,
//child: new Container(
// padding: const EdgeInsets.symmetric(horizontal: 5.0),
child: new Row(
children: <Widget>[
new Flexible(
child: new TextField(
maxLines: 1,
controller: _myController,
onSubmitted: _handleSubmitt,
onChanged: (String text) {
setState(() {
_isComposing = text.length > 0;
});
},
decoration: new InputDecoration.collapsed(hintText: "input here"),
),
),
new IconTheme(
data: new IconThemeData(color: Theme.of(context).accentColor),
child: Theme.of(context).platform == TargetPlatform.iOS
? new CupertinoButton(child: new Text("Send"), onPressed: _isComposing ? () => _handleSubmitt(_myController.text) : null)
: new IconButton(icon: new Icon(Icons.send), onPressed: _isComposing ? () => _handleSubmitt(_myController.text) : null))
],
),
// decoration: new BoxDecoration(
// color: Theme.of(context).cardColor,
// ),
// ),
),
],
);
}
mchome رائع هاها لقد اكتشفت للتو الحروف الصينية المستخدمة في صفحتك الرئيسية ..
التعليق الأكثر فائدة
أنا مبتدئ ، شكرا جزيلا لك! عمل جيد! تضمين التغريدة