Skip to content

Commit

Permalink
add view news button to schedule widget
Browse files Browse the repository at this point in the history
  • Loading branch information
smart7even committed Sep 4, 2024
1 parent 06d96ef commit 8b7beed
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
46 changes: 46 additions & 0 deletions lib/feature/schedule/widget/schedule_widget.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:intl/intl.dart';
import 'package:octopus/octopus.dart';
import 'package:uneconly/common/localization/localization.dart';
import 'package:uneconly/common/routing/routes.dart';
import 'package:uneconly/common/utils/date_utils.dart';
import 'package:uneconly/common/utils/string_utils.dart';
import 'package:uneconly/feature/schedule/model/schedule.dart';
Expand Down Expand Up @@ -118,6 +121,49 @@ class ScheduleWidget extends StatelessWidget {
}
}

slivers.add(
SliverToBoxAdapter(
child: Container(
height: 100,
// color: Theme.of(context).secondaryHeaderColor,
child: Column(
children: [
const Spacer(),
Padding(
padding: EdgeInsets.only(
left: 16,
right: 16,
bottom: MediaQuery.of(context).padding.bottom,
),
child: SizedBox(
height: 50,
width: double.infinity,
child: ElevatedButton(
onPressed: () {
context.octopus.push(
Routes.tutorials,
);
},
// shape rounded
style: ButtonStyle(
shape: WidgetStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
),
),
child: Text(
AppLocalizations.of(context)!.viewNews,
),
),
),
),
],
),
),
),
);

return slivers;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,6 @@
"news": "News",
"error": "Error",
"tryAgain": "Try again",
"homeWidget": "Home widget"
"homeWidget": "Home widget",
"viewNews": "View news"
}
3 changes: 2 additions & 1 deletion lib/l10n/app_ru.arb
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@
"news": "Новости",
"error": "Ошибка",
"tryAgain": "Попробовать снова",
"homeWidget": "Виджет на главном экране"
"homeWidget": "Виджет на главном экране",
"viewNews": "Посмотреть новости"
}

0 comments on commit 8b7beed

Please sign in to comment.