Skip to content

Commit

Permalink
chore: UI improve
Browse files Browse the repository at this point in the history
  • Loading branch information
MuZhou233 committed Oct 14, 2023
1 parent f20b963 commit faad892
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 180 deletions.
121 changes: 61 additions & 60 deletions lib/view/pages/gebura/gebura_store.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,67 +61,68 @@ class _GeburaStorePageState extends State<GeburaStorePage>

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Scaffold(
backgroundColor: Colors.transparent,
body: _buildStatePage(),
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
title: BootstrapContainer(
children: [
BootstrapColumn(
xxs: 12,
md: 6,
child: LayoutBuilder(builder: (context, constrains) {
final width = constrains.maxWidth; // 父级宽度
const height = 45.0;
return Container(
width: width,
height: height,
decoration: BoxDecoration(
border:
Border.all(color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(height)),
child: TextField(
controller: controller,
decoration: InputDecoration(
hintText: '搜索',
hintStyle: const TextStyle(
color: Colors.grey, fontSize: height / 3),
contentPadding:
const EdgeInsets.only(top: height / 5),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
fillColor: Colors.transparent,
hoverColor: Colors.transparent,
icon: Padding(
padding: const EdgeInsets.only(left: 10, top: 4),
child: Icon(
Icons.search,
size: 18,
color: Theme.of(context).primaryColor,
)),
suffixIcon: IconButton(
icon: const Icon(
Icons.close,
return Scaffold(
backgroundColor: Colors.transparent,
body: Padding(
padding: const EdgeInsets.only(left: 8, right: 8),
child: _buildStatePage(),
),
appBar: AppBar(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8)),
),
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
title: BootstrapContainer(
children: [
BootstrapColumn(
xxs: 12,
md: 6,
child: LayoutBuilder(builder: (context, constrains) {
final width = constrains.maxWidth; // 父级宽度
const height = 45.0;
return Container(
width: width,
height: height,
decoration: BoxDecoration(
border: Border.all(color: Theme.of(context).primaryColor),
borderRadius: BorderRadius.circular(height)),
child: TextField(
controller: controller,
decoration: InputDecoration(
hintText: '搜索',
hintStyle: const TextStyle(
color: Colors.grey, fontSize: height / 3),
contentPadding: const EdgeInsets.only(top: height / 5),
border: InputBorder.none,
enabledBorder: InputBorder.none,
focusedBorder: InputBorder.none,
fillColor: Colors.transparent,
hoverColor: Colors.transparent,
icon: Padding(
padding: const EdgeInsets.only(left: 10, top: 4),
child: Icon(
Icons.search,
size: 18,
),
onPressed: () {
controller.text = '';
loadStore();
},
splashColor: Theme.of(context).primaryColor,
color: Theme.of(context).primaryColor,
)),
onEditingComplete: loadStore,
),
);
}),
)
],
),
color: Theme.of(context).primaryColor,
)),
suffixIcon: IconButton(
icon: const Icon(
Icons.close,
size: 18,
),
onPressed: () {
controller.text = '';
loadStore();
},
splashColor: Theme.of(context).primaryColor,
color: Theme.of(context).primaryColor,
)),
onEditingComplete: loadStore,
),
);
}),
)
],
),
),
);
Expand Down
19 changes: 11 additions & 8 deletions lib/view/pages/settings/client_setting_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@ class ClientSettingPage extends StatelessWidget {

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
title: const Text('设置'),
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
return Scaffold(
backgroundColor: Colors.transparent,
appBar: AppBar(
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(8)),
),
body: Material(
title: const Text('设置'),
backgroundColor: Theme.of(context).colorScheme.surfaceVariant,
),
body: Padding(
padding: const EdgeInsets.all(8),
child: Material(
color: Colors.transparent,
child: BlocBuilder<AppSettingBloc, AppSettingState>(
builder: (context, state) {
Expand Down
203 changes: 103 additions & 100 deletions lib/view/pages/yesod/yesod_config_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ class _YesodConfigPageState extends State<YesodConfigPage>
color: bgColor,
borderRadius: BorderRadius.circular(12),
),
padding: const EdgeInsets.all(8),
child: InkWell(
borderRadius: BorderRadius.circular(12),
onTap: () {
unawaited(showDialog<void>(
context: context,
Expand All @@ -88,63 +88,66 @@ class _YesodConfigPageState extends State<YesodConfigPage>
),
));
},
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(8),
child: item.feed.image.url.isNotEmpty
? Container(
decoration: BoxDecoration(
borderRadius:
SpacingHelper.defaultBorderRadius,
image: DecorationImage(
image: CachedNetworkImageProvider(
item.feed.image.url,
),
fit: BoxFit.cover),
child: Padding(
padding: const EdgeInsets.all(8),
child: Row(
children: [
Padding(
padding: const EdgeInsets.all(8),
child: item.feed.image.url.isNotEmpty
? Container(
decoration: BoxDecoration(
borderRadius:
SpacingHelper.defaultBorderRadius,
image: DecorationImage(
image: CachedNetworkImageProvider(
item.feed.image.url,
),
fit: BoxFit.cover),
),
width: 48,
height: 48,
)
: const SizedBox(),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.config.feedUrl,
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: 10,
color: Theme.of(context).disabledColor),
maxLines: 2,
),
Text(item.config.name),
Text(
'${S.current.FEED_CONFIG_STATUS}: ${feedConfigStatusString(item.config.status)}'),
Text(
'上次更新:${DurationHelper.recentString(item.config.latestUpdateTime.toDateTime())}')
],
),
const Expanded(child: SizedBox()),
SizedBox(
width: 64,
height: 64,
child: IconButton(
onPressed: () {
unawaited(showDialog<void>(
context: context,
builder: (context) => YesodConfigEditDialog(
callback: _loadConfig,
config: item.config,
),
width: 48,
height: 48,
)
: const SizedBox(),
),
Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
item.config.feedUrl,
style: TextStyle(
overflow: TextOverflow.ellipsis,
fontSize: 10,
color: Theme.of(context).disabledColor),
maxLines: 2,
));
},
icon: const Icon(Icons.edit),
),
Text(item.config.name),
Text(
'${S.current.FEED_CONFIG_STATUS}: ${feedConfigStatusString(item.config.status)}'),
Text(
'上次更新:${DurationHelper.recentString(item.config.latestUpdateTime.toDateTime())}')
],
),
const Expanded(child: SizedBox()),
SizedBox(
width: 64,
height: 64,
child: IconButton(
onPressed: () {
unawaited(showDialog<void>(
context: context,
builder: (context) => YesodConfigEditDialog(
callback: _loadConfig,
config: item.config,
),
));
},
icon: const Icon(Icons.edit),
),
),
],
],
),
),
),
),
Expand All @@ -164,55 +167,55 @@ class _YesodConfigPageState extends State<YesodConfigPage>

@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(8),
child: Scaffold(
backgroundColor: Colors.transparent,
body: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Column(
children: [
Row(
children: [
const SizedBox(width: 8),
FilledButton.tonalIcon(
onPressed: () async {
await showDialog<bool>(
context: context,
builder: (context) {
return const YesodAdd();
},
).then((value) {
if (value == null || !value) {
return;
}
const Toast(
title: '',
message: '添加成功',
).show(context);
_loadConfig(refresh: true);
});
},
icon: const Icon(Icons.add),
label: const Text('添加订阅'),
),
const SizedBox(width: 8),
],
),
Expanded(
return Scaffold(
backgroundColor: Colors.transparent,
body: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Column(
children: [
Row(
children: [
const SizedBox(width: 8),
FilledButton.tonalIcon(
onPressed: () async {
await showDialog<bool>(
context: context,
builder: (context) {
return const YesodAdd();
},
).then((value) {
if (value == null || !value) {
return;
}
const Toast(
title: '',
message: '添加成功',
).show(context);
_loadConfig(refresh: true);
});
},
icon: const Icon(Icons.add),
label: const Text('添加订阅'),
),
const SizedBox(width: 8),
],
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8),
child: _buildStatePage(),
),
const SizedBox(
height: 8,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _loadConfig,
child: const Icon(Icons.refresh),
),
const SizedBox(
height: 8,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _loadConfig,
child: const Icon(Icons.refresh),
),
);
}
}
Loading

0 comments on commit faad892

Please sign in to comment.