import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:go_router/go_router.dart';

import '../../../../../common/routing/routes.dart';
import '../../../../../common/extension/getCharCodes.dart';
import 'wifi_bar_icon.dart';

class AccessPointTileDemo extends ConsumerWidget {
  const AccessPointTileDemo({
    super.key,
  });

  @override
  Widget build(BuildContext context, WidgetRef ref) {
    return Card(
      child: InkWell(
        borderRadius: Theme.of(context).useMaterial3
            ? const BorderRadius.all(Radius.circular(12.0))
            : const BorderRadius.all(Radius.circular(4.0)),
        onTap: () {
          context.pushNamed(
            RoutesSettings.accesspoint.name,
          );
        },
        child: ListTile(
          leading: const Row(
            mainAxisSize: MainAxisSize.min,
            crossAxisAlignment: CrossAxisAlignment.end,
            children: [
              WifiBarIcon(strength: 1),
              if (true)
                Icon(
                  Icons.lock,
                  size: 14,
                )
            ],
          ),
          title: Text(String.fromCharCodes('Demo SSID'.getCharCodes())),
          trailing: (false) // connected or not
              ? const Text('Connected')
              : null,
        ),
      ),
    );
  }
}
