-
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.
Added basic widget to add products (unimplemneted) Added vendors list Redesigned form widgets
- Loading branch information
1 parent
1fb2fd5
commit 1670c25
Showing
21 changed files
with
484 additions
and
183 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
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,75 @@ | ||
import 'package:flutter/material.dart'; | ||
|
||
class AddProduct extends StatefulWidget { | ||
_AddProductState createState() => _AddProductState(); | ||
} | ||
|
||
class _AddProductState extends State<AddProduct> { | ||
final _formKey = GlobalKey<FormState>(); | ||
final TextEditingController _productNameCtrl = TextEditingController(); | ||
final TextEditingController _shortDescCtrl = TextEditingController(); | ||
final TextEditingController _longDescCtrl = TextEditingController(); | ||
|
||
Widget _productName() { | ||
return Padding( | ||
padding: const EdgeInsets.only(right: 10, left: 10), | ||
child: TextFormField( | ||
controller: _productNameCtrl, | ||
decoration: InputDecoration(labelText: 'Enter product name:'), | ||
validator: (value) { | ||
if (value.isEmpty) { | ||
return 'This field is required'; | ||
} | ||
return null; | ||
}, | ||
), | ||
); | ||
} | ||
|
||
Widget _image() | ||
{ | ||
|
||
} | ||
|
||
Widget _shortDescription() | ||
{ | ||
return Padding( | ||
padding: const EdgeInsets.only(right: 10, left: 10), | ||
child: TextFormField( | ||
controller: _shortDescCtrl, | ||
decoration: InputDecoration(labelText: 'Enter short description:'), | ||
validator: (value) { | ||
if (value.isEmpty) { | ||
return 'This field is required'; | ||
} | ||
return null; | ||
}, | ||
), | ||
); | ||
} | ||
|
||
Widget _longDescription() | ||
{ | ||
return Padding( | ||
padding: const EdgeInsets.only(right: 10, left: 10), | ||
child: TextFormField( | ||
controller: _longDescCtrl, | ||
decoration: InputDecoration(labelText: 'Enter long description:'), | ||
validator: (value) { | ||
if (value.isEmpty) { | ||
return 'This field is required'; | ||
} | ||
return null; | ||
}, | ||
), | ||
); | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
return Scaffold( | ||
appBar: AppBar( | ||
title: Text('Add a new product'), | ||
)); | ||
} | ||
} |
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.