Created
January 11, 2024 21:21
-
-
Save VB10/bc2657cea811e9224bd797aef2a4fa19 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:vbaseproject/features/v2/demo/home_veli_view.dart'; | |
mixin HomeVeliMixin on State<HomeVeliView> { | |
void showErrorMessage(); | |
void fetchUserDeteail({required String id}) { | |
const response = true; | |
if (!response) return; | |
showErrorMessage(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:vbaseproject/features/v2/demo/home_veli_mixin.dart'; | |
class HomeVeliView extends StatefulWidget { | |
const HomeVeliView({super.key}); | |
@override | |
State<HomeVeliView> createState() => _HomeVeliViewState(); | |
} | |
class _HomeVeliViewState extends State<HomeVeliView> with HomeVeliMixin { | |
@override | |
Widget build(BuildContext context) { | |
return Scaffold( | |
floatingActionButton: FloatingActionButton( | |
onPressed: () => fetchUserDeteail(id: 'vb'), | |
), | |
appBar: AppBar( | |
title: const Text('Veli'), | |
), | |
body: const Center( | |
child: Text('Veli'), | |
), | |
); | |
} | |
@override | |
void showErrorMessage() { | |
{ | |
showDialog<bool>( | |
context: context, | |
builder: (context) { | |
return const Text('Olley hsogeldin'); | |
}, | |
); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a sample about delegation for flutter