fixed translate bugs and subject name things
This commit is contained in:
@@ -6,7 +6,9 @@ import 'package:flutter/material.dart';
|
||||
import 'package:flutter_feather_icons/flutter_feather_icons.dart';
|
||||
|
||||
class HomeworkTile extends StatelessWidget {
|
||||
const HomeworkTile(this.homework, {Key? key, this.onTap, this.padding, this.censored = false}) : super(key: key);
|
||||
const HomeworkTile(this.homework,
|
||||
{Key? key, this.onTap, this.padding, this.censored = false})
|
||||
: super(key: key);
|
||||
|
||||
final Homework homework;
|
||||
final void Function()? onTap;
|
||||
@@ -24,7 +26,8 @@ class HomeworkTile extends StatelessWidget {
|
||||
visualDensity: VisualDensity.compact,
|
||||
contentPadding: const EdgeInsets.only(left: 8.0, right: 12.0),
|
||||
onTap: onTap,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)),
|
||||
shape:
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8.0)),
|
||||
leading: SizedBox(
|
||||
width: 44,
|
||||
height: 44,
|
||||
@@ -38,7 +41,8 @@ class HomeworkTile extends StatelessWidget {
|
||||
: Padding(
|
||||
padding: const EdgeInsets.only(top: 2.0),
|
||||
child: Icon(
|
||||
SubjectIcon.resolveVariant(subjectName: homework.subjectName, context: context),
|
||||
SubjectIcon.resolveVariant(
|
||||
subjectName: homework.subjectName, context: context),
|
||||
size: 28.0,
|
||||
color: AppColors.of(context).text.withOpacity(.75),
|
||||
),
|
||||
|
||||
@@ -6,6 +6,7 @@ import 'package:filcnaplo_mobile_ui/common/panel/panel.dart';
|
||||
import 'package:filcnaplo_mobile_ui/screens/news/news_tile.dart';
|
||||
import 'package:filcnaplo/models/news.dart';
|
||||
import 'package:filcnaplo_mobile_ui/screens/news/news_view.dart';
|
||||
import 'package:filcnaplo_mobile_ui/screens/settings/settings_screen.i18n.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:filcnaplo/api/providers/news_provider.dart';
|
||||
@@ -24,24 +25,28 @@ class NewsScreen extends StatelessWidget {
|
||||
appBar: AppBar(
|
||||
surfaceTintColor: Theme.of(context).scaffoldBackgroundColor,
|
||||
leading: BackButton(color: AppColors.of(context).text),
|
||||
title: Text("News", style: TextStyle(color: AppColors.of(context).text)),
|
||||
title: Text("news".i18n,
|
||||
style: TextStyle(color: AppColors.of(context).text)),
|
||||
),
|
||||
body: SafeArea(
|
||||
child: RefreshIndicator(
|
||||
onRefresh: () => newsProvider.fetch(),
|
||||
child: ListView.builder(
|
||||
physics: const BouncingScrollPhysics(parent: AlwaysScrollableScrollPhysics()),
|
||||
physics: const BouncingScrollPhysics(
|
||||
parent: AlwaysScrollableScrollPhysics()),
|
||||
itemCount: max(news.length, 1),
|
||||
itemBuilder: (context, index) {
|
||||
if (news.isNotEmpty) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 12.0),
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: 24.0, vertical: 12.0),
|
||||
child: Panel(
|
||||
child: Material(
|
||||
type: MaterialType.transparency,
|
||||
child: NewsTile(
|
||||
news[index],
|
||||
onTap: () => NewsView.show(news[index], context: context, force: true),
|
||||
onTap: () => NewsView.show(news[index],
|
||||
context: context, force: true),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user