Skip to content

Mr #13609

Description

@degfewubalem-png

Page URL

https://docs.flutter.dev/install

Page source

https://github.com/flutter/website/blob/main/sites/docs/src/content/install/index.md

Describe the problem

import 'package:flutter/material.dart';

void main() {
runApp(const PlayFyApp());
}

class PlayFyApp extends StatelessWidget {
const PlayFyApp({super.key});

@OverRide
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData.dark().copyWith(
scaffoldBackgroundColor: const Color(0xFF0F172A), // Dark navy background
),
home: const MainHomeScreen(),
);
}
}

class MainHomeScreen extends StatefulWidget {
const MainHomeScreen({super.key});

@OverRide
State createState() => _MainHomeScreenState();
}

class _MainHomeScreenState extends State {
int _currentIndex = 0;

@OverRide
Widget build(BuildContext context) {
return Scaffold(
// 1. የላይኛው App Bar
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0,
title: const Text(
'PLAYFy TV',
style: TextStyle(fontSize: 22, fontWeight: FontWeight.bold),
),
actions: [
IconButton(icon: const Icon(Icons.favorite_border), onPressed: () {}),
IconButton(icon: const Icon(Icons.refresh), onPressed: () {}),
IconButton(icon: const Icon(Icons.search), onPressed: () {}),
],
),

  // 2. የዋናው ገፅ ይዘት
  body: SingleChildScrollView(
    child: Padding(
      padding: const EdgeInsets.all(12.0),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          // Filter Buttons (All, Live, Upcoming)
          Row(
            children: [
              _buildFilterChip('All (73)', isSelected: true),
              const SizedBox(width: 8),
              _buildFilterChip('Live (4)', isSelected: false),
              const SizedBox(width: 8),
              _buildFilterChip('Recent (0)', isSelected: false),
            ],
          ),
          const SizedBox(height: 16),

          // የጨዋታ ካርድ ናሙና (Match Card Example)
          _buildMatchCard(
            league: 'Cricket | Lanka Premier League',
            time: '38:45',
            team1: 'Jaffna Kings',
            team2: 'Colombo Kaps',
          ),
          const SizedBox(height: 12),
          _buildMatchCard(
            league: 'Football | Calcutta Premier Division',
            time: '38:35',
            team1: 'Kalighat MS',
            team2: 'Kidderpore SC',
          ),
        ],
      ),
    ),
  ),

  // 3. የታችኛው Navigation Bar
  bottomNavigationBar: BottomNavigationBar(
    currentIndex: _currentIndex,
    onTap: (index) {
      setState(() {
        _currentIndex = index;
      });
    },
    type: BottomNavigationBarType.fixed,
    backgroundColor: const Color(0xFF1E293B),
    selectedItemColor: Colors.blueAccent,
    unselectedItemColor: Colors.grey,
    items: const [
      BottomNavigationBarItem(
        icon: Icon(Icons.sensors),
        label: 'Live Events',
      ),
      BottomNavigationBarItem(
        icon: Icon(Icons.category),
        label: 'Categories',
      ),
      BottomNavigationBarItem(
        icon: Icon(Icons.play_circle_outline),
        label: 'Highlights',
      ),
      BottomNavigationBarItem(
        icon: Icon(Icons.settings),
        label: 'Settings',
      ),
    ],
  ),
);

}

// የFilter Chip ዲዛይን
Widget _buildFilterChip(String label, {required bool isSelected}) {
return Container(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
decoration: BoxDecoration(
color: isSelected ? Colors.blueAccent.withOpacity(0.2) : Colors.white10,
borderRadius: BorderRadius.circular(20),
border: Border.all(
color: isSelected ? Colors.blueAccent : Colors.transparent,
),
),
child: Text(
label,
style: TextStyle(
color: isSelected ? Colors.white : Colors.grey,
fontWeight: FontWeight.bold,
),
),
);
}

// የMatch Card ዲዛይን
Widget _buildMatchCard({
required String league,
required String time,
required String team1,
required String team2,
}) {
return Container(
padding: const EdgeInsets.all(12),
decoration: BoxDecoration(
color: const Color(0xFF1E293B),
borderRadius: BorderRadius.circular(12),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(league, style: const TextStyle(color: Colors.grey, fontSize: 12)),
Text('Match Started $time', style: const TextStyle(color: Colors.blueAccent, fontSize: 12)),
],
),
const SizedBox(height: 12),
Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [
Expanded(child: Text(team1, textAlign: TextAlign.center, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold))),
Container(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
decoration: BoxDecoration(
color: Colors.red.withOpacity(0.2),
borderRadius: BorderRadius.circular(8),
),
child: const Text('Live', style: TextStyle(color: Colors.red, fontSize: 10)),
),
Expanded(child: Text(team2, textAlign: TextAlign.center, style: const TextStyle(color: Colors.white, fontWeight: FontWeight.bold))),
],
),
],
),
);
}
}

Expected fix

No response

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on docs.flutter.dev.

Metadata

Metadata

Assignees

No one assigned

    Labels

    from.page-issueReported in a reader-filed concern

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions