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 ShopView extends StatefulWidget { | |
| @override | |
| _ShopViewState createState() => _ShopViewState(); | |
| } | |
| class _ShopViewState extends BaseState<ShopView> { | |
| List<Product> subList = []; | |
| int currentPage = 0; | |
| @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:shoppingapp/core/constants/app_constants.dart'; | |
| import 'package:shoppingapp/core/constants/app_strings.dart'; | |
| abstract class BaseState<T extends StatefulWidget> extends State<T> { | |
| ThemeData get currentTheme => Theme.of(context); | |
| AppStrings get appStrings => AppStrings.instance; | |
| AppConstants get appConstants => AppConstants.instance; |
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 ShopListView extends StatefulWidget { | |
| final bool isUserOnPage; | |
| const ShopListView({Key key, this.isUserOnPage}) : super(key: key); | |
| @override | |
| _ShopListViewState createState() => _ShopListViewState(); | |
| } | |
| class _ShopListViewState extends BaseState<ShopListView> { | |
| ShopViewModel shopViewModel; |
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 ShopDetailView extends BaseStatelessWidget { | |
| final Product data; | |
| final int index; | |
| ShopDetailView({Key key, this.data, this.index}); | |
| @override | |
| Widget build(BuildContext context) { | |
| final textTheme = Theme.of(context).textTheme; | |
| final colorScheme = Theme.of(context).colorScheme; | |
| return Scaffold( |
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 'dart:html' as html; | |
| import 'package:flutter/material.dart'; | |
| import 'dart:ui' as ui; | |
| import './pdf_web_view_view_model.dart'; | |
| class PdfWebViewView extends PdfWebViewViewModel { | |
| String samplePdf = "http://www.africau.edu/images/default/sample.pdf"; |
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 'dart:html' as html; | |
| import 'package:flutter/material.dart'; | |
| import 'dart:ui' as ui; | |
| import './pdf_web_view_view_model.dart'; | |
| class PdfWebViewView extends PdfWebViewViewModel { | |
| String samplePdf = "http://www.africau.edu/images/default/sample.pdf"; |
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 ShopPaymentView extends StatefulWidget { | |
| @override | |
| _ShopPaymentViewState createState() => _ShopPaymentViewState(); | |
| } | |
| class _ShopPaymentViewState extends BaseState<ShopPaymentView> { | |
| int totalMoney = 0; | |
| List<Product> get currentProductList => | |
| Provider.of<ProductListNotifier>(context, listen: false).productList; |
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 'dart:io'; | |
| import 'package:dio/dio.dart'; | |
| class BaseConfig { | |
| Dio dio; // with default Options | |
| String baseUrl; | |
| BaseConfig() { | |
| if (Platform.isIOS) { |
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 ShopViewModel extends BaseViewModel with ChangeNotifier { | |
| // IO.Socket socket = IO.io(AppConstants.SOCKET_URL); | |
| IO.Socket socket = IO.io(AppConstants.SOCKET_URL, <String, dynamic>{ | |
| 'transports': ['websocket'], | |
| // 'extraHeaders': {'foo': 'bar'} // optional | |
| }); | |
| ProductService service = ProductService(); | |
| List<Product> subList = []; |
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 NumberCircleAvatar extends StatelessWidget { | |
| final int index; | |
| const NumberCircleAvatar({Key key, this.index = 0}) : super(key: key); | |
| @override | |
| Widget build(BuildContext context) { | |
| return CircleAvatar( | |
| child: Text( |