This file contains hidden or 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 CustomPicker extends CommonPickerModel { | |
| String digits(int value, int length) { | |
| return '$value'.padLeft(length, "0"); | |
| } | |
| CustomPicker({DateTime currentTime, LocaleType locale}) : super(locale: locale) { | |
| this.currentTime = currentTime ?? DateTime.now(); | |
| this.setLeftIndex(this.currentTime.hour); | |
| this.setMiddleIndex(this.currentTime.minute); | |
| this.setRightIndex(this.currentTime.second); | |
| } |
This file contains hidden or 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
| const AlertDialog({ | |
| Key key, | |
| Widget title, | |
| EdgeInsetsGeometry titlePadding, | |
| TextStyle titleTextStyle, | |
| Widget content, | |
| EdgeInsetsGeometry contentPadding: const EdgeInsets.fromLTRB(24.0, 20.0, 24.0, 24.0), | |
| TextStyle contentTextStyle, | |
| List<Widget> actions, | |
| Color backgroundColor, |
This file contains hidden or 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
| ... | |
| flutter: | |
| uses-material-design: true | |
| assets: | |
| - assets/images/listening.gif | |
| ... |
This file contains hidden or 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
| onPressed: () { | |
| showDialog( | |
| context: context, | |
| builder: (BuildContext context) { | |
| return VoicePay(); | |
| }, | |
| ); | |
| }, |
This file contains hidden or 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
| import 'package:flutter/material.dart'; | |
| class VoicePay extends StatefulWidget { | |
| @override | |
| _VoicePayState createState() => _VoicePayState(); | |
| } | |
| class _VoicePayState extends State<VoicePay> { | |
| @override |
This file contains hidden or 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
| 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(), |
This file contains hidden or 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
| SliverChildBuilderDelegate _buildSliverChildBuilderDelegate( | |
| AppStateModel model) { | |
| return SliverChildBuilderDelegate( | |
| (context, index) { | |
| switch (index) { | |
| case 0: | |
| return Padding( | |
| padding: const EdgeInsets.symmetric(horizontal: 16), | |
| child: _buildNameField(), | |
| ); |
This file contains hidden or 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> { | |
| // ... | |
| Widget _buildDateAndTimePicker(BuildContext context) { // NEW FROM HERE | |
| return Column( | |
| children: <Widget>[ | |
| Row( | |
| mainAxisAlignment: MainAxisAlignment.spaceBetween, | |
| children: <Widget>[ | |
| Row( |
This file contains hidden or 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
| import 'package:flutter/cupertino.dart'; | |
| import 'package:intl/intl.dart'; // NEW | |
| import 'package:scoped_model/scoped_model.dart'; | |
| import 'model/app_state_model.dart'; | |
| import 'styles.dart'; // NEW | |
| const double _kDateTimePickerHeight = 216; // NEW |
This file contains hidden or 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
| @override | |
| Widget build(BuildContext context) { | |
| return Consumer<AppStateModel>( | |
| builder: (context, model, child) { | |
| return CustomScrollView( | |
| slivers: <Widget>[ | |
| const CupertinoSliverNavigationBar( | |
| largeTitle: Text('Shopping Cart'), | |
| ), | |
| SliverSafeArea( |