Last active
December 6, 2019 07:30
-
-
Save tirth-aubergine/17207098ca9d7e20de4545c201424f2d to your computer and use it in GitHub Desktop.
HomeProvider
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
import 'package:flutter/foundation.dart'; | |
/// | |
/// Manages state for screens/HomeScreen.dart | |
/// | |
class HomeProvider with ChangeNotifier { | |
// holds the path of selected xlsx file path | |
String _xlsxFilePath; | |
// holds the names of tables of selected xlsx file path | |
Map<String, dynamic> _xlsxFileTables; | |
// holds the name of selected table from dropdown in screens/home.dart | |
String _xlsxFileSelectedTable; | |
String get xlsxFilePath => this._xlsxFilePath; | |
set xlsxFilePath(String _xlsxFilePath) { | |
this._xlsxFilePath = _xlsxFilePath; | |
notifyListeners(); | |
} | |
Map<String, dynamic> get xlsxFileTables => this._xlsxFileTables; | |
set xlsxFileTables(Map<String, dynamic> _xlsxFileTables) { | |
this._xlsxFileTables = _xlsxFileTables; | |
this._xlsxFileSelectedTable = this._xlsxFileTables.keys.first; | |
notifyListeners(); | |
} | |
String get xlsxFileSelectedTable => this._xlsxFileSelectedTable; | |
set xlsxFileSelectedTable(String _xlsxFileSelectedTable) { | |
this._xlsxFileSelectedTable = _xlsxFileSelectedTable; | |
notifyListeners(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment