最近我在我的 flutter 项目中添加了 firebase。为了使用 firebase 数据库服务,我添加了 cloud_firebase 包。但添加此包后,我的应用程序未运行并给了我一个例外:
BUILD FAILED in 31s
The plugin cloud_firestore requires a higher Android SDK version.
Fix this issue by adding the following to the file C:\Users\Jaguar\Desktop\AppDevelopment\acadmt\android\app\build.gradle:
android {
defaultConfig {
minSdkVersion 19
}
}
Note that your app won't be available to users running Android SDKs below 19.
Alternatively, try to find a version of this plugin that supports these lower versions of the Android SDK.
Exception: Gradle task assembleDebug failed with exit code …Run Code Online (Sandbox Code Playgroud) 我在我的 flutter 应用程序中使用 PageView 构建器来显示可滚动卡片。为此,我首先创建了一个小部件_buildCarousel和小部件_buildCarouselItem,以使用我为卡片定义的小部件定义的方式显示它。我还为事件数据定义了一个地图列表 ( eventsData )。
Widget _buildCarousel(BuildContext context) {
List<Map> EventsData = [
{
"title": "Event ABC",
"subTitle": "Organised by XYZ",
"desc": "Event description.",
"date": "13th Jan, 2022",
"time": "4:00 pm",
"lastDate": "11th Jan, 2022"
},
{
"title": "Event MNT",
"subTitle": "Organised by XYZ",
"desc": "Event description.",
"date": "13th Jan, 2022",
"time": "4:00 pm",
"lastDate": "11th Jan, 2022"
},
{
"title": "Event WOQ",
"subTitle": "Organised by STU",
"desc": "Event description." ,
"date": "13th …Run Code Online (Sandbox Code Playgroud) 我的 flutter 应用程序中有一个有状态的小部件“DayPicker”。相同的代码是:
class DayPicker extends StatefulWidget {
@override
_DayPickerState createState() =>
_DayPickerState();
}
class _DayPickerState extends State<DayPicker> {
final values2 = List.filled(7, false);
@override
Widget build(BuildContext context) {
var ht = MediaQuery.of(context).size.height;
return Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(
height: ht / 40,
),
Text(
'Selected Day(s): ${valuesToEnglishDays(values2, true)}',
style: TextStyle(fontSize: ht / 40, fontStyle: FontStyle.italic),
),
WeekdaySelector(
onChanged: (v) {
setState(() {
values2[v % 7] = !values2[v % 7];
});
},
values: values2,
selectedFillColor: Colors.amber,
selectedColor: Colors.black,
selectedShape: …Run Code Online (Sandbox Code Playgroud)