@@ -376,12 +376,16 @@ class _ReaderMenuState extends State<ReaderMenu>
376
376
crossAxisAlignment: CrossAxisAlignment .center,
377
377
children: < Widget > [
378
378
SizedBox (height: 8 ),
379
- buildTitleWdget ("行间距 " ),
379
+ buildTitleWdget ("背景 " ),
380
380
SizedBox (height: 5 ),
381
381
Row (
382
382
children: < Widget > [
383
- buidIconBtnWdget (Icon (Icons .format_align_left), () {}),
384
- buidIconBtnWdget (Icon (Icons .format_align_justify), () {}),
383
+ buidIconBtnWdget (Icon (Icons .format_align_left), () {
384
+ switchReaderBgFunc ('assets/images/home_bg2.jpeg' );
385
+ }),
386
+ buidIconBtnWdget (Icon (Icons .format_align_justify), () {
387
+ switchReaderBgFunc ('assets/images/read_bg.jpeg' );
388
+ }),
385
389
buidIconBtnWdget (Icon (Icons .format_align_right), () {}),
386
390
],
387
391
),
@@ -413,6 +417,13 @@ class _ReaderMenuState extends State<ReaderMenu>
413
417
);
414
418
}
415
419
420
+ //切换背景
421
+ switchReaderBgFunc (String bgPath) {
422
+ print ("切换背景为:$bgPath " );
423
+ Config .readerBgImg = bgPath;
424
+ SpUtils .setValue (Config .readerCackeKey, bgPath);
425
+ }
426
+
416
427
//二级菜单横竖平设置
417
428
buildAnimatedIcon (IconData icon1, IconData icon2, bool left) {
418
429
var widthNum = (Screen .width - 11 ) / 3 ;
@@ -523,7 +534,7 @@ class _ReaderMenuState extends State<ReaderMenu>
523
534
//底部按钮单个
524
535
buildBottomItem (String title, String iconImg, Widget icon) {
525
536
return Container (
526
- padding: EdgeInsets .symmetric (vertical: 4 ),
537
+ padding: EdgeInsets .symmetric (vertical: 4 ),
527
538
child: GestureDetector (
528
539
onTap: () {
529
540
Toast .show ("功能暂未开放" );
0 commit comments