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 ProductDetailPage extends StatefulWidget { | |
| @override | |
| _ProductDetailPageState createState() => _ProductDetailPageState(); | |
| } | |
| class _ProductDetailPageState extends State<ProductDetailPage> | |
| with TickerProviderStateMixin { | |
| @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
| import 'package:flutter/material.dart'; | |
| import 'package:products_tutorial/widgets/products_list_item.dart'; | |
| class ProductsListPage extends StatelessWidget { | |
| BuildContext context; | |
| @override | |
| Widget build(BuildContext context) { | |
| this.context = context; |
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'; | |
| import 'package:products_tutorial/pages/products_list_page.dart'; | |
| import 'package:products_tutorial/util/routes.dart'; | |
| void main() { | |
| runApp( | |
| MaterialApp( | |
| home: ProductsListPage(), | |
| routes: Routes.routes, | |
| ), | |
| ); |
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) { | |
| this.context = context; | |
| return Scaffold( | |
| appBar: AppBar( | |
| centerTitle: true, | |
| backgroundColor: Colors.white, | |
| title: Text( | |
| "PRODUCT LIST", |
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
| _buildProductsListPage() { | |
| Size screenSize = MediaQuery.of(context).size; | |
| return Container( | |
| color: Colors.grey[100], | |
| child: ListView.builder( | |
| itemCount: 5, | |
| itemBuilder: (context, index) { | |
| if (index == 0) { | |
| return _buildFilterWidgets(screenSize); | |
| } else if (index == 4) { |
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 ProductsListItem({Key key, | |
| this.name, | |
| this.currentPrice, | |
| this.originalPrice, | |
| this.discount, | |
| this.imageUrl}) | |
| : super(key: key); |
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 Row( | |
| mainAxisSize: MainAxisSize.max, | |
| mainAxisAlignment: MainAxisAlignment.center, | |
| children: <Widget>[ | |
| _buildProductItemCard(context), | |
| _buildProductItemCard(context), | |
| ], | |
| ); |
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 _ProductDetailPageState extends State<ProductDetailPage> | |
| with TickerProviderStateMixin { | |
| @override | |
| Widget build(BuildContext context) { | |
| return Scaffold( | |
| appBar: AppBar( | |
| centerTitle: true, | |
| leading: IconButton( | |
| icon: Icon( | |
| Icons.chevron_left, |
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
| _buildProductDetailsPage(BuildContext context) { | |
| Size screenSize = MediaQuery.of(context).size; | |
| return ListView( | |
| children: <Widget>[ | |
| Container( | |
| padding: const EdgeInsets.all(4.0), | |
| child: Card( | |
| elevation: 4.0, | |
| child: Column( | |
| crossAxisAlignment: CrossAxisAlignment.start, |
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
| _buildProductImagesWidgets() { | |
| TabController imagesController = TabController(length: 3, vsync: this); | |
| return Padding( | |
| padding: const EdgeInsets.all(16.0), | |
| child: Container( | |
| height: 250.0, | |
| child: Center( | |
| child: DefaultTabController( | |
| length: 3, | |
| child: Stack( |
OlderNewer