WIP #412
This commit is contained in:
parent
bc237796b2
commit
0815840a9c
@ -86,6 +86,7 @@ part 'entity_widgets/controls/media_player_widgets.dart';
|
|||||||
part 'entity_widgets/controls/fan_controls.dart';
|
part 'entity_widgets/controls/fan_controls.dart';
|
||||||
part 'entity_widgets/controls/alarm_control_panel_controls.dart';
|
part 'entity_widgets/controls/alarm_control_panel_controls.dart';
|
||||||
part 'settings.page.dart';
|
part 'settings.page.dart';
|
||||||
|
part 'purchase.page.dart';
|
||||||
part 'panel.page.dart';
|
part 'panel.page.dart';
|
||||||
part 'home_assistant.class.dart';
|
part 'home_assistant.class.dart';
|
||||||
part 'log.page.dart';
|
part 'log.page.dart';
|
||||||
@ -148,6 +149,7 @@ class HAClientApp extends StatelessWidget {
|
|||||||
"/": (context) => MainPage(title: 'HA Client', homeAssistant: homeAssistant,),
|
"/": (context) => MainPage(title: 'HA Client', homeAssistant: homeAssistant,),
|
||||||
"/connection-settings": (context) => ConnectionSettingsPage(title: "Settings"),
|
"/connection-settings": (context) => ConnectionSettingsPage(title: "Settings"),
|
||||||
"/configuration": (context) => PanelPage(title: "Configuration"),
|
"/configuration": (context) => PanelPage(title: "Configuration"),
|
||||||
|
"/putchase": (context) => PurchasePage(title: "Support app development"),
|
||||||
"/log-view": (context) => LogViewPage(title: "Log"),
|
"/log-view": (context) => LogViewPage(title: "Log"),
|
||||||
"/login": (_) => WebviewScaffold(
|
"/login": (_) => WebviewScaffold(
|
||||||
url: "${Connection().oauthUrl}",
|
url: "${Connection().oauthUrl}",
|
||||||
@ -532,6 +534,15 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
Divider(),
|
Divider(),
|
||||||
|
new ListTile(
|
||||||
|
leading: Icon(Icons.insert_drive_file),
|
||||||
|
title: Text("Support app development"),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
Navigator.of(context).pushNamed('/putchase');
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Divider(),
|
||||||
new ListTile(
|
new ListTile(
|
||||||
leading: Icon(Icons.help),
|
leading: Icon(Icons.help),
|
||||||
title: Text("Help"),
|
title: Text("Help"),
|
||||||
@ -872,6 +883,7 @@ class _MainPageState extends State<MainPage> with WidgetsBindingObserver, Ticker
|
|||||||
_showEntityPageSubscription?.cancel();
|
_showEntityPageSubscription?.cancel();
|
||||||
_showErrorSubscription?.cancel();
|
_showErrorSubscription?.cancel();
|
||||||
_startAuthSubscription?.cancel();
|
_startAuthSubscription?.cancel();
|
||||||
|
_subscription?.cancel();
|
||||||
_reloadUISubscription?.cancel();
|
_reloadUISubscription?.cancel();
|
||||||
//TODO disconnect
|
//TODO disconnect
|
||||||
//widget.homeAssistant?.disconnect();
|
//widget.homeAssistant?.disconnect();
|
||||||
|
53
lib/purchase.page.dart
Normal file
53
lib/purchase.page.dart
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
part of 'main.dart';
|
||||||
|
|
||||||
|
class PurchasePage extends StatefulWidget {
|
||||||
|
PurchasePage({Key key, this.title}) : super(key: key);
|
||||||
|
|
||||||
|
final String title;
|
||||||
|
|
||||||
|
@override
|
||||||
|
_PurchasePageState createState() => new _PurchasePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PurchasePageState extends State<PurchasePage> {
|
||||||
|
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
_loadProducts();
|
||||||
|
}
|
||||||
|
|
||||||
|
_loadProducts() async {
|
||||||
|
const Set<String> _kIds = {'flat_white_a_month', 'lunch_a_month22'};
|
||||||
|
final ProductDetailsResponse response = await InAppPurchaseConnection.instance.queryProductDetails(_kIds);
|
||||||
|
if (!response.notFoundIDs.isEmpty) {
|
||||||
|
Logger.d("Not found products: ${response.notFoundIDs}");
|
||||||
|
}
|
||||||
|
List<ProductDetails> products = response.productDetails;
|
||||||
|
for (ProductDetails product in products) {
|
||||||
|
Logger.d("Product: ${product}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return new Scaffold(
|
||||||
|
appBar: new AppBar(
|
||||||
|
leading: IconButton(icon: Icon(Icons.arrow_back), onPressed: (){
|
||||||
|
Navigator.pop(context);
|
||||||
|
}),
|
||||||
|
title: new Text(widget.title),
|
||||||
|
actions: <Widget>[
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.content_copy),
|
||||||
|
onPressed: () {
|
||||||
|
//
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: Text("Hi!"),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user