Untitled

mail@pastecode.io avatar
unknown
dart
25 days ago
1.7 kB
4
Indexable
Never
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:providerbase/core/constants/navigator.dart';
import 'package:providerbase/core/shared_widget/main_app_bar.dart';
import 'package:providerbase/presentation/notifiers/theme/theme_notifier.dart';
import 'package:providerbase/presentation/props/main_app_bar_props/main_app_bar_props.dart';
import 'package:providerbase/presentation/resources/color_manager.dart';

class ReadPages extends StatelessWidget {
  final String title;
  final String body;
  final String page;
  const ReadPages(
      {required this.title, required this.body, required this.page, Key? key})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    ThemeNotifier themeNotifier = Provider.of<ThemeNotifier>(
      context,
      listen: true,
    );
    return Scaffold(
      appBar: MainAppBar(
        props: MainAppBarProps(
          title: page,
          centerTitle: true,
          trailing: SizedBox(),
        ),
      ),
      body: ListView(
        padding: const EdgeInsets.all(20),
        children: [
          SizedBox(height: 20),
          Text(
            title,
            style: themeNotifier.getTheme().textTheme.headline1?.copyWith(
                  fontSize: 16,
                  color: ColorManager.black,
                ),
          ),
          SizedBox(height: 8),
          Text(
            body,
            style: themeNotifier.getTheme().textTheme.displaySmall?.copyWith(
                fontSize: 14,
                color: ColorManager.black,
                fontFamily: 'Avenir Arabic'),
          ),
        ],
      ),
    );
  }
}
Leave a Comment