updated iconpicker
This commit is contained in:
@@ -8,15 +8,17 @@ import 'package:dash/utils/dbhelper_sqflite.dart';
|
||||
import 'package:dash/models/car.dart';
|
||||
import 'package:dash/models/txn.dart';
|
||||
import 'package:dash/screens/screens.dart';
|
||||
import 'package:dash/theme.dart';
|
||||
// import 'package:flutter/src/widgets/form.dart';
|
||||
|
||||
void main() async {
|
||||
runApp(
|
||||
ChangeNotifierProvider(
|
||||
create: (context) => GarageModel(),
|
||||
child: const MaterialApp(
|
||||
child: MaterialApp(
|
||||
title: 'Dashboard',
|
||||
home: MyApp(),
|
||||
theme: appTheme,
|
||||
/* initialRoute: '/',
|
||||
routes: {
|
||||
'/': (context) => const MyApp(),
|
||||
|
||||
@@ -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()}"),
|
||||
|
||||
@@ -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;
|
||||
},
|
||||
))),
|
||||
|
||||
@@ -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,
|
||||
|
||||
12
lib/theme.dart
Normal file
12
lib/theme.dart
Normal file
@@ -0,0 +1,12 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
var appTheme = ThemeData(
|
||||
brightness: Brightness.light,
|
||||
// textTheme: const TextTheme(
|
||||
// bodyText1: TextStyle(fontSize: 18),
|
||||
// button: TextStyle(
|
||||
// letterSpacing: 1.5,
|
||||
// fontWeight: FontWeight.bold,
|
||||
// ),
|
||||
// ),
|
||||
);
|
||||
35
pubspec.lock
35
pubspec.lock
@@ -36,6 +36,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.16.0"
|
||||
crypto:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: crypto
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.2"
|
||||
cupertino_icons:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
@@ -81,6 +88,27 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
google_fonts:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: google_fonts
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
http:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.13.5"
|
||||
http_parser:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: http_parser
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "4.0.2"
|
||||
lints:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -268,6 +296,13 @@ packages:
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "0.4.12"
|
||||
typed_data:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: typed_data
|
||||
url: "https://pub.dartlang.org"
|
||||
source: hosted
|
||||
version: "1.3.1"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: dash
|
||||
description: A new Flutter project.
|
||||
description: Keep track of your car stuff.
|
||||
|
||||
# The following line prevents the package from being accidentally published to
|
||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||
@@ -36,7 +36,7 @@ dependencies:
|
||||
sqflite: any
|
||||
path:
|
||||
path_provider: ^2.0.11
|
||||
|
||||
google_fonts: ^3.0.1
|
||||
|
||||
# The following adds the Cupertino Icons font to your application.
|
||||
# Use with the CupertinoIcons class for iOS style icons.
|
||||
|
||||
Reference in New Issue
Block a user