💄 Optimize designs

This commit is contained in:
2025-09-13 13:23:04 +08:00
parent 24a28f2837
commit 6e444f46fb
2 changed files with 23 additions and 16 deletions

View File

@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart'; import 'package:google_fonts/google_fonts.dart';
import 'package:latext/latext.dart'; import 'package:latext/latext.dart';
@@ -104,7 +105,12 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> {
floatingLabelAlignment: FloatingLabelAlignment.center, floatingLabelAlignment: FloatingLabelAlignment.center,
hintText: '例如: 2x^2 - 8x + 6 = 0', hintText: '例如: 2x^2 - 8x + 6 = 0',
), ),
keyboardType: TextInputType.number, keyboardType: kIsWeb
? TextInputType.numberWithOptions(
signed: true,
decimal: true,
)
: TextInputType.number,
onSubmitted: (_) => _solveEquation(), onSubmitted: (_) => _solveEquation(),
), ),
), ),
@@ -241,13 +247,13 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> {
return Material( return Material(
elevation: 8, elevation: 8,
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 12), padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 8),
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
spacing: 16, spacing: 8,
children: [ children: [
Expanded( Expanded(
child: Tooltip( child: Tooltip(
@@ -299,7 +305,7 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> {
const SizedBox(height: 8), const SizedBox(height: 8),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
spacing: 16, spacing: 8,
children: [ children: [
Expanded( Expanded(
child: Tooltip( child: Tooltip(
@@ -357,7 +363,8 @@ class _CalculatorHomePageState extends State<CalculatorHomePage> {
), ),
], ],
), ),
const SizedBox(height: 8), if (!kIsWeb) const SizedBox(height: 8),
if (!kIsWeb)
Row( Row(
children: [ children: [
Expanded( Expanded(

View File

@@ -16,7 +16,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1 version: 1.0.0+2
environment: environment:
sdk: ^3.9.2 sdk: ^3.9.2