New Text Document (4)
New Text Document (4)
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: productType == 'text'
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Thêm sản phẩm', style: TextStyle(fontSize: 18,
fontWeight: FontWeight.bold)),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện
chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: storyType,
onChanged: (value) {
setState(() {
storyType = value!;
});
},
items: [
DropdownMenuItem(value: 'All in one', child: Text('All
in one')),
DropdownMenuItem(value: 'Nhiều tập', child: Text('Nhiều
tập')),
],
decoration: InputDecoration(
labelText: 'Loại truyện',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => name = value,
decoration: InputDecoration(
labelText: 'Tên sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => description = value,
decoration: InputDecoration(
labelText: 'Mô tả',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
keyboardType: TextInputType.number,
onChanged: (value) => price = int.tryParse(value) ?? 0,
decoration: InputDecoration(
labelText: 'Giá (Diamonds)',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContentEditorScreen(initialContent: content),
),
);
if (result != null) {
content = result;
}
},
child: Text('Nội dung'),
),
],
)
: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
Text(
'Chức năng đang được phát triển!',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.red,
),
textAlign: TextAlign.center,
),
],
),
),
);
},
),
);
},
);
}
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: productType == 'text'
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Thêm sản phẩm', style: TextStyle(fontSize: 18,
fontWeight: FontWeight.bold)),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện
chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: storyType,
onChanged: (value) {
setState(() {
storyType = value!;
});
},
items: [
DropdownMenuItem(value: 'All in one', child: Text('All
in one')),
DropdownMenuItem(value: 'Nhiều tập', child: Text('Nhiều
tập')),
],
decoration: InputDecoration(
labelText: 'Loại truyện',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => name = value,
decoration: InputDecoration(
labelText: 'Tên sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => description = value,
decoration: InputDecoration(
labelText: 'Mô tả',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
keyboardType: TextInputType.number,
onChanged: (value) => price = int.tryParse(value) ?? 0,
decoration: InputDecoration(
labelText: 'Giá (Diamonds)',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContentEditorScreen(initialContent: content),
),
);
if (result != null) {
content = result;
}
},
child: Text('Nội dung'),
),
],
)
: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
Text(
'Chức năng đang được phát triển!',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.red,
),
textAlign: TextAlign.center,
),
],
),
),
);
},
),
);
},
);
}
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: productType == 'text'
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Thêm sản phẩm', style: TextStyle(fontSize: 18,
fontWeight: FontWeight.bold)),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện
chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: storyType,
onChanged: (value) {
setState(() {
storyType = value!;
});
},
items: [
DropdownMenuItem(value: 'All in one', child: Text('All
in one')),
DropdownMenuItem(value: 'Nhiều tập', child: Text('Nhiều
tập')),
],
decoration: InputDecoration(
labelText: 'Loại truyện',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => name = value,
decoration: InputDecoration(
labelText: 'Tên sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => description = value,
decoration: InputDecoration(
labelText: 'Mô tả',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
keyboardType: TextInputType.number,
onChanged: (value) => price = int.tryParse(value) ?? 0,
decoration: InputDecoration(
labelText: 'Giá (Diamonds)',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContentEditorScreen(initialContent: content),
),
);
if (result != null) {
content = result;
}
},
child: Text('Nội dung'),
),
],
)
: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
Text(
'Chức năng đang được phát triển!',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.red,
),
textAlign: TextAlign.center,
),
],
),
),
);
},
),
);
},
);
}
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: productType == 'text'
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Thêm sản phẩm', style: TextStyle(fontSize: 18,
fontWeight: FontWeight.bold)),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện
chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: storyType,
onChanged: (value) {
setState(() {
storyType = value!;
});
},
items: [
DropdownMenuItem(value: 'All in one', child: Text('All
in one')),
DropdownMenuItem(value: 'Nhiều tập', child: Text('Nhiều
tập')),
],
decoration: InputDecoration(
labelText: 'Loại truyện',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => name = value,
decoration: InputDecoration(
labelText: 'Tên sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => description = value,
decoration: InputDecoration(
labelText: 'Mô tả',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
keyboardType: TextInputType.number,
onChanged: (value) => price = int.tryParse(value) ?? 0,
decoration: InputDecoration(
labelText: 'Giá (Diamonds)',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContentEditorScreen(initialContent: content),
),
);
if (result != null) {
content = result;
}
},
child: Text('Nội dung'),
),
],
)
: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
Text(
'Chức năng đang được phát triển!',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.red,
),
textAlign: TextAlign.center,
),
],
),
),
);
},
),
);
},
);
}
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: StatefulBuilder(
builder: (BuildContext context, StateSetter setState) {
return SingleChildScrollView(
padding: const EdgeInsets.all(16.0),
child: productType == 'text'
? Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text('Thêm sản phẩm', style: TextStyle(fontSize: 18,
fontWeight: FontWeight.bold)),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện
chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
DropdownButtonFormField<String>(
value: storyType,
onChanged: (value) {
setState(() {
storyType = value!;
});
},
items: [
DropdownMenuItem(value: 'All in one', child: Text('All
in one')),
DropdownMenuItem(value: 'Nhiều tập', child: Text('Nhiều
tập')),
],
decoration: InputDecoration(
labelText: 'Loại truyện',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => name = value,
decoration: InputDecoration(
labelText: 'Tên sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
onChanged: (value) => description = value,
decoration: InputDecoration(
labelText: 'Mô tả',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
TextField(
keyboardType: TextInputType.number,
onChanged: (value) => price = int.tryParse(value) ?? 0,
decoration: InputDecoration(
labelText: 'Giá (Diamonds)',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
ElevatedButton(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
ContentEditorScreen(initialContent: content),
),
);
if (result != null) {
content = result;
}
},
child: Text('Nội dung'),
),
],
)
: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
DropdownButtonFormField<String>(
value: productType,
onChanged: (value) {
setState(() {
productType = value;
});
},
items: [
DropdownMenuItem(value: 'text', child: Text('Truyện chữ')),
DropdownMenuItem(value: 'comic', child: Text('Truyện
tranh')),
DropdownMenuItem(value: 'music', child: Text('Nhạc')),
DropdownMenuItem(value: 'video', child: Text('Video')),
],
decoration: InputDecoration(
labelText: 'Chọn loại sản phẩm',
border: OutlineInputBorder(),
),
),
SizedBox(height: 16),
Text(
'Chức năng đang được phát triển!',
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
color: Colors.red,
),
textAlign: TextAlign.center,
),
],
),
),
);
},
),
);
},
);
}
}