✨ About page
This commit is contained in:
@@ -17,19 +17,17 @@ class CalcApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return MaterialApp.router(
|
||||
title: '方程计算器',
|
||||
title: 'SimpleMathCalc',
|
||||
theme: ThemeData(
|
||||
primarySwatch: Colors.blue,
|
||||
useMaterial3: true,
|
||||
textTheme: GoogleFonts.notoSerifScTextTheme(
|
||||
Theme.of(context).textTheme, // Inherit existing text theme
|
||||
ThemeData().textTheme, // Inherit existing text theme
|
||||
),
|
||||
),
|
||||
darkTheme: ThemeData.dark().copyWith(
|
||||
primaryColor: Colors.blue,
|
||||
textTheme: GoogleFonts.notoSerifScTextTheme(
|
||||
Theme.of(context).textTheme,
|
||||
),
|
||||
textTheme: GoogleFonts.notoSerifScTextTheme(ThemeData.dark().textTheme),
|
||||
),
|
||||
themeMode: ThemeMode.system,
|
||||
routerConfig: _router,
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
|
||||
class AboutPage extends StatelessWidget {
|
||||
const AboutPage({super.key});
|
||||
@@ -6,45 +7,79 @@ class AboutPage extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(title: const Text('About')),
|
||||
body: Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Icon(
|
||||
Icons.calculate,
|
||||
size: 80,
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
appBar: AppBar(title: const Text('关于')),
|
||||
body: Center(
|
||||
child: SingleChildScrollView(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(maxWidth: 320),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Center(
|
||||
child: ClipRRect(
|
||||
borderRadius: const BorderRadius.all(Radius.circular(8)),
|
||||
child: Image.asset(
|
||||
'assets/icon.jpg',
|
||||
width: 80,
|
||||
height: 80,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'Simple Math Calc',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'简单数学计算器',
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Opacity(
|
||||
opacity: 0.8,
|
||||
child: Text(
|
||||
'这是一个用于求解方程和表达式的计算器应用。\n支持多种类型的数学计算,包括代数方程、表达式求值等。\n\n结果仅供参考,纯机器计算,无 AI 成分。\n\n在书写方程的时候,请勿使用中文符号,平方请使用 ^n 来表示 n 次方。\n\n理性使用,仅为辅助学习目的,过量使用有害考试成绩。',
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'© 2025 LittleSheep',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
'看看 LittleSheep 的其他作品',
|
||||
style: Theme.of(context).textTheme.titleMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.web),
|
||||
trailing: const Icon(Icons.chevron_right),
|
||||
title: const Text('Solar Network'),
|
||||
subtitle: const Text('aka Solian'),
|
||||
onTap: () => _launchUrl('https://web.solian.app'),
|
||||
),
|
||||
],
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'方程计算器',
|
||||
style: Theme.of(context).textTheme.headlineMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 10),
|
||||
Text(
|
||||
'Version 1.0.0',
|
||||
style: Theme.of(context).textTheme.bodyLarge,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
Text(
|
||||
'这是一个用于求解方程和表达式的计算器应用。\n\n支持多种类型的数学计算,包括代数方程、表达式求值等。',
|
||||
style: Theme.of(context).textTheme.bodyMedium,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
const SizedBox(height: 30),
|
||||
Text(
|
||||
'© 2025 Simple Math Calculator',
|
||||
style: Theme.of(context).textTheme.bodySmall,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _launchUrl(String url) async {
|
||||
final Uri uri = Uri.parse(url);
|
||||
if (!await launchUrl(uri)) {
|
||||
throw Exception('Could not launch $url');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -74,6 +74,8 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> {
|
||||
hintText: '例如: 2x^2 - 8x + 6 = 0',
|
||||
),
|
||||
onSubmitted: (_) => _solveEquation(),
|
||||
onTapOutside: (_) =>
|
||||
FocusManager.instance.primaryFocus?.unfocus(),
|
||||
),
|
||||
),
|
||||
IconButton(
|
||||
|
@@ -29,11 +29,8 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
body: _widgetOptions.elementAt(_selectedIndex),
|
||||
bottomNavigationBar: BottomNavigationBar(
|
||||
items: const <BottomNavigationBarItem>[
|
||||
BottomNavigationBarItem(
|
||||
icon: Icon(Icons.calculate),
|
||||
label: 'Calculator',
|
||||
),
|
||||
BottomNavigationBarItem(icon: Icon(Icons.info), label: 'About'),
|
||||
BottomNavigationBarItem(icon: Icon(Icons.calculate), label: '计算'),
|
||||
BottomNavigationBarItem(icon: Icon(Icons.info), label: '关于'),
|
||||
],
|
||||
currentIndex: _selectedIndex,
|
||||
onTap: _onItemTapped,
|
||||
|
Reference in New Issue
Block a user