add screen camera wip
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import "ItemMenu.dart";
|
||||
import "Camera.dart";
|
||||
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'package:flutter/material.dart';
|
||||
import '../classes/events.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:intl/date_symbol_data_local.dart';
|
||||
import 'package:camera/camera.dart';
|
||||
|
||||
import '../variable/globals.dart' as globals;
|
||||
|
||||
@@ -57,6 +60,11 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
return body;
|
||||
}
|
||||
|
||||
Future<void> popCamera() async {
|
||||
await availableCameras().then((value) => Navigator.push(context,
|
||||
MaterialPageRoute(builder: (_) => Camera(camera: value.first))));
|
||||
}
|
||||
|
||||
// build function
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
@@ -117,7 +125,7 @@ class _MyHomePageState extends State<ListItemMenu> {
|
||||
},
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: () {},
|
||||
onPressed: popCamera,
|
||||
backgroundColor: Colors.blue,
|
||||
tooltip: 'Recherche',
|
||||
child: const Icon(Icons.search, color: Colors.white),
|
||||
|
Reference in New Issue
Block a user