fix(devices details page): style fixes
This commit is contained in:
@ -505,6 +505,15 @@ class _DeviceDetailsPageState extends ConsumerState<DeviceDetailsPage> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
SizedBox(
|
||||||
|
width: double.infinity,
|
||||||
|
child: FilledButton.icon(
|
||||||
|
onPressed: _connectButtonToBike,
|
||||||
|
icon: const Icon(Icons.link),
|
||||||
|
label: const Text('Connect Button to Bike'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
GearRatioEditorCard(
|
GearRatioEditorCard(
|
||||||
ratios: _gearRatios,
|
ratios: _gearRatios,
|
||||||
defaultGearIndex: _defaultGearIndex,
|
defaultGearIndex: _defaultGearIndex,
|
||||||
@ -521,15 +530,6 @@ class _DeviceDetailsPageState extends ConsumerState<DeviceDetailsPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
|
||||||
SizedBox(
|
|
||||||
width: double.infinity,
|
|
||||||
child: FilledButton.icon(
|
|
||||||
onPressed: _connectButtonToBike,
|
|
||||||
icon: const Icon(Icons.link),
|
|
||||||
label: const Text('Connect Button to Bike'),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|||||||
@ -52,8 +52,6 @@ class _GearRatioEditorCardState extends State<GearRatioEditorCard> {
|
|||||||
|
|
||||||
double get _inlineAddEdgeOffset => _inlineAddRadius + 2;
|
double get _inlineAddEdgeOffset => _inlineAddRadius + 2;
|
||||||
|
|
||||||
double get _editorTilesTopInset => _inlineAddEdgeOffset + _inlineAddRadius;
|
|
||||||
|
|
||||||
bool _isExpanded = false;
|
bool _isExpanded = false;
|
||||||
bool _isEditing = false;
|
bool _isEditing = false;
|
||||||
bool _sortAscending = true;
|
bool _sortAscending = true;
|
||||||
@ -196,7 +194,7 @@ class _GearRatioEditorCardState extends State<GearRatioEditorCard> {
|
|||||||
child: AnimatedContainer(
|
child: AnimatedContainer(
|
||||||
duration: _animDuration,
|
duration: _animDuration,
|
||||||
curve: _animCurve,
|
curve: _animCurve,
|
||||||
height: _isExpanded ? 210 : 130,
|
height: _isExpanded ? 240 : 130,
|
||||||
child: _GearRatioGraph(
|
child: _GearRatioGraph(
|
||||||
ratios: _isEditing ? _draft : _committed,
|
ratios: _isEditing ? _draft : _committed,
|
||||||
compact: !_isExpanded,
|
compact: !_isExpanded,
|
||||||
@ -265,8 +263,8 @@ class _GearRatioEditorCardState extends State<GearRatioEditorCard> {
|
|||||||
if (_draft.isEmpty)
|
if (_draft.isEmpty)
|
||||||
const Padding(
|
const Padding(
|
||||||
padding: EdgeInsets.fromLTRB(14, 0, 14, 10),
|
padding: EdgeInsets.fromLTRB(14, 0, 14, 10),
|
||||||
child:
|
child: Text(
|
||||||
Text('No ratios yet. Load a preset to start editing.'),
|
'No ratios yet. Add a gear or load a preset to start editing.'),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(14, 0, 14, 8),
|
padding: const EdgeInsets.fromLTRB(14, 0, 14, 8),
|
||||||
@ -307,16 +305,12 @@ class _GearRatioEditorCardState extends State<GearRatioEditorCard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Padding(
|
Padding(
|
||||||
padding: const EdgeInsets.fromLTRB(10, 0, 10, 12),
|
padding: const EdgeInsets.fromLTRB(10, 0, 10, 0),
|
||||||
child: AnimatedSwitcher(
|
child: AnimatedSwitcher(
|
||||||
duration: _animDuration,
|
duration: _animDuration,
|
||||||
switchInCurve: _animCurve,
|
switchInCurve: _animCurve,
|
||||||
switchOutCurve: Curves.easeInCubic,
|
switchOutCurve: Curves.easeInCubic,
|
||||||
transitionBuilder: _snappyTransition,
|
transitionBuilder: _snappyTransition,
|
||||||
child: Padding(
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
top: _editorTilesTopInset,
|
|
||||||
),
|
|
||||||
child: Column(
|
child: Column(
|
||||||
key: ValueKey('editors-$_gearLayoutVersion'),
|
key: ValueKey('editors-$_gearLayoutVersion'),
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
@ -324,7 +318,6 @@ class _GearRatioEditorCardState extends State<GearRatioEditorCard> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
@ -1071,10 +1064,13 @@ class _GearRatioGraph extends StatelessWidget {
|
|||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
if (!compact)
|
if (!compact)
|
||||||
Text(
|
Container(
|
||||||
|
padding: const EdgeInsets.only(bottom: 6),
|
||||||
|
child: Text(
|
||||||
'Input RPM -> Output RPM',
|
'Input RPM -> Output RPM',
|
||||||
style: textTheme.bodySmall,
|
style: textTheme.bodySmall,
|
||||||
),
|
),
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: CustomPaint(
|
child: CustomPaint(
|
||||||
painter: _GearRatioGraphPainter(
|
painter: _GearRatioGraphPainter(
|
||||||
|
|||||||
Reference in New Issue
Block a user