-
Anonymous
Кнопки навигации Android отображаются перед кнопками моего приложения
Сообщение
Anonymous »
Я разработал флаттер-приложение для Android, в котором кнопка отображается внизу экрана.
Вот как я разместил виджеты.
Код: Выделить всё
return Scaffold(
appBar: AppBar(title: Text(widget.title)),
body: FutureBuilder(
future: _initializeControllerFuture,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Column(
children: [
Expanded(child: CameraPreview(_controller)),
Padding(
padding: const EdgeInsets.only(
bottom: 0,
left: 5.0,
right: 5.0,
),
child: SizedBox(
width: double.infinity, // Occupies full available width
child: ElevatedButton(
onPressed: _isButtonEnabled
? () async {
// Mark the anonymous function as async
await _generateAttendance(context);
}
: null,
style: ElevatedButton.styleFrom(
elevation: 20.0,
shadowColor: Colors.black,
backgroundColor: btnColor, // Set the background color
foregroundColor: Colors.white, // Set the text color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0,
), // Set the border radius/ Rectangular border
),
),
child: Text('Registrar $tipo'),
),
),
),
],
);
} else {
return Center(child: CircularProgressIndicator());
}
},
),
floatingActionButton: Padding(
padding: const EdgeInsets.only(bottom: 50.0),
child: FloatingActionButton(
onPressed: () async {
await _takePicture(context);
},
child: Icon(Icons.camera_alt),
),
),
);
Когда я тестирую его на реальном телефоне, кнопка «ElevatedButton» появляется под кнопками навигации Android следующим образом:
Как я могу это решить?
Спасибо
Джейме
Подробнее здесь:
https://stackoverflow.com/questions/798 ... -of-my-app
1770642458
Anonymous
Я разработал флаттер-приложение для Android, в котором кнопка отображается внизу экрана.
Вот как я разместил виджеты.
[code]return Scaffold(
appBar: AppBar(title: Text(widget.title)),
body: FutureBuilder(
future: _initializeControllerFuture,
builder: (context, snapshot) {
if (snapshot.connectionState == ConnectionState.done) {
return Column(
children: [
Expanded(child: CameraPreview(_controller)),
Padding(
padding: const EdgeInsets.only(
bottom: 0,
left: 5.0,
right: 5.0,
),
child: SizedBox(
width: double.infinity, // Occupies full available width
child: ElevatedButton(
onPressed: _isButtonEnabled
? () async {
// Mark the anonymous function as async
await _generateAttendance(context);
}
: null,
style: ElevatedButton.styleFrom(
elevation: 20.0,
shadowColor: Colors.black,
backgroundColor: btnColor, // Set the background color
foregroundColor: Colors.white, // Set the text color
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(
8.0,
), // Set the border radius/ Rectangular border
),
),
child: Text('Registrar $tipo'),
),
),
),
],
);
} else {
return Center(child: CircularProgressIndicator());
}
},
),
floatingActionButton: Padding(
padding: const EdgeInsets.only(bottom: 50.0),
child: FloatingActionButton(
onPressed: () async {
await _takePicture(context);
},
child: Icon(Icons.camera_alt),
),
),
);
[/code]
Когда я тестирую его на реальном телефоне, кнопка «ElevatedButton» появляется под кнопками навигации Android следующим образом:
[img]https://i.sstatic.net/TM5xlgvJ.png[/img]
Как я могу это решить?
Спасибо
Джейме
Подробнее здесь: [url]https://stackoverflow.com/questions/79881930/android-navigation-buttons-appears-in-front-of-buttons-of-my-app[/url]