-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add empty card and function improve (#10)
* add empty card and function improve * add notes
- Loading branch information
Showing
9 changed files
with
177 additions
and
29 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import 'package:flutter/material.dart'; | ||
import '../services/localization_service.dart'; | ||
|
||
class CustomAboutDialog extends StatelessWidget { | ||
const CustomAboutDialog({super.key}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = LocalizationService.of(context); | ||
final textTheme = Theme.of(context).textTheme; | ||
|
||
return Dialog( | ||
shape: RoundedRectangleBorder( | ||
borderRadius: BorderRadius.circular(16), | ||
), | ||
child: SingleChildScrollView( | ||
child: Padding( | ||
padding: const EdgeInsets.all(24.0), | ||
child: Column( | ||
mainAxisSize: MainAxisSize.min, | ||
children: [ | ||
Text( | ||
l10n.translate('app_name'), | ||
style: textTheme.headlineSmall?.copyWith( | ||
fontWeight: FontWeight.bold, | ||
), | ||
), | ||
const SizedBox(height: 16), | ||
Text( | ||
l10n.translate('version', args: {'version': '1.0.0'}), | ||
style: textTheme.bodyLarge, | ||
), | ||
const SizedBox(height: 8), | ||
Text( | ||
'© 2024 Auth2', | ||
style: textTheme.bodyMedium?.copyWith( | ||
color: Colors.grey[600], | ||
), | ||
), | ||
// const SizedBox(height: 16), | ||
// Text( | ||
// l10n.translate('created_by', args: {'author': 'Wang Yimin'}), | ||
// style: textTheme.bodyMedium, | ||
// ), | ||
const SizedBox(height: 24), | ||
Container( | ||
padding: const EdgeInsets.all(12), | ||
decoration: BoxDecoration( | ||
color: Colors.grey[100], | ||
borderRadius: BorderRadius.circular(8), | ||
), | ||
child: Text( | ||
l10n.translate('disclaimer'), | ||
style: textTheme.bodySmall?.copyWith( | ||
color: Colors.grey[600], | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
), | ||
const SizedBox(height: 24), | ||
TextButton( | ||
onPressed: () => Navigator.of(context).pop(), | ||
child: Text(l10n.translate('close')), | ||
), | ||
], | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import 'package:flutter/material.dart'; | ||
import '../services/localization_service.dart'; | ||
|
||
class EmptyStateWidget extends StatelessWidget { | ||
final VoidCallback onAddPressed; | ||
|
||
const EmptyStateWidget({ | ||
super.key, | ||
required this.onAddPressed, | ||
}); | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final l10n = LocalizationService.of(context); | ||
|
||
return Center( | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 24.0), | ||
child: Column( | ||
mainAxisAlignment: MainAxisAlignment.center, | ||
children: [ | ||
Text( | ||
l10n.translate('no_accounts'), | ||
style: const TextStyle( | ||
fontSize: 18, | ||
color: Colors.grey, | ||
), | ||
textAlign: TextAlign.center, | ||
), | ||
const SizedBox(height: 16), | ||
ElevatedButton.icon( | ||
onPressed: onAddPressed, | ||
icon: const Icon(Icons.add), | ||
label: Text(l10n.translate('add_account')), | ||
), | ||
], | ||
), | ||
), | ||
); | ||
} | ||
} |