feat(order info): added order info screen

This commit is contained in:
Username1548
2025-04-04 20:21:31 +07:00
parent 9715f4cac9
commit 748484cf8f
387 changed files with 16171 additions and 18199 deletions

View File

@@ -59,7 +59,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
void initState() {
super.initState();
setState(() {
this.baseUrlForTest = baseUrl;
baseUrlForTest = baseUrl;
});
testsStates = List.generate(testCases.length, (index) => TestState.notRun);
}
@@ -67,13 +67,13 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Для разработчиков')),
appBar: AppBar(title: const Text('Для разработчиков')),
body: SingleChildScrollView(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 10),
child: Column(
children: [
Padding(padding: const EdgeInsets.all(8.0), child: Row(children: [Text('BaseUrl: ${baseUrlForTest}')])),
Padding(padding: const EdgeInsets.all(8.0), child: Row(children: [Text('BaseUrl: $baseUrlForTest')])),
Row(
children: [
Expanded(child: CustomTextFormField(controller: controller, hintText: 'type new base url')),
@@ -94,16 +94,16 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
text: 'Set dev2 base url',
onPressed: () {
setState(() {
this.baseUrlForTest = baseUrl;
baseUrlForTest = baseUrl;
});
},
buttonStyle: ButtonStyle(),
buttonStyle: const ButtonStyle(),
),
SizedBox(height: baseUrlForTest != baseUrl ? 40 : 10),
ListView.builder(
shrinkWrap: true,
itemCount: testCases.length,
physics: NeverScrollableScrollPhysics(),
physics: const NeverScrollableScrollPhysics(),
itemBuilder:
(context, index) => Padding(
padding: const EdgeInsets.only(bottom: 10.0),
@@ -137,14 +137,14 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
showErrorToast('${testCases[index].name} failed');
}
},
buttonStyle: ButtonStyle(),
buttonStyle: const ButtonStyle(),
),
SizedBox(width: 5),
const SizedBox(width: 5),
switch (testsStates[index]) {
TestState.success => Container(width: 20, height: 20, color: Colors.green),
TestState.fail => Container(width: 20, height: 20, color: Colors.red),
TestState.notRun => Container(width: 20, height: 20, color: Colors.grey),
TestState.loading => Container(
TestState.loading => const SizedBox(
width: 20,
height: 20,
child: SizedBox(height: 20, width: 20, child: Center(child: CircularProgressIndicator())),
@@ -159,7 +159,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
const SizedBox(height: 10),
CustomOutlinedButton(
text: 'add token to server',
buttonStyle: ButtonStyle(),
buttonStyle: const ButtonStyle(),
onPressed: () async {
try {
final dio = sl<Dio>();
@@ -179,7 +179,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
const SizedBox(height: 10),
CustomOutlinedButton(
text: 'copy token',
buttonStyle: ButtonStyle(),
buttonStyle: const ButtonStyle(),
onPressed: () async {
try {
final token = await FirebaseApi().getToken();
@@ -197,7 +197,7 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
const SizedBox(height: 10),
CustomOutlinedButton(
text: 'remove token from server',
buttonStyle: ButtonStyle(),
buttonStyle: const ButtonStyle(),
onPressed: () async {
try {
final dio = sl<Dio>();
@@ -217,11 +217,11 @@ class _DevToolsScreenContentState extends State<DevToolsScreenContent> {
const SizedBox(height: 10),
CustomOutlinedButton(
text: 'send notification',
buttonStyle: ButtonStyle(),
buttonStyle: const ButtonStyle(),
onPressed: () async {
try {
final dio = sl<Dio>();
Future.delayed(Duration(seconds: 3), () async {
Future.delayed(const Duration(seconds: 3), () async {
await dio.post('/api/profile/notification/token/test');
});
} catch (e) {