mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
fix & opt.
This commit is contained in:
@@ -2,9 +2,7 @@ import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:toolbox/core/route.dart';
|
||||
import 'package:toolbox/data/provider/snippet.dart';
|
||||
import 'package:toolbox/data/res/color.dart';
|
||||
import 'package:toolbox/data/res/font_style.dart';
|
||||
import 'package:toolbox/data/res/padding.dart';
|
||||
import 'package:toolbox/generated/l10n.dart';
|
||||
import 'package:toolbox/view/page/snippet/edit.dart';
|
||||
import 'package:toolbox/view/widget/round_rect_card.dart';
|
||||
@@ -17,8 +15,6 @@ class SnippetListPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _SnippetListPageState extends State<SnippetListPage> {
|
||||
final _textStyle = TextStyle(color: primaryColor);
|
||||
|
||||
late S _s;
|
||||
|
||||
@override
|
||||
@@ -54,30 +50,18 @@ class _SnippetListPageState extends State<SnippetListPage> {
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.all(13),
|
||||
itemCount: key.snippets.length,
|
||||
itemExtent: 57,
|
||||
itemBuilder: (context, idx) {
|
||||
return RoundRectCard(
|
||||
Padding(
|
||||
padding: roundRectCardPadding,
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
key.snippets[idx].name,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () => AppRoute(
|
||||
SnippetEditPage(snippet: key.snippets[idx]),
|
||||
'snippet edit page')
|
||||
.go(context),
|
||||
child: Text(
|
||||
_s.edit,
|
||||
style: _textStyle,
|
||||
),
|
||||
),
|
||||
],
|
||||
ListTile(
|
||||
title: Text(
|
||||
key.snippets[idx].name,
|
||||
),
|
||||
trailing: TextButton(
|
||||
onPressed: () => AppRoute(
|
||||
SnippetEditPage(snippet: key.snippets[idx]),
|
||||
'snippet edit page')
|
||||
.go(context),
|
||||
child: Text(_s.edit),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user