updated iconpicker

This commit is contained in:
2022-11-18 14:51:47 -05:00
parent 4cfffa59f9
commit 7e6ccf67a2
7 changed files with 75 additions and 9 deletions

View File

@@ -5,6 +5,7 @@ import 'package:dash/utils/garage_model.dart';
// import 'package:dash/main.dart';
import 'package:dash/models/car.dart';
import 'package:dash/screens/screens.dart';
import 'package:google_fonts/google_fonts.dart';
class CarDetailScreen extends StatefulWidget {
const CarDetailScreen({super.key, required this.carIndex});
@@ -38,7 +39,7 @@ class _CarDetailScreenState extends State<CarDetailScreen> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Center(
// edit car screen
// edit car
child: Ink(
decoration: const ShapeDecoration(
color: Colors.lightBlue, shape: CircleBorder()),
@@ -61,8 +62,19 @@ class _CarDetailScreenState extends State<CarDetailScreen> {
Consumer<GarageModel>(
builder: (context, garage, child) => Column(
children: [
Text("Nickname: ${garage.cars[widget.carIndex].nickname}"),
Text("VIN: ${garage.cars[widget.carIndex].vin}"),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text("${garage.cars[widget.carIndex].nickname}"),
]),
Text(
"Nickname: ${garage.cars[widget.carIndex].nickname}",
style: GoogleFonts.crimsonPro(),
),
Text(
"VIN: ${garage.cars[widget.carIndex].vin}",
style: GoogleFonts.crimsonPro(),
),
Text("License Plate: ${garage.cars[widget.carIndex].plate}"),
Text(
"Mileage: ${garage.cars[widget.carIndex].mileage.toString()}"),

View File

@@ -105,7 +105,10 @@ class _EditCarScreenState extends State<EditCarScreen> {
leading: CircleAvatar(
backgroundImage: AssetImage(car.icon ?? selectedIcon),
backgroundColor: Colors.white),
title: const Text("Change Icon"),
title: Text(
"Change Icon",
style: TextStyle(color: Colors.grey[700], fontSize: 14),
),
onTap: () => showDialog(
barrierColor: Colors.black.withOpacity(.5),
context: context,
@@ -113,7 +116,6 @@ class _EditCarScreenState extends State<EditCarScreen> {
return ip;
}).then((value) => setState(
() {
// selectedIcon = ip.selectedIcon;
selectedIcon = value;
},
))),

View File

@@ -86,7 +86,10 @@ class _NewCarScreenState extends State<NewCarScreen> {
leading: CircleAvatar(
backgroundImage: AssetImage(selectedIcon),
backgroundColor: Colors.white),
title: const Text("Change Icon"),
title: Text(
"Change Icon",
style: TextStyle(color: Colors.grey[700], fontSize: 14),
),
onTap: () => showDialog(
barrierColor: Colors.black.withOpacity(.5),
context: context,