-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed UserScreen Avatar Animation Completed ComponentWidget Connected Firebase Cloud Firestore
- Loading branch information
1 parent
0e86edb
commit 15832b7
Showing
16 changed files
with
210 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class UserScreenArguments { | ||
final Image avatar; | ||
|
||
UserScreenArguments(this.avatar); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import 'models/pc_component.dart'; | ||
|
||
class FakeDataBase { | ||
static List<PCComponentModel> components = [ | ||
PCComponentModel( | ||
manufacturer: "EVGA", name: "GTX 780ti", description: "VRAM: 3GB"), | ||
PCComponentModel( | ||
manufacturer: "EVGA", name: "GTX 780ti", description: "VRAM: 3GB") | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class PCComponentModel { | ||
final String manufacturer; | ||
final String name; | ||
final String description; | ||
PCComponentModel({this.manufacturer, this.name, this.description}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import 'package:cloud_firestore/cloud_firestore.dart'; | ||
import 'package:flutter/material.dart'; | ||
import 'package:pc_build_assistant/components/rounded_button_widget.dart'; | ||
import 'package:pc_build_assistant/constants.dart'; | ||
import 'package:pc_build_assistant/models/pc_component.dart'; | ||
|
||
class AddScreen extends StatefulWidget { | ||
static String id = "/addScreenId"; | ||
|
||
@override | ||
_AddScreenState createState() => _AddScreenState(); | ||
} | ||
|
||
class _AddScreenState extends State<AddScreen> { | ||
String _manufacturer = ""; | ||
String _name = ""; | ||
String _description = ""; | ||
Firestore _storage = Firestore.instance; | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
body: Padding( | ||
padding: EdgeInsets.all(24), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
crossAxisAlignment: CrossAxisAlignment.stretch, | ||
children: <Widget>[ | ||
TextField( | ||
decoration: InputDecoration(hintText: "Manufacturer"), | ||
onChanged: (manufacturer) { | ||
_manufacturer = manufacturer; | ||
}, | ||
), | ||
TextField( | ||
decoration: InputDecoration(hintText: "Name"), | ||
onChanged: (name) { | ||
_name = name; | ||
}, | ||
), | ||
TextField( | ||
decoration: InputDecoration(hintText: "Description"), | ||
onChanged: (description) { | ||
_description = description; | ||
}, | ||
), | ||
Padding( | ||
padding: const EdgeInsets.symmetric(vertical: 8.0), | ||
child: RoundedButton( | ||
title: "Add", | ||
color: kRegisterButtonColor, | ||
onPressed: () { | ||
PCComponentModel model = PCComponentModel( | ||
name: _name, | ||
manufacturer: _manufacturer, | ||
description: _description, | ||
); | ||
print(model.manufacturer + | ||
" " + | ||
model.name + | ||
" " + | ||
model.description); | ||
_storage.collection('pc-components').add( | ||
{ | ||
"manufacturer": _manufacturer, | ||
"name": _name, | ||
"description": _description | ||
}, | ||
); | ||
}, | ||
), | ||
) | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.