diff options
author | 2023-11-16 22:44:34 -0300 | |
---|---|---|
committer | 2023-11-17 01:48:26 +0000 | |
commit | 4d77bab5a0f698943d1abf74482eecef7cc95f08 (patch) | |
tree | 49e0a590b5903cc7553b1a4fc3cb2fbcd13cebf4 /lib/presentation/screens/settings/settings_screens/wired | |
parent | 6a00ac1f8613048b5c1f7ecdbd1adcbbcfdca5ed (diff) |
Bug fixes. Fixed Fan mode selection off state bug.
Fixes ICS' internal AGL-48,49,50.
Original from Sabin Sajeevan <ssajeevan@ics.com>
Bug-AGL: SPEC-4971
Change-Id: I66c875551a69a1b53eee2d6e1d3fa725b20ff41b
Signed-off-by: Lisandro Pérez Meyer <lpmeyer@ics.com>
Diffstat (limited to 'lib/presentation/screens/settings/settings_screens/wired')
-rw-r--r-- | lib/presentation/screens/settings/settings_screens/wired/wired_screen.dart | 189 |
1 files changed, 131 insertions, 58 deletions
diff --git a/lib/presentation/screens/settings/settings_screens/wired/wired_screen.dart b/lib/presentation/screens/settings/settings_screens/wired/wired_screen.dart index 916b1b6..35225b8 100644 --- a/lib/presentation/screens/settings/settings_screens/wired/wired_screen.dart +++ b/lib/presentation/screens/settings/settings_screens/wired/wired_screen.dart @@ -1,4 +1,6 @@ +import 'package:flutter_ics_homescreen/core/utils/helpers.dart'; import 'package:flutter_ics_homescreen/export.dart'; +import 'package:get_ip_address/get_ip_address.dart'; class WiredPage extends ConsumerWidget { const WiredPage({super.key}); @@ -6,71 +8,142 @@ class WiredPage extends ConsumerWidget { static Page<void> page() => const MaterialPage<void>(child: WiredPage()); @override Widget build(BuildContext context, WidgetRef ref) { - return Scaffold( - body: Column( - children: [ - CommonTitle( - title: 'Wired', - hasBackButton: true, - onPressed: () { - context.flow<AppState>().update((state) => AppState.settings); - }, + return const Scaffold(body: WiredScreen()); + } +} + +class WiredScreen extends StatefulWidget { + const WiredScreen({super.key}); + + @override + State<WiredScreen> createState() => _WiredScreenState(); +} + +class _WiredScreenState extends State<WiredScreen> { + String deviceIP = "192.168.234.120"; + @override + void initState() { + super.initState(); + getIPAddress(); + } + + getIPAddress() async { + try { + /// Initialize Ip Address + var ipAddress = IpAddress(type: RequestType.text); + + /// Get the IpAddress based on requestType. + dynamic data = await ipAddress.getIpAddress(); + setState(() { + deviceIP = data.toString(); + }); + } on IpAddressException catch (exception) { + /// Handle the exception. + print(exception.message); + } + } + + @override + Widget build(BuildContext context) { + return Column( + children: [ + CommonTitle( + title: 'Wired', + hasBackButton: true, + onPressed: () { + context.flow<AppState>().update((state) => AppState.settings); + }, + ), + Container( + margin: const EdgeInsets.symmetric(horizontal: 120, vertical: 40), + padding: const EdgeInsets.symmetric(vertical: 17, horizontal: 24), + height: 140, + alignment: Alignment.center, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.centerLeft, + end: Alignment.centerRight, + stops: const [ + 0, + 0.01, + 0.8 + ], + colors: <Color>[ + Colors.white, + AGLDemoColors.neonBlueColor, + AGLDemoColors.neonBlueColor.withOpacity(0.15) + ]), ), - Padding( - padding: const EdgeInsets.symmetric(vertical: 50, horizontal: 80), - child: Container( - height: 130, - decoration: const BoxDecoration( - gradient: LinearGradient( - begin: Alignment.centerLeft, - end: Alignment.centerRight, - stops: [ - 0, - 0.01, - 0.8 + child: Row( + crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + // const SizedBox( + // width: 20, + // ), + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const Text( + 'hernet_0090451v407b_cable', + style: TextStyle(color: Colors.white, fontSize: 40), + ), + Text( + 'connected, $deviceIP', + style: + const TextStyle(color: Colors.white, fontSize: 26), + ), ], - colors: <Color>[ - Colors.white, - Colors.blue, - Color.fromARGB(16, 41, 98, 255) - ]), - ), - child: ListTile( - contentPadding: - const EdgeInsets.symmetric(vertical: 41, horizontal: 24), - - title: const Text( - 'hernet_0090451v407b_cable', - style: TextStyle(color: Colors.white, fontSize: 40), - ), - subtitle: const Text( - 'connected, 192.168.234.120', - style: TextStyle(color: Colors.white, fontSize: 26), - ), - trailing: ElevatedButton( - style: ElevatedButton.styleFrom( - backgroundColor: const Color(0xFF1C2D92), - side: const BorderSide(color: Color(0xFF285DF4), width: 2), ), - child: const Padding( - padding: - EdgeInsets.symmetric(vertical: 15.0, horizontal: 0), - child: Text( - - 'Configure', - style: TextStyle( - color: Color(0xFFC1D8FF), - fontSize: 26, + ), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(4), + color: AGLDemoColors.buttonFillEnabledColor, + border: Border.all(color: AGLDemoColors.neonBlueColor), + boxShadow: [Helpers.boxDropShadowRegular]), + child: Material( + color: Colors.transparent, + child: InkWell( + onTap: () {}, + borderRadius: BorderRadius.circular(4), + child: const Padding( + padding: + EdgeInsets.symmetric(vertical: 30, horizontal: 40), + child: Text( + "Configure", + style: TextStyle( + color: AGLDemoColors.periwinkleColor, + fontSize: 26), + ), ), ), ), - onPressed: () {}, ), - ), - ), - ), - ], - ), + // ElevatedButton( + // style: ElevatedButton.styleFrom( + // backgroundColor: const Color(0xFF1C2D92), + // side: + // const BorderSide(color: Color(0xFF285DF4), width: 2), + // ), + // child: const Padding( + // padding: + // EdgeInsets.symmetric(vertical: 15.0, horizontal: 0), + // child: Text( + // 'Configure', + // style: TextStyle( + // color: Color(0xFFC1D8FF), + // fontSize: 26, + // ), + // ), + // ), + // onPressed: () {}, + // ), + ]), + ), + ], ); } } |