mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-19 08:14:21 +01:00
Merge pull request #126 from lollipopkit/fix_system_private_prompt
FIX:Fix system private prompt
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
import 'dart:async';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
@@ -25,22 +25,28 @@ class PrivateKeysListPage extends StatefulWidget {
|
|||||||
|
|
||||||
class _PrivateKeyListState extends State<PrivateKeysListPage> {
|
class _PrivateKeyListState extends State<PrivateKeysListPage> {
|
||||||
late S _s;
|
late S _s;
|
||||||
|
bool firstBuild = true;
|
||||||
@override
|
@override
|
||||||
void didChangeDependencies() {
|
void didChangeDependencies() {
|
||||||
super.didChangeDependencies();
|
super.didChangeDependencies();
|
||||||
_s = S.of(context)!;
|
this._s = S.of(context)!;
|
||||||
|
print(123);
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
|
//autoAddSystemPriavteKey();
|
||||||
autoAddSystemPriavteKey();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
if (this.firstBuild) {
|
||||||
|
Future.delayed(Duration.zero, () {
|
||||||
|
autoAddSystemPriavteKey(context);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_s = S.of(context)!;
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: Text(_s.privateKey, style: textSize18),
|
title: Text(_s.privateKey, style: textSize18),
|
||||||
@@ -86,7 +92,7 @@ class _PrivateKeyListState extends State<PrivateKeysListPage> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void autoAddSystemPriavteKey() {
|
void autoAddSystemPriavteKey(BuildContext context) {
|
||||||
final store = locator<PrivateKeyStore>();
|
final store = locator<PrivateKeyStore>();
|
||||||
// Only trigger on desktop platform and no private key saved
|
// Only trigger on desktop platform and no private key saved
|
||||||
if (isDesktop && store.box.keys.isEmpty) {
|
if (isDesktop && store.box.keys.isEmpty) {
|
||||||
|
|||||||
Reference in New Issue
Block a user