Build exchange workspace and shared transaction services (#28)
This commit is contained in:
1 parent
52b7135eda
commit
c496da8a55
48 files changed
+4757
-120
No files matched your search
@@ -0,0 +1,80 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:go_router/go_router.dart';
|
||||
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
import 'package:sxchnge_kyc/sxchnge_kyc.dart';
|
||||
|
||||
import 'package:sxchnge_wallet/sxchnge_wallet.dart';
|
||||
|
||||
import '../kyc/limits.dart';
|
||||
|
||||
import '../generated/i18n/app_localizations.dart';
|
||||
|
||||
class LimitsPage extends StatefulWidget {
|
||||
const LimitsPage({super.key});
|
||||
@override
|
||||
State<LimitsPage> createState() => _LimitsPageState();
|
||||
}
|
||||
|
||||
class _LimitsPageState extends State<LimitsPage> {
|
||||
late final _provider = WorkspaceLimitsProvider(
|
||||
context.read<LimitsService>(),
|
||||
context.read<WalletProvider>(),
|
||||
);
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (mounted) _provider.refresh();
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_provider.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final l = AppLocalizations.of(context)!;
|
||||
return ChangeNotifierProvider<LimitsProvider>.value(
|
||||
value: _provider,
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(24),
|
||||
child: Center(
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 720),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
Text(
|
||||
l.wLimits,
|
||||
style: Theme.of(context).textTheme.displaySmall,
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Text(l.wLimitsScope),
|
||||
const SizedBox(height: 24),
|
||||
const LimitsPanel(),
|
||||
const SizedBox(height: 20),
|
||||
FilledButton(
|
||||
onPressed: () async {
|
||||
await context.push('/identity');
|
||||
if (mounted) _provider.refresh();
|
||||
},
|
||||
child: Text(l.wIdentity),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: _provider.refresh,
|
||||
child: Text(l.wRefresh),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user