import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:mohem_flutter_app/classes/colors.dart';
import 'package:mohem_flutter_app/extensions/int_extensions.dart';
import 'package:mohem_flutter_app/extensions/string_extensions.dart';
import 'package:mohem_flutter_app/generated/locale_keys.g.dart';
import 'package:mohem_flutter_app/provider/hmg_connection_provider.dart';
import 'package:provider/provider.dart';

class HmgConnectivityButton extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    Provider.of<HmgConnectionProvider>(context, listen: false).checkHmgNetworkConnectivity();
    return Consumer<HmgConnectionProvider>(
      builder: (_, HmgConnectionProvider foo, __) {
        return Container(
          height: 45,
          padding: const EdgeInsets.only(left: 12, right: 12),
          decoration: BoxDecoration(
            borderRadius: BorderRadius.circular(200.0),
            gradient: const LinearGradient(
              transform: GradientRotation(.83),
              begin: Alignment.topRight,
              end: Alignment.bottomLeft,
              colors: <Color>[
                MyColors.gradiantEndColor,
                MyColors.gradiantStartColor,
              ],
            ),
          ),
          child: InkWell(
            onTap: (){

            },
            child: Row(
              children: [
                const Icon(
                  Icons.wifi,
                  color: Colors.white,
                ),
                12.width,
                LocaleKeys.connectHmgWifi.tr().toText18(color: Colors.white),
              ],
            ),
          ),
        );
      },
    );
  }
}
