Created
July 18, 2019 06:44
-
-
Save ShivamGoyal1899/da55d021a676d3241d7c712a75c4b431 to your computer and use it in GitHub Desktop.
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
class _ShoppingCartTabState extends State<ShoppingCartTab> { | |
String name; // ADD FROM HERE | |
String email; | |
String location; | |
String pin; | |
DateTime dateTime = DateTime.now(); | |
Widget _buildNameField() { | |
return CupertinoTextField( | |
prefix: const Icon( | |
CupertinoIcons.person_solid, | |
color: CupertinoColors.lightBackgroundGray, | |
size: 28, | |
), | |
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 12), | |
clearButtonMode: OverlayVisibilityMode.editing, | |
textCapitalization: TextCapitalization.words, | |
autocorrect: false, | |
decoration: const BoxDecoration( | |
border: Border( | |
bottom: BorderSide( | |
width: 0, | |
color: CupertinoColors.inactiveGray, | |
), | |
), | |
), | |
placeholder: 'Name', | |
onChanged: (newName) { | |
setState(() { | |
name = newName; | |
}); | |
}, | |
); | |
} | |
Widget _buildEmailField() { | |
return const CupertinoTextField( | |
prefix: Icon( | |
CupertinoIcons.mail_solid, | |
color: CupertinoColors.lightBackgroundGray, | |
size: 28, | |
), | |
padding: EdgeInsets.symmetric(horizontal: 6, vertical: 12), | |
clearButtonMode: OverlayVisibilityMode.editing, | |
keyboardType: TextInputType.emailAddress, | |
autocorrect: false, | |
decoration: BoxDecoration( | |
border: Border( | |
bottom: BorderSide( | |
width: 0, | |
color: CupertinoColors.inactiveGray, | |
), | |
), | |
), | |
placeholder: 'Email', | |
); | |
} | |
Widget _buildLocationField() { | |
return const CupertinoTextField( | |
prefix: Icon( | |
CupertinoIcons.location_solid, | |
color: CupertinoColors.lightBackgroundGray, | |
size: 28, | |
), | |
padding: EdgeInsets.symmetric(horizontal: 6, vertical: 12), | |
clearButtonMode: OverlayVisibilityMode.editing, | |
textCapitalization: TextCapitalization.words, | |
decoration: BoxDecoration( | |
border: Border( | |
bottom: BorderSide( | |
width: 0, | |
color: CupertinoColors.inactiveGray, | |
), | |
), | |
), | |
placeholder: 'Location', | |
); | |
} | |
SliverChildBuilderDelegate _buildSliverChildBuilderDelegate( | |
AppStateModel model) { | |
return SliverChildBuilderDelegate( | |
(context, index) { | |
switch (index) { | |
case 0: | |
return Padding( | |
padding: const EdgeInsets.symmetric(horizontal: 16), | |
child: _buildNameField(), | |
); | |
case 1: | |
return Padding( | |
padding: const EdgeInsets.symmetric(horizontal: 16), | |
child: _buildEmailField(), | |
); | |
case 2: | |
return Padding( | |
padding: const EdgeInsets.symmetric(horizontal: 16), | |
child: _buildLocationField(), | |
); | |
default: | |
// Do nothing. For now. | |
} | |
return null; | |
}, | |
); | |
} // TO HERE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment